]> git.donarmstrong.com Git - lilypond.git/commitdiff
Lilypond-book: Add regression tests for TEX.
authorChristian Hitz <christian@klarinett.li>
Sun, 14 Feb 2010 15:37:55 +0000 (16:37 +0100)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Sat, 3 Jul 2010 11:26:51 +0000 (13:26 +0200)
input/regression/lilypond-book/GNUmakefile
input/regression/lilypond-book/include2.ly [new file with mode: 0644]
input/regression/lilypond-book/include_file_latex.lytex [new file with mode: 0644]
input/regression/lilypond-book/inline_latex.lytex [new file with mode: 0644]
input/regression/lilypond-book/suffix_latex.latex [new file with mode: 0644]
input/regression/lilypond-book/suffix_lytex.lytex [new file with mode: 0644]
input/regression/lilypond-book/suffix_tex.tex [new file with mode: 0644]
input/regression/lilypond-book/version_latex.lytex [new file with mode: 0644]
make/lilypond-book-rules.make
make/lilypond-book-vars.make
scripts/build/lys-to-tely.py

index 0deabe6fc6f8314a14482994a88312baa4c44d3e..1fff6c4e647984088a6f7f4f9bfa1dddf48dcbe2 100644 (file)
@@ -1,6 +1,6 @@
 depth = ../../..
 
-STEPMAKE_TEMPLATES=documentation texinfo tex
+STEPMAKE_TEMPLATES=documentation texinfo
 LOCALSTEPMAKE_TEMPLATES=lilypond ly lysdoc lilypond-book
 
 ifndef LILYBOOK_OUT_FILES
diff --git a/input/regression/lilypond-book/include2.ly b/input/regression/lilypond-book/include2.ly
new file mode 100644 (file)
index 0000000..b9d4f0e
--- /dev/null
@@ -0,0 +1,3 @@
+\score {
+       \relative c'' { \key c \minor d4 es g2 }
+}
diff --git a/input/regression/lilypond-book/include_file_latex.lytex b/input/regression/lilypond-book/include_file_latex.lytex
new file mode 100644 (file)
index 0000000..6705a7f
--- /dev/null
@@ -0,0 +1,5 @@
+\documentclass{article}
+\begin{document}
+Including Lilypond file:
+\lilypondfile{include2.ly}
+\end{document}
diff --git a/input/regression/lilypond-book/inline_latex.lytex b/input/regression/lilypond-book/inline_latex.lytex
new file mode 100644 (file)
index 0000000..0d4886a
--- /dev/null
@@ -0,0 +1,4 @@
+\documentclass{article}
+\begin{document}
+Adding Lilypond code inline: \lilypond[relative=2]{ d g ceses }
+\end{document}
diff --git a/input/regression/lilypond-book/suffix_latex.latex b/input/regression/lilypond-book/suffix_latex.latex
new file mode 100644 (file)
index 0000000..16b60d2
--- /dev/null
@@ -0,0 +1,7 @@
+\documentclass{article}
+\begin{document}
+Lilypond included in a \LaTeX document.
+\begin[fragment,relative=2]{lilypond}
+\key c \minor c4 e d2
+\end{lilypond}
+\end{document}
diff --git a/input/regression/lilypond-book/suffix_lytex.lytex b/input/regression/lilypond-book/suffix_lytex.lytex
new file mode 100644 (file)
index 0000000..cb54e9e
--- /dev/null
@@ -0,0 +1,7 @@
+\documentclass{article}
+\begin{document}
+Lilypond included in a \LaTeX document.
+\begin[fragment,relative=2]{lilypond}
+\key c \minor c4 es d2
+\end{lilypond}
+\end{document}
diff --git a/input/regression/lilypond-book/suffix_tex.tex b/input/regression/lilypond-book/suffix_tex.tex
new file mode 100644 (file)
index 0000000..87d36d0
--- /dev/null
@@ -0,0 +1,7 @@
+\documentclass{article}
+\begin{document}
+Lilypond included in a \LaTeX document.
+\begin{lilypond}[fragment,relative=2]
+\key c \minor c4 dis d2
+\end{lilypond}
+\end{document}
diff --git a/input/regression/lilypond-book/version_latex.lytex b/input/regression/lilypond-book/version_latex.lytex
new file mode 100644 (file)
index 0000000..9509cc8
--- /dev/null
@@ -0,0 +1,4 @@
+\documentclass{article}
+\begin{document}
+Lilypond version: \lilypondversion
+\end{document}
index 5304cbeb7a6d98347234c371da7d2e65f225469b..5b8e08b915261af73ec2943f87fb2b01723b7df0 100644 (file)
@@ -1,7 +1,19 @@
-.SUFFIXES: .html .xml
+.SUFFIXES: .html .xml .lytex .tex .latex
 
 $(outdir)/%.html:  %.html
        ../../../out/bin/lilypond-book -o $(outdir) $<
 
 $(outdir)/%.html:  %.xml
        ../../../out/bin/lilypond-book -o $(outdir) $<
