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 ())
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)
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)
self.compare_general_files (klasses[ext], f1, f2)
def compare_general_files (self, klass, f1, f2):
+ prefix = os.path.commonprefix ([f1, f2])
name = os.path.split (f1)[1]
+ name = os.path.join (prefix, name)
file_link = klass (f1, f2)
self.file_links[name] = file_link
def compare_signature_files (self, f1, f2):
+ prefix = os.path.commonprefix ([f1, f2])
name = os.path.split (f1)[1]
name = re.sub ('-[0-9]+.signature', '', name)
+ name = os.path.join (prefix, name)
file_link = None
try:
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");
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/",