]> git.donarmstrong.com Git - lilypond.git/commitdiff
Lilypond-book: Add a regression test system
authorChristian Hitz <christian@klarinett.li>
Sun, 14 Feb 2010 14:08:24 +0000 (15:08 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Sat, 3 Jul 2010 11:26:51 +0000 (13:26 +0200)
Test the operation of lilypond-book.

GNUmakefile.in
input/regression/GNUmakefile
input/regression/lilypond-book/GNUmakefile [new file with mode: 0644]
input/regression/lilypond-book/suffix_html.html [new file with mode: 0644]
input/regression/lilypond-book/suffix_xml.xml [new file with mode: 0644]
make/lilypond-book-rules.make [new file with mode: 0644]
make/lilypond-book-targets.make [new file with mode: 0644]
make/lilypond-book-vars.make [new file with mode: 0644]
scripts/build/lys-to-tely.py

index 04ce4e6e726215fce75d53f56416475fb34ced8e..be6377078a850ea33b6c38d2201528c058140364 100644 (file)
@@ -256,6 +256,7 @@ test:
        $(MAKE) -C input/regression/ out=test local-test
        $(MAKE) -C input/regression/musicxml out=test local-test
        $(MAKE) -C input/regression/abc2ly out=test local-test
+       $(MAKE) -C input/regression/lilypond-book out=test local-test
 
 test-baseline:
        @if test -d .git ; then \
@@ -266,6 +267,7 @@ test-baseline:
        $(MAKE) out=test -C input/regression/ local-test-baseline
        $(MAKE) out=test -C input/regression/musicxml local-test-baseline
        $(MAKE) out=test -C input/regression/abc2ly local-test-baseline
+       $(MAKE) out=test -C input/regression/lilypond-book local-test-baseline
        $(MAKE) test-snippets-clean
 
 
index 605f138e9983dbe7ba2acfb16964edcc45e0b454..e0c023d667ed73a504f3a2421b092862c205f6c6 100644 (file)
@@ -6,4 +6,4 @@ LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc
 include $(depth)/make/stepmake.make
 TITLE=LilyPond Regression Tests
 
-SUBDIRS=musicxml abc2ly
+SUBDIRS=musicxml abc2ly lilypond-book
diff --git a/input/regression/lilypond-book/GNUmakefile b/input/regression/lilypond-book/GNUmakefile
new file mode 100644 (file)
index 0000000..0deabe6
--- /dev/null
@@ -0,0 +1,14 @@
+depth = ../../..
+
+STEPMAKE_TEMPLATES=documentation texinfo tex
+LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc lilypond-book
+
+ifndef LILYBOOK_OUT_FILES
+LILYBOOK_OUT_FILES = ""
+endif
+
+COLLATED_FILES = $(LILYBOOK_OUT_FILES)
+
+include $(depth)/make/stepmake.make
+
+TITLE=lilypond-book Test Suite
diff --git a/input/regression/lilypond-book/suffix_html.html b/input/regression/lilypond-book/suffix_html.html
new file mode 100644 (file)
index 0000000..d03dadb
--- /dev/null
@@ -0,0 +1,8 @@
+<html>
+<body>
+Lilypond fragment in a HTML file.
+<lilypond fragment relative=2>
+\key c \minor c4 es g2
+</lilypond>
+</body>
+</html>
diff --git a/input/regression/lilypond-book/suffix_xml.xml b/input/regression/lilypond-book/suffix_xml.xml
new file mode 100644 (file)
index 0000000..d04ce54
--- /dev/null
@@ -0,0 +1,8 @@
+<html>
+<body>
+Testing lilypond-book HTML mode with .xml file suffix.
+<lilypond fragment relative=2>
+\key c \minor c4 es g2
+</lilypond>
+</body>
+</html>
diff --git a/make/lilypond-book-rules.make b/make/lilypond-book-rules.make
new file mode 100644 (file)
index 0000000..5304cbe
--- /dev/null
@@ -0,0 +1,7 @@
+.SUFFIXES: .html .xml
+
+$(outdir)/%.html:  %.html
+       ../../../out/bin/lilypond-book -o $(outdir) $<
+
+$(outdir)/%.html:  %.xml
+       ../../../out/bin/lilypond-book -o $(outdir) $<
diff --git a/make/lilypond-book-targets.make b/make/lilypond-book-targets.make
new file mode 100644 (file)
index 0000000..0f63330
--- /dev/null
@@ -0,0 +1 @@
+default:
diff --git a/make/lilypond-book-vars.make b/make/lilypond-book-vars.make
new file mode 100644 (file)
index 0000000..12e7581
--- /dev/null
@@ -0,0 +1,11 @@
+# rules for directories with html files.
+
+LILYBOOK_HTML_FILES = $(call src-wildcard,*.html)
+LILYBOOK_XML_FILES = $(call src-wildcard,*.xml)
+
+LILYBOOK_OUT_HTML_FILES = ${LILYBOOK_HTML_FILES:%.html=$(outdir)/%.html}
+LILYBOOK_OUT_XML_FILES = ${LILYBOOK_XML_FILES:%.xml=$(outdir)/%.html}
+
+LILYBOOK_OUT_FILES = $(sort $(LILYBOOK_OUT_HTML_FILES) $(LILYBOOK_OUT_XML_FILES))
+
+EXTRA_DIST_FILES += $(LILYBOOK_HTML_FILES)
index d503786e3e13169597c682139973a70bb88a8c91..f0de9cd66b0b320e1614254bc3c1ddad594ca691 100644 (file)
@@ -91,11 +91,22 @@ for opt in options:
         raise Exception ('unknown option: ' + o)
 
 texi_file_re = re.compile ('.*\.i?te(ly|xi)$')
+html_file_re = re.compile ('.*\.i?htm(l)?$')
 
 def name2line (n):
     if texi_file_re.match (n):
         # We have a texi include file, simply include it:
         s = r"@include %s" % os.path.basename (n)
+    if html_file_re.match (n):
+        s = r"""
+@ifhtml
+@html
+<a href="%s">%s</a>
+<br/>
+@end html
+@end ifhtml
+""" % (os.path.basename (n), os.path.basename (n))
+        return s
     else:
         # Assume it's a lilypond file -> create image etc.
         s = r"""