]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/build/output-distance.py
Add '-dcrop' option to ps and svg backends
[lilypond.git] / scripts / build / output-distance.py
index cf213da8b13d0717e80b14ae38ebc1b9f785832b..625ce12a1e3f1ab70db53797457ddc400e2472a5 100755 (executable)
@@ -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 ())
 
@@ -642,6 +642,7 @@ class SignatureFileLink (FileLink):
                 cmd = ('gs -sDEVICE=png16m -dGraphicsAlphaBits=4 -dTextAlphaBits=4 '
                        ' %(data_option)s '
                        ' -r101 '
+                       ' -dAutoRotatePages=/None '
                        ' -sOutputFile=%(outfile)s -dNOSAFER -dEPSCrop -q -dNOPAUSE '
                        ' %(infile)s  -c quit ') % locals ()
 
@@ -827,7 +828,7 @@ class ComparisonData:
                 re.sub (r'\\sourcefilename "([^"]+)"',
                         note_original, open (sf).read ())
             else:
-                print 'no source for', val
+                print 'no source for', val.file_names[1]
 
     def compare_trees (self, dir1, dir2):
         self.compare_directories (dir1, dir2)
@@ -842,6 +843,10 @@ class ComparisonData:
             sys.exit(1)
 
         for d in dirs:
+            # don't walk the share folders
+            if d.startswith("share"):
+                continue
+
             d1 = os.path.join (dir1, d)
             d2 = os.path.join (dir2, d)
 
@@ -984,9 +989,12 @@ class ComparisonData:
 
         summary += '<p>%d unchanged</p>' % len (unchanged)
 
+        me = sys.argv[0]
+
         html = '''<html>
 <head>
 <title>LilyPond regression test results</title>
+<meta name="author" content="This file was autogenerated by %(me)s">
 <script language="javascript" type="text/javascript">
 // <![CDATA[
     var rows = document.getElementsByTagName("tr");
@@ -1082,6 +1090,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/",