Skip to content
Browse files

add more color to the visual test output

  • Loading branch information...
1 parent a767045 commit 8135ac8ac1e37e7f22544c313d5dbf1b684f57ef @springmeyer springmeyer committed Sep 27, 2012
Showing with 6 additions and 5 deletions.
  1. +3 −2 tests/visual_tests/compare.py
  2. +3 −3 tests/visual_tests/test.py
View
5 tests/visual_tests/compare.py
@@ -57,7 +57,8 @@ def summary(generate=False):
global errors
global passed
print "-"*80
- print "Visual text rendering summary:",
+ print "Visual text rendering summary:"
+ print "-"*80
if len(errors) != 0:
for error in errors:
if (error[0] is None):
@@ -69,7 +70,7 @@ def summary(generate=False):
else:
print "Could not verify %s: No reference image found!" % error[1]
else:
- print "Failed: %s different pixels:\n\t%s (actual)\n\t%s (expected)" % error
+ print "\x1b[34m%s different pixels\x1b[0m:\n\t%s (\x1b[31mactual\x1b[0m)\n\t%s (\x1b[32mexpected\x1b[0m)" % error
sys.exit(1)
else:
print 'All %s tests passed: \x1b[1;32m✓ \x1b[0m' % passed
View
6 tests/visual_tests/test.py
@@ -59,7 +59,7 @@
def render(filename, width, height, bbox, quiet=False):
if not quiet:
- print "Rendering style \"%s\" with size %dx%d ..." % (filename, width, height),
+ print "\"%s\" with size %dx%d ..." % (filename, width, height),
m = mapnik.Map(width, height)
mapnik.load_map(m, os.path.join(dirname, "styles", "%s.xml" % filename), False)
if bbox is not None:
@@ -74,9 +74,9 @@ def render(filename, width, height, bbox, quiet=False):
mapnik.render_to_file(m, actual)
diff = compare(actual, expected)
if diff > 0:
- print '\x1b[31mError:\x1b[0m %u different pixels' % diff
+ print '\x1b[31m✘\x1b[0m (\x1b[34m%u different pixels\x1b[0m)' % diff
else:
- print '\x1b[1;32m✓ \x1b[0m'
+ print '\x1b[32m✓\x1b[0m'
except Exception, e:
sys.stderr.write(e.message + '\n')
fail(actual,expected)

0 comments on commit 8135ac8

Please sign in to comment.
Something went wrong with that request. Please try again.