+
+$(outdir)/%.tex:  %.lytex
+       ../../../out/bin/lilypond-book --pdf -o $(outdir) $<
+
+$(outdir)/%.tex:  %.tex
+       ../../../out/bin/lilypond-book --pdf -o $(outdir) $<
+
+$(outdir)/%.tex:  %.latex
+       ../../../out/bin/lilypond-book --pdf -o $(outdir) $<
+
+$(outdir)/%.pdf:  $(outdir)/%.tex
+       cd $(outdir) && pdflatex $(notdir $<)
index 12e7581019599d8ae2f078625871e9da15884601..0b7dd247fdd3e0076ab88bef3b38aeff11c164af 100644 (file)
@@ -2,10 +2,20 @@
 
 LILYBOOK_HTML_FILES = $(call src-wildcard,*.html)
 LILYBOOK_XML_FILES = $(call src-wildcard,*.xml)
+LILYBOOK_LYTEX_FILES = $(call src-wildcard,*.lytex)
+LILYBOOK_LATEX_FILES = $(call src-wildcard,*.latex)
+LILYBOOK_TEX_FILES = $(call src-wildcard,*.tex)
 
 LILYBOOK_OUT_HTML_FILES = ${LILYBOOK_HTML_FILES:%.html=$(outdir)/%.html}
 LILYBOOK_OUT_XML_FILES = ${LILYBOOK_XML_FILES:%.xml=$(outdir)/%.html}
+LILYBOOK_OUT_LYTEX_FILES = ${LILYBOOK_LYTEX_FILES:%.lytex=$(outdir)/%.pdf}
+LILYBOOK_OUT_LATEX_FILES = ${LILYBOOK_LATEX_FILES:%.latex=$(outdir)/%.pdf}
+LILYBOOK_OUT_TEX_FILES = ${LILYBOOK_TEX_FILES:%.tex=$(outdir)/%.pdf}
 
-LILYBOOK_OUT_FILES = $(sort $(LILYBOOK_OUT_HTML_FILES) $(LILYBOOK_OUT_XML_FILES))
+LILYBOOK_OUT_FILES = $(sort $(LILYBOOK_OUT_HTML_FILES) \
+                            $(LILYBOOK_OUT_XML_FILES) \
+                            $(LILYBOOK_OUT_LYTEX_FILES) \
+                            $(LILYBOOK_OUT_LATEX_FILES) \
+                            $(LILYBOOK_OUT_TEX_FILES))
 
 EXTRA_DIST_FILES += $(LILYBOOK_HTML_FILES)
index f0de9cd66b0b320e1614254bc3c1ddad594ca691..6f6ad475e47e3355188ea85c6e66fe5b1cb258de 100644 (file)
@@ -92,12 +92,13 @@ for opt in options:
 
 texi_file_re = re.compile ('.*\.i?te(ly|xi)$')
 html_file_re = re.compile ('.*\.i?htm(l)?$')
+pdf_file_re = re.compile ('.*\.i?pdf$')
 
 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):
+    elif html_file_re.match (n) or pdf_file_re.match (n):
         s = r"""
 @ifhtml
 @html