diff options
author | David Kastrup <dak@gnu.org> | 2015-05-02 00:35:35 +0200 |
---|---|---|
committer | David Kastrup <dak@gnu.org> | 2015-05-02 02:40:40 +0200 |
commit | 2545fab01a601743bb3ecc18942cf14263ccfc6c (patch) | |
tree | 33a444e8b9387430ef831c051aee47d9abdb99ae /scripts | |
parent | 05b7a5eba84b099922e306515efc7a269d69532d (diff) |
Issue 4364: Allow ImageMagick's compare to exit with status 1
Apparently Ubuntu 15.04 has a version of "compare" that cannot be easily
persuaded to return anything but exit status 1 (which indicates
dissimilar images but no actual error condition) so we allow this in
script/build/output-distance.py in order to keep "make check" from
failing.
This patch is somewhat artless but does the trick.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/output-distance.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/build/output-distance.py b/scripts/build/output-distance.py index 569c892a8f..49a659b73f 100755 --- a/scripts/build/output-distance.py +++ b/scripts/build/output-distance.py @@ -89,7 +89,7 @@ def compare_png_images (old, new, dest_dir): system ('convert -depth 8 -crop %dx%d+0+0 %s %s/crop1.png' % (dims + (old, dir))) system ('convert -depth 8 -crop %dx%d+0+0 %s %s/crop2.png' % (dims + (new, dir))) - system ('compare -depth 8 -dissimilarity-threshold 1 %(dir)s/crop1.png %(dir)s/crop2.png %(dir)s/diff.png' % locals ()) + system1 ('compare -depth 8 -dissimilarity-threshold 1 %(dir)s/crop1.png %(dir)s/crop2.png %(dir)s/diff.png' % locals ()) system ("convert -depth 8 %(dir)s/diff.png -blur 0x3 -negate -channel alpha,blue -type TrueColorMatte -fx 'intensity' %(dir)s/matte.png" % locals ()) @@ -1089,6 +1089,12 @@ def system (x): stat = os.system (x) assert stat == 0 +def system1 (x): +# Allow exit status 0 and 1 + print 'invoking', x + stat = os.system (x) + assert (stat == 0) or (stat == 256) # This return value convention is sick. + def test_paired_files (): print paired_files (os.environ["HOME"] + "/src/lilypond/scripts/", |