mirror of https://github.com/Chlumsky/msdfgen.git
Merge branch 'test_support'
* test_support: Flush buffer as we go so we can get feedback via pipes/etc.
This commit is contained in:
commit
1449519cc6
|
|
@ -7,6 +7,13 @@ import tempfile
|
||||||
from subprocess import Popen, PIPE, call
|
from subprocess import Popen, PIPE, call
|
||||||
|
|
||||||
|
|
||||||
|
def println(msg):
|
||||||
|
sys.stdout.write(msg)
|
||||||
|
sys.stdout.write('\n')
|
||||||
|
sys.stdout.flush()
|
||||||
|
return msg
|
||||||
|
|
||||||
|
|
||||||
class Runner:
|
class Runner:
|
||||||
pass_count = 0
|
pass_count = 0
|
||||||
fail_count = 0
|
fail_count = 0
|
||||||
|
|
@ -25,10 +32,10 @@ class Runner:
|
||||||
def add_result(self, passed, input_path, msg, out_path=None, render_path=None, diff_path=None):
|
def add_result(self, passed, input_path, msg, out_path=None, render_path=None, diff_path=None):
|
||||||
if passed:
|
if passed:
|
||||||
self.pass_count += 1
|
self.pass_count += 1
|
||||||
print("PASS \"%s\" %s" % (input_path, msg))
|
println("PASS \"%s\" %s" % (input_path, msg))
|
||||||
else:
|
else:
|
||||||
self.fail_count += 1
|
self.fail_count += 1
|
||||||
print("FAIL \"%s\" %s" % (input_path, msg))
|
println("FAIL \"%s\" %s" % (input_path, msg))
|
||||||
if self.stop_on_fail:
|
if self.stop_on_fail:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
@ -54,7 +61,7 @@ def check_imagemagick():
|
||||||
stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=True)
|
stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=True)
|
||||||
output, err = p.communicate("")
|
output, err = p.communicate("")
|
||||||
if p.returncode != 0:
|
if p.returncode != 0:
|
||||||
print "Cannot find ImageMagick <http://www.imagemagick.org> on your PATH. It is required to run tests."
|
println("Cannot find ImageMagick <http://www.imagemagick.org> on your PATH. It is required to run tests.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue