From 2bca5f7486573ef754e92b397692eff8260def52 Mon Sep 17 00:00:00 2001 From: Christian Hitz Date: Sun, 14 Feb 2010 16:37:55 +0100 Subject: [PATCH] Lilypond-book: Add regression tests for TEX. --- input/regression/lilypond-book/GNUmakefile | 2 +- input/regression/lilypond-book/include2.ly | 3 +++ .../lilypond-book/include_file_latex.lytex | 5 +++++ input/regression/lilypond-book/inline_latex.lytex | 4 ++++ input/regression/lilypond-book/suffix_latex.latex | 7 +++++++ input/regression/lilypond-book/suffix_lytex.lytex | 7 +++++++ input/regression/lilypond-book/suffix_tex.tex | 7 +++++++ input/regression/lilypond-book/version_latex.lytex | 4 ++++ make/lilypond-book-rules.make | 14 +++++++++++++- make/lilypond-book-vars.make | 12 +++++++++++- scripts/build/lys-to-tely.py | 3 ++- 11 files changed, 64 insertions(+), 4 deletions(-) create mode 100644 input/regression/lilypond-book/include2.ly create mode 100644 input/regression/lilypond-book/include_file_latex.lytex create mode 100644 input/regression/lilypond-book/inline_latex.lytex create mode 100644 input/regression/lilypond-book/suffix_latex.latex create mode 100644 input/regression/lilypond-book/suffix_lytex.lytex create mode 100644 input/regression/lilypond-book/suffix_tex.tex create mode 100644 input/regression/lilypond-book/version_latex.lytex diff --git a/input/regression/lilypond-book/GNUmakefile b/input/regression/lilypond-book/GNUmakefile index 0deabe6fc6..1fff6c4e64 100644 --- a/input/regression/lilypond-book/GNUmakefile +++ b/input/regression/lilypond-book/GNUmakefile @@ -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 index 0000000000..b9d4f0ee75 --- /dev/null +++ b/input/regression/lilypond-book/include2.ly @@ -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 index 0000000000..6705a7ff14 --- /dev/null +++ b/input/regression/lilypond-book/include_file_latex.lytex @@ -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 index 0000000000..0d4886a5b0 --- /dev/null +++ b/input/regression/lilypond-book/inline_latex.lytex @@ -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 index 0000000000..16b60d2fea --- /dev/null +++ b/input/regression/lilypond-book/suffix_latex.latex @@ -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 index 0000000000..cb54e9e00a --- /dev/null +++ b/input/regression/lilypond-book/suffix_lytex.lytex @@ -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 index 0000000000..87d36d0a05 --- /dev/null +++ b/input/regression/lilypond-book/suffix_tex.tex @@ -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 index 0000000000..9509cc8a31 --- /dev/null +++ b/input/regression/lilypond-book/version_latex.lytex @@ -0,0 +1,4 @@ +\documentclass{article} +\begin{document} +Lilypond version: \lilypondversion +\end{document} diff --git a/make/lilypond-book-rules.make b/make/lilypond-book-rules.make index 5304cbeb7a..5b8e08b915 100644 --- a/make/lilypond-book-rules.make +++ b/make/lilypond-book-rules.make @@ -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 $<) diff --git a/make/lilypond-book-vars.make b/make/lilypond-book-vars.make index 12e7581019..0b7dd247fd 100644 --- a/make/lilypond-book-vars.make +++ b/make/lilypond-book-vars.make @@ -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) diff --git a/scripts/build/lys-to-tely.py b/scripts/build/lys-to-tely.py index f0de9cd66b..6f6ad475e4 100644 --- a/scripts/build/lys-to-tely.py +++ b/scripts/build/lys-to-tely.py @@ -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 -- 2.39.2