From 89a7d16d7c2ae6dc79d4345c5e926be93b77fdd9 Mon Sep 17 00:00:00 2001 From: Christian Hitz Date: Sun, 14 Feb 2010 15:08:24 +0100 Subject: [PATCH] Lilypond-book: Add a regression test system Test the operation of lilypond-book. --- GNUmakefile.in | 2 ++ input/regression/GNUmakefile | 2 +- input/regression/lilypond-book/GNUmakefile | 14 ++++++++++++++ input/regression/lilypond-book/suffix_html.html | 8 ++++++++ input/regression/lilypond-book/suffix_xml.xml | 8 ++++++++ make/lilypond-book-rules.make | 7 +++++++ make/lilypond-book-targets.make | 1 + make/lilypond-book-vars.make | 11 +++++++++++ scripts/build/lys-to-tely.py | 11 +++++++++++ 9 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 input/regression/lilypond-book/GNUmakefile create mode 100644 input/regression/lilypond-book/suffix_html.html create mode 100644 input/regression/lilypond-book/suffix_xml.xml create mode 100644 make/lilypond-book-rules.make create mode 100644 make/lilypond-book-targets.make create mode 100644 make/lilypond-book-vars.make diff --git a/GNUmakefile.in b/GNUmakefile.in index 04ce4e6e72..be6377078a 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -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 diff --git a/input/regression/GNUmakefile b/input/regression/GNUmakefile index 605f138e99..e0c023d667 100644 --- a/input/regression/GNUmakefile +++ b/input/regression/GNUmakefile @@ -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 index 0000000000..0deabe6fc6 --- /dev/null +++ b/input/regression/lilypond-book/GNUmakefile @@ -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 index 0000000000..d03dadb4db --- /dev/null +++ b/input/regression/lilypond-book/suffix_html.html @@ -0,0 +1,8 @@ + + +Lilypond fragment in a HTML file. + +\key c \minor c4 es g2 + + + diff --git a/input/regression/lilypond-book/suffix_xml.xml b/input/regression/lilypond-book/suffix_xml.xml new file mode 100644 index 0000000000..d04ce54e3f --- /dev/null +++ b/input/regression/lilypond-book/suffix_xml.xml @@ -0,0 +1,8 @@ + + +Testing lilypond-book HTML mode with .xml file suffix. + +\key c \minor c4 es g2 + + + diff --git a/make/lilypond-book-rules.make b/make/lilypond-book-rules.make new file mode 100644 index 0000000000..5304cbeb7a --- /dev/null +++ b/make/lilypond-book-rules.make @@ -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 index 0000000000..0f63330a21 --- /dev/null +++ b/make/lilypond-book-targets.make @@ -0,0 +1 @@ +default: diff --git a/make/lilypond-book-vars.make b/make/lilypond-book-vars.make new file mode 100644 index 0000000000..12e7581019 --- /dev/null +++ b/make/lilypond-book-vars.make @@ -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) diff --git a/scripts/build/lys-to-tely.py b/scripts/build/lys-to-tely.py index d503786e3e..f0de9cd66b 100644 --- a/scripts/build/lys-to-tely.py +++ b/scripts/build/lys-to-tely.py @@ -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 +%s +
+@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""" -- 2.39.5