]> git.donarmstrong.com Git - lilypond.git/commitdiff
Add a --skip-png-check option.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 25 Mar 2008 03:37:03 +0000 (00:37 -0300)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 25 Mar 2008 03:37:03 +0000 (00:37 -0300)
This fixes test generation, which generates PNGs only for changed
files.

make/lilypond-vars.make
scripts/lilypond-book.py

index 6932c718f7164d72fa43e2c583658cc94fe131c5..5cbd5537cbe6df52998f95d5ca452ad711197d83 100644 (file)
@@ -37,10 +37,13 @@ LILYPOND_BOOK_FLAGS = $(LILYPOND_BOOK_VERBOSE) $(LILYPOND_BOOK_INFO_IMAGES_DIR)
 
 ifeq ($(out),)
 LILYPOND_BOOK_PROCESS = true
-LILYPOND_BOOK_FLAGS = --no-lily-run
+LILYPOND_BOOK_FLAGS += --no-lily-run
 else
 LILYPOND_BOOK_PROCESS = $(LILYPOND_BINARY)
 endif
+ifeq ($(out),test)
+LILYPOND_BOOK_FLAGS += --skip-png-check
+endif
 
 TEXINPUTS=$(top-src-dir)/tex/::
 export TEXINPUTS
index f2052910f3b249f9e18bdad2bb74f51ca540e10a..553bbed1ffe433c712cee93ffbccf80f249127ee 100644 (file)
@@ -146,11 +146,17 @@ def get_option_parser ():
                   action='store', dest='output_dir',
                   default='')
     
-    p.add_option ('--no-lily-run',
+    p.add_option ('--skip-lily-check',
                   help=_ ("do not fail if no lilypond output is found."),
                   metavar=_ ("DIR"),
                   action='store_true', dest='skip_lilypond_run',
                   default=False)
+
+    p.add_option ('--skip-png-check',
+                  help=_ ("do not fail if no PNG images are found for EPS files"),
+                  metavar=_ ("DIR"),
+                  action='store_true', dest='skip_png_check',
+                  default=False)
     
     p.add_option ('--lily-output-dir',
                   help=_ ("write lily-XXX files to DIR, link into --output dir."),
@@ -1156,6 +1162,7 @@ class LilypondSnippet (Snippet):
             else:
                 missing.add (name)
 
+        # UGH - junk global_options
         skip_lily = global_options.skip_lilypond_run
         for required in [base + '.ly',
                          base + '.txt']:
@@ -1170,7 +1177,9 @@ class LilypondSnippet (Snippet):
                              base + '-systems.tex',
                              base + '-systems.pdftexi'])
 
-        if base + '.eps' in result and self.format in (HTML, TEXINFO):
+        # UGH - junk global_options
+        if (base + '.eps' in result and self.format in (HTML, TEXINFO)
+            and not global_options.skip_png_check):
             page_count = ps_page_count (full + '.eps')
             if page_count <= 1:
                 require_file (base + '.png')
@@ -1179,7 +1188,7 @@ class LilypondSnippet (Snippet):
                     require_file (base + '-page%d.png' % page)
 
         system_count = 0
-        if not skip_lily:
+        if not skip_lily and not missing:
             system_count = int(file (full + '-systems.count').read())
         for number in range(1, system_count + 1):
             systemfile = '%s-%d' % (base, number)