]> git.donarmstrong.com Git - lilypond.git/blobdiff - buildscripts/output-distance.py
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / buildscripts / output-distance.py
index e38abb56f2b1757273f7725461e1bc1bcefee9aa..ea82a93de9c1c7d32d37ca79836725764aa6b16e 100644 (file)
@@ -91,7 +91,7 @@ def compare_png_images (old, new, dest_dir):
 
     system ("convert  -depth 8 %(dir)s/diff.png -blur 0x3 -negate -channel alpha,blue -type TrueColorMatte -fx 'intensity'    %(dir)s/matte.png" % locals ())
 
-    system ("composite -quality 65 %(dir)s/matte.png %(new)s %(dest)s" % locals ())
+    system ("composite -compose atop -quality 65 %(dir)s/matte.png %(new)s %(dest)s" % locals ())
 
 
 ################################################################
@@ -347,7 +347,10 @@ class FileLink:
         
     def text_record_string (self):
         return '%-30f %-20s\n' % (self.distance (),
-                                  self.name ())
+                                  self.name ()
+                                  + os.path.splitext (self.file_names[1])[1]
+                                  )
+    
     def calc_distance (self):
         return 0.0
 
@@ -433,6 +436,7 @@ class FileCompareLink (FileLink):
             return 0.0
         else:
             return 100.0;
+
         
     def get_content (self, f):
         print 'reading', f
@@ -460,6 +464,7 @@ class GitFileCompareLink (FileCompareLink):
             d = 1.0001 *options.threshold
 
         return d
+
         
 class TextFileCompareLink (FileCompareLink):
     def calc_distance (self):
@@ -518,7 +523,7 @@ class ProfileFileLink (FileCompareLink):
 
         dist = 0.0
         factor = {
-            'time': 1.0 ,
+            'time': 0.1,
             'cells': 5.0,
             }
         
@@ -604,12 +609,17 @@ class SignatureFileLink (FileLink):
             for f in glob.glob (pat):
                 infile = f
                 outfile = (dest_dir + '/' + f).replace ('.eps', '.png')
-
+                data_option = ''
+                if options.local_data_dir:
+                    data_option = ('-slilypond-datadir=%s/share/lilypond/current '
+                                   % os.path.split(infile)[0])
+                
                 mkdir (os.path.split (outfile)[0])
                 cmd = ('gs -sDEVICE=png16m -dGraphicsAlphaBits=4 -dTextAlphaBits=4 '
+                       ' %(data_option)s '
                        ' -r101 '
                        ' -sOutputFile=%(outfile)s -dNOSAFER -dEPSCrop -q -dNOPAUSE '
-                       ' %(infile)s  -c quit '  % locals ())
+                       ' %(infile)s  -c quit ') % locals ()
 
                 files_created[oldnew].append (outfile)
                 system (cmd)
@@ -1102,7 +1112,7 @@ def test_basic_compare ():
         
     names = [d['name'] for d in dicts]
 
-    system ('lilypond -ddump-profile -dseparate-log-files -ddump-signatures --png -eps ' + ' '.join (names))
+    system ('lilypond -ddump-profile -dseparate-log-files -ddump-signatures --png -dbackend=eps ' + ' '.join (names))
     
 
     multipage_str = r'''
@@ -1216,6 +1226,13 @@ def main ():
                   action="store_true",
                   help="Create PNGs from EPSes")
 
+
+    p.add_option ('--local-datadir',
+                  dest="local_data_dir",
+                  default=False,
+                  action="store_true",
+                  help='whether to use the share/lilypond/ directory in the test directory')
+
     p.add_option ('-o', '--output-dir',
                   dest="output_dir",
                   default=None,