Reviewers: ,
Description:
https://sourceforge.net/p/testlilyissues/issues/5576/
Please review this at https://codereview.appspot.com/563120043/
Affected files (+46, -22 lines):
M GNUmakefile.in
M scripts/build/output-distance.py
Index: GNUmakefile.in
diff --git a/GNUmakefile.in b/GNUmakefile.in
index
3dbd8f30bcee338e6a46e6fa43a4fe50b981a4b9..7c21e3cf24c8af0c4103a3519625672d35b248ff
100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -343,11 +343,10 @@ test-baseline:
$(MAKE) out=test -C input/regression/lilypond-book local-test-baseline
$(MAKE) test-snippets-clean
-
local-check: test
rm -rf $(RESULT_DIR)
mkdir -p $(RESULT_DIR)
- $(buildscript-dir)/output-distance --local-datadir --create-images
--output-dir $(RESULT_DIR) \
+ $(buildscript-dir)/output-distance $(if $(VERBOSE),-v) --local-datadir
--create-images --output-dir $(RESULT_DIR) \
input/regression/out-test-baseline input/regression/out-test \
input/regression/midi/out-test-baseline
input/regression/midi/out-test
@find input ly -name '*.ly' -print |grep -v 'out.*/' | xargs
grep '\\version' -L | grep -v "standard input" |sed 's/^/ Missing
version: /g'
Index: scripts/build/output-distance.py
diff --git a/scripts/build/output-distance.py
b/scripts/build/output-distance.py
index
6e2571c88fe2d5992e50b534097733a6bb8d33fb..04a51c3ea5f775d1a57112c28aae7073ab2c4ae5
100755
--- a/scripts/build/output-distance.py
+++ b/scripts/build/output-distance.py
@@ -21,6 +21,14 @@ OUTPUT_EXPRESSION_PENALTY = 1
ORPHAN_GROB_PENALTY = 1
options = None
+def log_terse (s):
+if not options.verbose:
+print s
+
+def log_verbose (s):
+if options.verbose:
+print s
+
# system interface.
temp_dir = None
@@ -28,9 +36,9 @@ class TempDirectory:
def __init__ (self):
import tempfile
self.dir = tempfile.mkdtemp ()
-print 'dir is', self.dir
+log_verbose ('dir is %s' % self.dir)
def __del__ (self):
-print 'rm -rf %s' % self.dir
+log_verbose ('rm -rf %s' % self.dir)
os.system ('rm -rf %s' % self.dir)
def __call__ (self):
return self.dir
@@ -43,11 +51,11 @@ def get_temp_dir ():
return temp_dir ()
def read_pipe (c):
-print 'pipe' , c
+log_verbose ('pipe %s' % c)
return os.popen (c).read ()
def system (c):
-print 'system' , c
+log_verbose ('system %s' % c)
s = os.system (c)
if s :
raise Exception ("failed")
@@ -321,7 +329,7 @@ def scheme_float (s) :
return float(s.split('.')[0])
def read_signature_file (name):
-print 'reading', name
+log_verbose ('reading %s' % name)
entries = open (name).read ().split ('\n')
def string_to_tup (s):
@@ -451,7 +459,7 @@ class FileCompareLink (FileLink):
return 100.0;
def get_content (self, f):
-print 'reading', f
+log_verbose ('reading %s' % f)
s = open (f).read ()
return s
@@ -647,7 +655,7 @@ class SignatureFileLink (FileLink):
abs_dir = os.path.abspath (dir)
cur_dir = os.getcwd ()
-print 'entering directory', abs_dir
+log_verbose ('entering directory %s' % abs_dir)
os.chdir (dir)
for f in glob.glob (base):
@@ -674,9 +682,10 @@ class SignatureFileLink (FileLink):
' -c quit') % locals ()
files_created[oldnew].append (outfile)
+log_terse ('writing %s' % outfile)
system (cmd)
-print 'leaving directory', abs_dir
+log_verbose ('leaving directory %s' % abs_dir)
os.chdir (cur_dir)
return files_created
@@ -887,6 +896,9 @@ class ComparisonData:
self.compare_trees (d1, d2)
def compare_directories (self, dir1, dir2):
+log_terse ('comparing %s' % dir1)
+log_terse (' to %s' % dir2)
+
for ext in ['signature',
'midi',
'log',
@@ -897,6 +909,9 @@ class ComparisonData:
self.missing += [(dir1, m) for m in m1]
self.added += [(dir2, m) for m in m2]
+log_terse ('%6d %s file%s' % (len(paired), ext,
+ 's' if len(paired) != 1 else ''))
+
# we sort the file names for easier debugging
for p in sorted (paired):
if (options.max_count
@@ -971,21 +986,26 @@ class ComparisonData:
def write_text_result_page (self, filename, threshold):
out = None
+verbose = True
if filename == '':
out = sys.stdout
+verbose = options.verbose
else:
-print 'writing "%s"' % filename
+print 'writing %s' % filename
out = open_write_file (filename)
(changed, below, unchanged) = self.threshold