From 3b6bead9c29ae2937e4a5e34cb637f75283a6c35 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Wed, 28 Oct 2015 00:15:42 +0100 Subject: [PATCH 01/24] Inserting a non-breaking space into an artist name prevents the pdf compilation --- test/test_compilation/subdir.tex.control | 2 +- test/test_compilation/subdir_datadir/songs/datadir2.sgc | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_compilation/subdir.tex.control b/test/test_compilation/subdir.tex.control index bd9ac649..1cf2302f 100644 --- a/test/test_compilation/subdir.tex.control +++ b/test/test_compilation/subdir.tex.control @@ -130,7 +130,7 @@ Chordpro}[ \beginsong{Image included from a different datadir\\ Chordpro}[ by={ - }, + Le Donjon de Naheulbeuk }, cov={img/datadir2.png}, ] diff --git a/test/test_compilation/subdir_datadir/songs/datadir2.sgc b/test/test_compilation/subdir_datadir/songs/datadir2.sgc index ff941a56..614d5fbe 100644 --- a/test/test_compilation/subdir_datadir/songs/datadir2.sgc +++ b/test/test_compilation/subdir_datadir/songs/datadir2.sgc @@ -1,5 +1,6 @@ {title : Image included from a different datadir} {subtitle: Chordpro} +{by: Le Donjon de Naheulbeuk} {cover: datadir2.png} {lang: en} From 11724e22df1271a3302215ebceada65101514703 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Wed, 28 Oct 2015 00:17:56 +0100 Subject: [PATCH 02/24] Let LaTeX manage non-breaking space caracter --- patacrep/data/templates/songs.tex | 1 + test/test_compilation/subdir.tex.control | 1 + 2 files changed, 2 insertions(+) diff --git a/patacrep/data/templates/songs.tex b/patacrep/data/templates/songs.tex index e3562897..0a6b3331 100644 --- a/patacrep/data/templates/songs.tex +++ b/patacrep/data/templates/songs.tex @@ -102,6 +102,7 @@ \newcommand{\href}[2]{\expandafter\url\expandafter{#1}} } \makeatother +\DeclareUnicodeCharacter{00A0}{~} (* endblock *) (* block songs *) diff --git a/test/test_compilation/subdir.tex.control b/test/test_compilation/subdir.tex.control index 1cf2302f..81bc22ba 100644 --- a/test/test_compilation/subdir.tex.control +++ b/test/test_compilation/subdir.tex.control @@ -55,6 +55,7 @@ guitar, \newcommand{\href}[2]{\expandafter\url\expandafter{#1}} } \makeatother +\DeclareUnicodeCharacter{00A0}{~} \usepackage{chords} From c2a80c7d56ea694d88110f4ae3c6508a01adea00 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Wed, 28 Oct 2015 00:25:09 +0100 Subject: [PATCH 03/24] Prevent unfortunate splitting of the author in the index --- patacrep/index.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/patacrep/index.py b/patacrep/index.py index b67897f3..c0727519 100644 --- a/patacrep/index.py +++ b/patacrep/index.py @@ -135,6 +135,9 @@ class Index(object): self._raw_add((key, ""), number, link) if self.indextype == "AUTHOR": + + # \IeC {} is included by LaTeX and must not be split (because of the space) + key = key.replace('\\IeC {', '\\IeC{') # Processing authors for author in authors.processauthors( key, From 874b1f97095a0793e3894a0a4ef54a3f2a2235ac Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Wed, 28 Oct 2015 11:17:22 +0100 Subject: [PATCH 04/24] Add a comment to indicate that we are testing non-breaking-space char --- test/test_compilation/subdir_datadir/songs/datadir2.sgc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_compilation/subdir_datadir/songs/datadir2.sgc b/test/test_compilation/subdir_datadir/songs/datadir2.sgc index 614d5fbe..3485dd4b 100644 --- a/test/test_compilation/subdir_datadir/songs/datadir2.sgc +++ b/test/test_compilation/subdir_datadir/songs/datadir2.sgc @@ -1,6 +1,6 @@ {title : Image included from a different datadir} {subtitle: Chordpro} -{by: Le Donjon de Naheulbeuk} +{by: Le Donjon de Naheulbeuk} #Test non-breaking-space characters {cover: datadir2.png} {lang: en} From e58ae6a7203576ff7c6e442a222bb047dae2bd9a Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Wed, 28 Oct 2015 11:24:52 +0100 Subject: [PATCH 05/24] Use an eloquent song artist to explain what is under test --- test/test_compilation/subdir.tex.control | 2 +- test/test_compilation/subdir_datadir/songs/datadir2.sgc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_compilation/subdir.tex.control b/test/test_compilation/subdir.tex.control index 81bc22ba..30dbb161 100644 --- a/test/test_compilation/subdir.tex.control +++ b/test/test_compilation/subdir.tex.control @@ -131,7 +131,7 @@ Chordpro}[ \beginsong{Image included from a different datadir\\ Chordpro}[ by={ - Le Donjon de Naheulbeuk }, + Author with non breaking space chars }, cov={img/datadir2.png}, ] diff --git a/test/test_compilation/subdir_datadir/songs/datadir2.sgc b/test/test_compilation/subdir_datadir/songs/datadir2.sgc index 3485dd4b..9bedf7cf 100644 --- a/test/test_compilation/subdir_datadir/songs/datadir2.sgc +++ b/test/test_compilation/subdir_datadir/songs/datadir2.sgc @@ -1,6 +1,6 @@ {title : Image included from a different datadir} {subtitle: Chordpro} -{by: Le Donjon de Naheulbeuk} #Test non-breaking-space characters +{by: Author with non breaking space chars} {cover: datadir2.png} {lang: en} From d18710ab814b8a831168ccd90774f73d50754c03 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 28 Oct 2015 21:22:55 +0100 Subject: [PATCH 06/24] [test] Moved non breakable space tests into their own test --- test/test_compilation/subdir.tex.control | 2 +- .../subdir_datadir/songs/datadir2.sgc | 1 - test/test_compilation/unicode.sb | 4 + test/test_compilation/unicode.tex.control | 117 ++++++++++++++++++ .../unicode_datadir/songs/nonbreak.sgc | 5 + 5 files changed, 127 insertions(+), 2 deletions(-) create mode 100644 test/test_compilation/unicode.sb create mode 100644 test/test_compilation/unicode.tex.control create mode 100644 test/test_compilation/unicode_datadir/songs/nonbreak.sgc diff --git a/test/test_compilation/subdir.tex.control b/test/test_compilation/subdir.tex.control index 30dbb161..6ed84e9a 100644 --- a/test/test_compilation/subdir.tex.control +++ b/test/test_compilation/subdir.tex.control @@ -131,7 +131,7 @@ Chordpro}[ \beginsong{Image included from a different datadir\\ Chordpro}[ by={ - Author with non breaking space chars }, + }, cov={img/datadir2.png}, ] diff --git a/test/test_compilation/subdir_datadir/songs/datadir2.sgc b/test/test_compilation/subdir_datadir/songs/datadir2.sgc index 9bedf7cf..ff941a56 100644 --- a/test/test_compilation/subdir_datadir/songs/datadir2.sgc +++ b/test/test_compilation/subdir_datadir/songs/datadir2.sgc @@ -1,6 +1,5 @@ {title : Image included from a different datadir} {subtitle: Chordpro} -{by: Author with non breaking space chars} {cover: datadir2.png} {lang: en} diff --git a/test/test_compilation/unicode.sb b/test/test_compilation/unicode.sb new file mode 100644 index 00000000..fffed7cc --- /dev/null +++ b/test/test_compilation/unicode.sb @@ -0,0 +1,4 @@ +{ +"datadir": ["unicode_datadir"], +"lang": "en" +} diff --git a/test/test_compilation/unicode.tex.control b/test/test_compilation/unicode.tex.control new file mode 100644 index 00000000..cd402cdb --- /dev/null +++ b/test/test_compilation/unicode.tex.control @@ -0,0 +1,117 @@ + + + + + + +%% Automatically generated document. +%% You may edit this file but all changes will be overwritten. +%% If you want to change this document, have a look at +%% the templating system. +%% +%% Generated using Songbook + +\makeatletter +\def\input@path{ % + {/home/louis/projets/patacrep/patacrep/test/test_compilation/unicode_datadir/latex/} % + {/home/louis/projets/patacrep/patacrep/test/test_compilation/latex/} % + {/home/louis/projets/patacrep/patacrep/patacrep/data/latex/} % +} +\makeatother + +\documentclass[ + ]{article} + +\usepackage[ + chorded, +diagram, +pictures, +guitar, + ]{patacrep} + +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{lmodern} + + +\PassOptionsToPackage{english}{babel} +\usepackage[english]{babel} +\lang{english} + +\usepackage{graphicx} +\graphicspath{ % + {/home/louis/projets/patacrep/patacrep/test/test_compilation/unicode_datadir/} % + {/home/louis/projets/patacrep/patacrep/test/test_compilation/} % + {/home/louis/projets/patacrep/patacrep/patacrep/data/} % +} + + +\makeatletter +\@ifpackageloaded{hyperref}{}{ + \usepackage{url} + \newcommand{\phantomsection}{} + \newcommand{\hyperlink}[2]{#2} + \newcommand{\href}[2]{\expandafter\url\expandafter{#1}} +} +\makeatother +\DeclareUnicodeCharacter{00A0}{~} + + +\usepackage{chords} + +\title{Guitar songbook} +\author{The Patacrep Team} + +\newindex{titleidx}{unicode_title} +\newauthorindex{authidx}{unicode_auth} + + +\notenamesout{A}{B}{C}{D}{E}{F}{G} + + +\begin{document} + +\maketitle + + +\showindex{\songindexname}{titleidx} +\showindex{\authorindexname}{authidx} + +% list of chords +\ifchorded + \ifdiagram + \phantomsection + \addcontentsline{toc}{section}{\chordlistname} + \chords + \fi +\fi + +\phantomsection +\addcontentsline{toc}{section}{\songlistname} + +\begin{songs}{titleidx,authidx} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% songs/./nonbreak.sgc + +\selectlanguage{english} + +\beginsong{Song with non breakable space}[ + by={ + Author with non breaking space chars }, +] + + + + +\begin{verse} + Non break +\end{verse} + +\endsong + +\end{songs} + + + + +\end{document} \ No newline at end of file diff --git a/test/test_compilation/unicode_datadir/songs/nonbreak.sgc b/test/test_compilation/unicode_datadir/songs/nonbreak.sgc new file mode 100644 index 00000000..841d9acb --- /dev/null +++ b/test/test_compilation/unicode_datadir/songs/nonbreak.sgc @@ -0,0 +1,5 @@ +{title : Song with non breakable space} +{by: Author with non breaking space chars} +{lang: en} + +Non break From d31a3717eede92a7ac49966de4326bc65d9fc32a Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 28 Oct 2015 21:27:00 +0100 Subject: [PATCH 07/24] [WIP] Revert latex-specific changes (in orter to use lualatex) --- patacrep/data/templates/songs.tex | 1 - patacrep/index.py | 2 -- test/test_compilation/subdir.tex.control | 1 - 3 files changed, 4 deletions(-) diff --git a/patacrep/data/templates/songs.tex b/patacrep/data/templates/songs.tex index 0a6b3331..e3562897 100644 --- a/patacrep/data/templates/songs.tex +++ b/patacrep/data/templates/songs.tex @@ -102,7 +102,6 @@ \newcommand{\href}[2]{\expandafter\url\expandafter{#1}} } \makeatother -\DeclareUnicodeCharacter{00A0}{~} (* endblock *) (* block songs *) diff --git a/patacrep/index.py b/patacrep/index.py index c0727519..b53001df 100644 --- a/patacrep/index.py +++ b/patacrep/index.py @@ -136,8 +136,6 @@ class Index(object): if self.indextype == "AUTHOR": - # \IeC {} is included by LaTeX and must not be split (because of the space) - key = key.replace('\\IeC {', '\\IeC{') # Processing authors for author in authors.processauthors( key, diff --git a/test/test_compilation/subdir.tex.control b/test/test_compilation/subdir.tex.control index 6ed84e9a..bd9ac649 100644 --- a/test/test_compilation/subdir.tex.control +++ b/test/test_compilation/subdir.tex.control @@ -55,7 +55,6 @@ guitar, \newcommand{\href}[2]{\expandafter\url\expandafter{#1}} } \makeatother -\DeclareUnicodeCharacter{00A0}{~} \usepackage{chords} From 30bbf8c533ec8696d7d50fee0f190d880cf416d8 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 28 Oct 2015 21:35:02 +0100 Subject: [PATCH 08/24] First draft for pdflatex replacement by lualatex --- patacrep/build.py | 16 ++++++++-------- patacrep/data/latex/patacrep.sty | 5 +++++ patacrep/data/templates/layout.tex | 2 -- test/test_compilation/subdir.tex.control | 2 -- test/test_compilation/unicode.tex.control | 5 +---- 5 files changed, 14 insertions(+), 16 deletions(-) diff --git a/patacrep/build.py b/patacrep/build.py index 40ef74ff..00be667e 100644 --- a/patacrep/build.py +++ b/patacrep/build.py @@ -136,10 +136,10 @@ class SongbookBuilder(object): # if False, do not expect anything from stdin. interactive = False - # if True, allow unsafe option, like adding the --shell-escape to pdflatex + # if True, allow unsafe option, like adding the --shell-escape to lualatex unsafe = False - # Options to add to pdflatex - _pdflatex_options = [] + # Options to add to lualatex + _lualatex_options = [] # Dictionary of functions that have been called by self._run_once(). Keys # are function; values are return values of functions. _called_functions = {} @@ -165,11 +165,11 @@ class SongbookBuilder(object): def _set_latex(self): """Set LaTeX options.""" if self.unsafe: - self._pdflatex_options.append("--shell-escape") + self._lualatex_options.append("--shell-escape") if not self.interactive: - self._pdflatex_options.append("-halt-on-error") + self._lualatex_options.append("-halt-on-error") for datadir in self.songbook.config["datadir"]: - self._pdflatex_options.append( + self._lualatex_options.append( '--include-directory="{}"'.format(datadir) ) @@ -180,7 +180,7 @@ class SongbookBuilder(object): - steps: list of steps to perform to compile songbook. Available steps are: - tex: build .tex file from templates; - - pdf: compile .tex using pdflatex; + - pdf: compile .tex using lualatex; - sbx: compile song and author indexes; - clean: remove temporary files, - any string beginning with a sharp sign (#): it is interpreted as a @@ -219,7 +219,7 @@ class SongbookBuilder(object): try: process = Popen( - ["pdflatex"] + self._pdflatex_options + [self.basename], + ["lualatex"] + self._lualatex_options + [self.basename], stdin=PIPE, stdout=PIPE, stderr=PIPE, diff --git a/patacrep/data/latex/patacrep.sty b/patacrep/data/latex/patacrep.sty index f3218005..d3735739 100644 --- a/patacrep/data/latex/patacrep.sty +++ b/patacrep/data/latex/patacrep.sty @@ -75,6 +75,11 @@ \pdfobjcompresslevel=0 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Unicode characters +\RequirePackage{fontspec} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Multilanguage management diff --git a/patacrep/data/templates/layout.tex b/patacrep/data/templates/layout.tex index ae23d681..099772a4 100644 --- a/patacrep/data/templates/layout.tex +++ b/patacrep/data/templates/layout.tex @@ -41,8 +41,6 @@ (* endblock *) (* block songbookpreambule *) -\usepackage[utf8]{inputenc} -\usepackage[T1]{fontenc} \usepackage{lmodern} (* endblock songbookpreambule *) diff --git a/test/test_compilation/subdir.tex.control b/test/test_compilation/subdir.tex.control index bd9ac649..87ae4e77 100644 --- a/test/test_compilation/subdir.tex.control +++ b/test/test_compilation/subdir.tex.control @@ -29,8 +29,6 @@ pictures, guitar, ]{patacrep} -\usepackage[utf8]{inputenc} -\usepackage[T1]{fontenc} \usepackage{lmodern} diff --git a/test/test_compilation/unicode.tex.control b/test/test_compilation/unicode.tex.control index cd402cdb..41ecff30 100644 --- a/test/test_compilation/unicode.tex.control +++ b/test/test_compilation/unicode.tex.control @@ -29,8 +29,6 @@ pictures, guitar, ]{patacrep} -\usepackage[utf8]{inputenc} -\usepackage[T1]{fontenc} \usepackage{lmodern} @@ -54,7 +52,6 @@ guitar, \newcommand{\href}[2]{\expandafter\url\expandafter{#1}} } \makeatother -\DeclareUnicodeCharacter{00A0}{~} \usepackage{chords} @@ -114,4 +111,4 @@ guitar, -\end{document} \ No newline at end of file +\end{document} From 1d7f2e46715970334c4d191c354e4cdfa91612a7 Mon Sep 17 00:00:00 2001 From: Louis Date: Wed, 28 Oct 2015 21:41:25 +0100 Subject: [PATCH 09/24] [test] Fix path --- test/test_compilation/unicode.tex.control | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/test_compilation/unicode.tex.control b/test/test_compilation/unicode.tex.control index cd402cdb..84bec7ef 100644 --- a/test/test_compilation/unicode.tex.control +++ b/test/test_compilation/unicode.tex.control @@ -13,9 +13,9 @@ \makeatletter \def\input@path{ % - {/home/louis/projets/patacrep/patacrep/test/test_compilation/unicode_datadir/latex/} % - {/home/louis/projets/patacrep/patacrep/test/test_compilation/latex/} % - {/home/louis/projets/patacrep/patacrep/patacrep/data/latex/} % + {@TEST_FOLDER@/unicode_datadir/latex/} % + {@TEST_FOLDER@/latex/} % + {@DATA_FOLDER@/latex/} % } \makeatother @@ -40,9 +40,9 @@ guitar, \usepackage{graphicx} \graphicspath{ % - {/home/louis/projets/patacrep/patacrep/test/test_compilation/unicode_datadir/} % - {/home/louis/projets/patacrep/patacrep/test/test_compilation/} % - {/home/louis/projets/patacrep/patacrep/patacrep/data/} % + {@TEST_FOLDER@/unicode_datadir/} % + {@TEST_FOLDER@/} % + {@DATA_FOLDER@/} % } @@ -114,4 +114,4 @@ guitar, -\end{document} \ No newline at end of file +\end{document} From 442b7a1deafaf2f4a86b067820dc38b7b0440213 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 29 Oct 2015 09:53:36 +0100 Subject: [PATCH 10/24] Add travis dependency --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 3aceab0a..74c89def 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,7 @@ addons: - texlive-latex-base - latex-xcolor - texlive-latex-extra + - texlive-xetex - pgf - lmodern - lilypond From e45b4719f0c6407ac9a7f8679135515e9938fc09 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 29 Oct 2015 09:58:17 +0100 Subject: [PATCH 11/24] [test] Correct travis dependency --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 74c89def..848cbd6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ addons: - texlive-latex-base - latex-xcolor - texlive-latex-extra - - texlive-xetex + - texlive-luatex - pgf - lmodern - lilypond From eb13799e28b261bda554dc87e191b717d8bb9672 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 29 Oct 2015 10:00:45 +0100 Subject: [PATCH 12/24] [test] lualatex and xetex seems required --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 848cbd6c..f142cd84 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,7 @@ addons: - latex-xcolor - texlive-latex-extra - texlive-luatex + - texlive-xetex - pgf - lmodern - lilypond From aee003f87f208521b3c4e4d86bb57f3f886f5b2f Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 29 Oct 2015 12:25:23 +0100 Subject: [PATCH 13/24] Skip compilation test on Travis --- test/test_compilation/test_compilation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_compilation/test_compilation.py b/test/test_compilation/test_compilation.py index 812ba0ac..f8f80c1c 100644 --- a/test/test_compilation/test_compilation.py +++ b/test/test_compilation/test_compilation.py @@ -48,6 +48,8 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): def _create_test(cls, base): """Return a function testing that `base` compiles.""" + @unittest.skipIf('TRAVIS' in os.environ, + "Travis does not support lualatex compilation yet") def test_compile(self): """Test that `base` is correctly compiled.""" if base is None: From 4acb42cf87c0f9b19603ad67826a35db10b97718 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 29 Oct 2015 12:29:28 +0100 Subject: [PATCH 14/24] Disable LaTeX installation on Travis since the tests are skipped --- .travis.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index f142cd84..c398bbfe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,16 +8,16 @@ install: script: - tox sudo: false -addons: - apt: - packages: - - texlive-latex-base - - latex-xcolor - - texlive-latex-extra - - texlive-luatex - - texlive-xetex - - pgf - - lmodern - - lilypond +# addons: +# apt: +# packages: +# - texlive-latex-base +# - latex-xcolor +# - texlive-latex-extra +# - texlive-luatex +# - texlive-xetex +# - pgf +# - lmodern +# - lilypond notifications: email: false From 43a492c9884eb6069e0587cac06e61e39fc46ba5 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 29 Oct 2015 12:33:43 +0100 Subject: [PATCH 15/24] Pass the TRAVIS environment variable to the tests --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index aa6c7c00..1b6a3337 100644 --- a/tox.ini +++ b/tox.ini @@ -7,6 +7,7 @@ envlist = py34, lint [testenv] commands = {envpython} setup.py test +passenv = TRAVIS deps = [testenv:lint] From 6c62ab8ade05b7d2f9f0431b63950293a55dee76 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 29 Oct 2015 12:37:12 +0100 Subject: [PATCH 16/24] pylint --- test/test_compilation/test_compilation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_compilation/test_compilation.py b/test/test_compilation/test_compilation.py index f8f80c1c..d9aebe68 100644 --- a/test/test_compilation/test_compilation.py +++ b/test/test_compilation/test_compilation.py @@ -49,7 +49,7 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): """Return a function testing that `base` compiles.""" @unittest.skipIf('TRAVIS' in os.environ, - "Travis does not support lualatex compilation yet") + "Travis does not support lualatex compilation yet") def test_compile(self): """Test that `base` is correctly compiled.""" if base is None: From e005d95b2d10fff39340e2985b339f413385071e Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 29 Oct 2015 12:41:01 +0100 Subject: [PATCH 17/24] pylint bis --- test/test_compilation/test_compilation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_compilation/test_compilation.py b/test/test_compilation/test_compilation.py index d9aebe68..a3a402d4 100644 --- a/test/test_compilation/test_compilation.py +++ b/test/test_compilation/test_compilation.py @@ -49,7 +49,7 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): """Return a function testing that `base` compiles.""" @unittest.skipIf('TRAVIS' in os.environ, - "Travis does not support lualatex compilation yet") + "Travis does not support lualatex compilation yet") def test_compile(self): """Test that `base` is correctly compiled.""" if base is None: From 3431cbecf13ebfe8926a526f8b5c949c70d764b0 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 29 Oct 2015 12:44:23 +0100 Subject: [PATCH 18/24] Useless newline --- patacrep/index.py | 1 - 1 file changed, 1 deletion(-) diff --git a/patacrep/index.py b/patacrep/index.py index b53001df..b67897f3 100644 --- a/patacrep/index.py +++ b/patacrep/index.py @@ -135,7 +135,6 @@ class Index(object): self._raw_add((key, ""), number, link) if self.indextype == "AUTHOR": - # Processing authors for author in authors.processauthors( key, From cd0e0838f40a2420d6160fd63fa11a9463ef74f7 Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 29 Oct 2015 14:05:22 +0100 Subject: [PATCH 19/24] [test] Renamed `subdir` tests into `datadir` --- .../{subdir.sb => datadir.sb} | 2 +- ...subdir.tex.control => datadir.tex.control} | 25 +++++++++--------- .../img/datadir.png | Bin .../scores/datadir.ly | 0 .../songs/datadir.sg | 0 .../songs/datadir.sgc | 0 .../songs/datadir2.sg | 0 .../songs/datadir2.sgc | 0 .../songs/relative.ly | 0 .../songs/relative.png | Bin .../songs/relative.sg | 0 .../songs/relative.sgc | 0 .../img/datadir2.png | Bin .../scores/datadir2.ly | 0 14 files changed, 14 insertions(+), 13 deletions(-) rename test/test_compilation/{subdir.sb => datadir.sb} (51%) rename test/test_compilation/{subdir.tex.control => datadir.tex.control} (80%) rename test/test_compilation/{subdir_datadir => datadir_datadir}/img/datadir.png (100%) rename test/test_compilation/{subdir_datadir => datadir_datadir}/scores/datadir.ly (100%) rename test/test_compilation/{subdir_datadir => datadir_datadir}/songs/datadir.sg (100%) rename test/test_compilation/{subdir_datadir => datadir_datadir}/songs/datadir.sgc (100%) rename test/test_compilation/{subdir_datadir => datadir_datadir}/songs/datadir2.sg (100%) rename test/test_compilation/{subdir_datadir => datadir_datadir}/songs/datadir2.sgc (100%) rename test/test_compilation/{subdir_datadir => datadir_datadir}/songs/relative.ly (100%) rename test/test_compilation/{subdir_datadir => datadir_datadir}/songs/relative.png (100%) rename test/test_compilation/{subdir_datadir => datadir_datadir}/songs/relative.sg (100%) rename test/test_compilation/{subdir_datadir => datadir_datadir}/songs/relative.sgc (100%) rename test/test_compilation/{subdir_datadir2 => datadir_datadir2}/img/datadir2.png (100%) rename test/test_compilation/{subdir_datadir2 => datadir_datadir2}/scores/datadir2.ly (100%) diff --git a/test/test_compilation/subdir.sb b/test/test_compilation/datadir.sb similarity index 51% rename from test/test_compilation/subdir.sb rename to test/test_compilation/datadir.sb index 28132138..357c28d7 100644 --- a/test/test_compilation/subdir.sb +++ b/test/test_compilation/datadir.sb @@ -2,6 +2,6 @@ "bookoptions" : [ "pictures" ], -"datadir": ["subdir_datadir", "subdir_datadir2"], +"datadir": ["datadir_datadir", "datadir_datadir2"], "lang": "en" } diff --git a/test/test_compilation/subdir.tex.control b/test/test_compilation/datadir.tex.control similarity index 80% rename from test/test_compilation/subdir.tex.control rename to test/test_compilation/datadir.tex.control index 87ae4e77..35791783 100644 --- a/test/test_compilation/subdir.tex.control +++ b/test/test_compilation/datadir.tex.control @@ -13,8 +13,8 @@ \makeatletter \def\input@path{ % - {@TEST_FOLDER@/subdir_datadir/latex/} % - {@TEST_FOLDER@/subdir_datadir2/latex/} % + {@TEST_FOLDER@/datadir_datadir/latex/} % + {@TEST_FOLDER@/datadir_datadir2/latex/} % {@TEST_FOLDER@/latex/} % {@DATA_FOLDER@/latex/} % } @@ -32,14 +32,15 @@ guitar, \usepackage{lmodern} +\PassOptionsToPackage{english}{babel} \PassOptionsToPackage{english}{babel} \usepackage[english]{babel} \lang{english} \usepackage{graphicx} \graphicspath{ % - {@TEST_FOLDER@/subdir_datadir/} % - {@TEST_FOLDER@/subdir_datadir2/} % + {@TEST_FOLDER@/datadir_datadir/} % + {@TEST_FOLDER@/datadir_datadir2/} % {@TEST_FOLDER@/} % {@DATA_FOLDER@/} % } @@ -60,8 +61,8 @@ guitar, \title{Guitar songbook} \author{The Patacrep Team} -\newindex{titleidx}{subdir_title} -\newauthorindex{authidx}{subdir_auth} +\newindex{titleidx}{datadir_title} +\newauthorindex{authidx}{datadir_auth} \notenamesout{A}{B}{C}{D}{E}{F}{G} @@ -91,7 +92,7 @@ guitar, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% songs/./datadir.sg -\import{subdir_datadir/songs/}{datadir.sg} +\import{datadir_datadir/songs/}{datadir.sg} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% songs/./datadir.sgc @@ -118,7 +119,7 @@ Chordpro}[ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% songs/./datadir2.sg -\import{subdir_datadir/songs/}{datadir2.sg} +\import{datadir_datadir/songs/}{datadir2.sg} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% songs/./datadir2.sgc @@ -145,7 +146,7 @@ Chordpro}[ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% songs/./relative.sg -\import{subdir_datadir/songs/}{relative.sg} +\import{datadir_datadir/songs/}{relative.sg} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% songs/./relative.sgc @@ -156,15 +157,15 @@ Chordpro}[ Chordpro}[ by={ }, - cov={@TEST_FOLDER@/subdir_datadir/songs/./relative.png}, + cov={@TEST_FOLDER@/datadir_datadir/songs/./relative.png}, ] \cover -\lilypond{@TEST_FOLDER@/subdir_datadir/songs/./relative.ly} -\image{@TEST_FOLDER@/subdir_datadir/songs/./relative.png} +\lilypond{@TEST_FOLDER@/datadir_datadir/songs/./relative.ly} +\image{@TEST_FOLDER@/datadir_datadir/songs/./relative.png} \endsong diff --git a/test/test_compilation/subdir_datadir/img/datadir.png b/test/test_compilation/datadir_datadir/img/datadir.png similarity index 100% rename from test/test_compilation/subdir_datadir/img/datadir.png rename to test/test_compilation/datadir_datadir/img/datadir.png diff --git a/test/test_compilation/subdir_datadir/scores/datadir.ly b/test/test_compilation/datadir_datadir/scores/datadir.ly similarity index 100% rename from test/test_compilation/subdir_datadir/scores/datadir.ly rename to test/test_compilation/datadir_datadir/scores/datadir.ly diff --git a/test/test_compilation/subdir_datadir/songs/datadir.sg b/test/test_compilation/datadir_datadir/songs/datadir.sg similarity index 100% rename from test/test_compilation/subdir_datadir/songs/datadir.sg rename to test/test_compilation/datadir_datadir/songs/datadir.sg diff --git a/test/test_compilation/subdir_datadir/songs/datadir.sgc b/test/test_compilation/datadir_datadir/songs/datadir.sgc similarity index 100% rename from test/test_compilation/subdir_datadir/songs/datadir.sgc rename to test/test_compilation/datadir_datadir/songs/datadir.sgc diff --git a/test/test_compilation/subdir_datadir/songs/datadir2.sg b/test/test_compilation/datadir_datadir/songs/datadir2.sg similarity index 100% rename from test/test_compilation/subdir_datadir/songs/datadir2.sg rename to test/test_compilation/datadir_datadir/songs/datadir2.sg diff --git a/test/test_compilation/subdir_datadir/songs/datadir2.sgc b/test/test_compilation/datadir_datadir/songs/datadir2.sgc similarity index 100% rename from test/test_compilation/subdir_datadir/songs/datadir2.sgc rename to test/test_compilation/datadir_datadir/songs/datadir2.sgc diff --git a/test/test_compilation/subdir_datadir/songs/relative.ly b/test/test_compilation/datadir_datadir/songs/relative.ly similarity index 100% rename from test/test_compilation/subdir_datadir/songs/relative.ly rename to test/test_compilation/datadir_datadir/songs/relative.ly diff --git a/test/test_compilation/subdir_datadir/songs/relative.png b/test/test_compilation/datadir_datadir/songs/relative.png similarity index 100% rename from test/test_compilation/subdir_datadir/songs/relative.png rename to test/test_compilation/datadir_datadir/songs/relative.png diff --git a/test/test_compilation/subdir_datadir/songs/relative.sg b/test/test_compilation/datadir_datadir/songs/relative.sg similarity index 100% rename from test/test_compilation/subdir_datadir/songs/relative.sg rename to test/test_compilation/datadir_datadir/songs/relative.sg diff --git a/test/test_compilation/subdir_datadir/songs/relative.sgc b/test/test_compilation/datadir_datadir/songs/relative.sgc similarity index 100% rename from test/test_compilation/subdir_datadir/songs/relative.sgc rename to test/test_compilation/datadir_datadir/songs/relative.sgc diff --git a/test/test_compilation/subdir_datadir2/img/datadir2.png b/test/test_compilation/datadir_datadir2/img/datadir2.png similarity index 100% rename from test/test_compilation/subdir_datadir2/img/datadir2.png rename to test/test_compilation/datadir_datadir2/img/datadir2.png diff --git a/test/test_compilation/subdir_datadir2/scores/datadir2.ly b/test/test_compilation/datadir_datadir2/scores/datadir2.ly similarity index 100% rename from test/test_compilation/subdir_datadir2/scores/datadir2.ly rename to test/test_compilation/datadir_datadir2/scores/datadir2.ly From 3320da9703d08567901f36f9e8be9251c71a5e69 Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 29 Oct 2015 14:13:49 +0100 Subject: [PATCH 20/24] [test] Add a test for "deep" subdir --- test/test_compilation/datadir.tex.control | 27 ++++++++++++++++++ .../datadir_datadir/songs/subdir/subdir.ly | 19 ++++++++++++ .../datadir_datadir/songs/subdir/subdir.png | Bin 0 -> 4366 bytes .../datadir_datadir/songs/subdir/subdir.sg | 10 +++++++ .../datadir_datadir/songs/subdir/subdir.sgc | 7 +++++ 5 files changed, 63 insertions(+) create mode 100644 test/test_compilation/datadir_datadir/songs/subdir/subdir.ly create mode 100644 test/test_compilation/datadir_datadir/songs/subdir/subdir.png create mode 100644 test/test_compilation/datadir_datadir/songs/subdir/subdir.sg create mode 100644 test/test_compilation/datadir_datadir/songs/subdir/subdir.sgc diff --git a/test/test_compilation/datadir.tex.control b/test/test_compilation/datadir.tex.control index 35791783..4f6c8521 100644 --- a/test/test_compilation/datadir.tex.control +++ b/test/test_compilation/datadir.tex.control @@ -168,6 +168,33 @@ Chordpro}[ \image{@TEST_FOLDER@/datadir_datadir/songs/./relative.png} +\endsong + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% songs/./subdir/subdir.sg + +\import{datadir_datadir/songs/subdir/}{subdir.sg} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% songs/./subdir/subdir.sgc + +\selectlanguage{english} + +\beginsong{Image included from a nested song directory\\ +Chordpro}[ + by={ + }, + cov={@TEST_FOLDER@/datadir_datadir/songs/./subdir/subdir.png}, +] + +\cover + + + +\lilypond{@TEST_FOLDER@/datadir_datadir/songs/./subdir/subdir.ly} +\image{@TEST_FOLDER@/datadir_datadir/songs/./subdir/subdir.png} + + \endsong \end{songs} diff --git a/test/test_compilation/datadir_datadir/songs/subdir/subdir.ly b/test/test_compilation/datadir_datadir/songs/subdir/subdir.ly new file mode 100644 index 00000000..1fd2bccb --- /dev/null +++ b/test/test_compilation/datadir_datadir/songs/subdir/subdir.ly @@ -0,0 +1,19 @@ +\include "_lilypond/header" +\paper{paper-height = 6.5\cm} + +{ + \key a \minor + \time 6/8 + \partial 8 a'8 + \relative c''{ + c4 d8 e8. (f16) e8 d4 b8 g8. (a16) b8 + c4 a8 a8. (gis16) a8 b4 gis8 e4 a8 + c4 d8 e8. (f16 e8) d4 b8 g8. (a16) b8 + c8. (b16) a8 gis8. (fis16) gis8 a4 a8 a4. + + g'4. g8. (fis16) e8 d4 b8 g8. (a16) b8 + c4 (a8) a8. (gis16) a8 b4 gis8 e4. + g'4. g8. (fis16) e8 d4 b8 g8. (a16) b8 + c8. (b16) a8 gis8. (fis16) gis8 a4. a4. + } +} diff --git a/test/test_compilation/datadir_datadir/songs/subdir/subdir.png b/test/test_compilation/datadir_datadir/songs/subdir/subdir.png new file mode 100644 index 0000000000000000000000000000000000000000..2e134e8f932036837347aa3acc4d640cca81d571 GIT binary patch literal 4366 zcmajiXHXMLy8z%Q0#c=S4!si~ARr(hHKBwOdKZ%bp@kCZAW}q{)BuKFLPtTmRHb*6 z`cXxyAShk>$GLaTow@h^_9+-lZg%kh)P-sEaVYeA^8!Y$l z-L^YjAa?+OLtv5RFKI`F+wD^Kns{d#Oxu+`@vV;62@}Kmp~0%Ycn+-%&X! z;!tiPKxoXJq9W2iAz~*#6UQZFg224uQrSDJt0Xu5eTGi}fWIokUOeEF=T9L93;`0y zbT-KViPn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G|=zZc5U2?J33r^l({g+VzW{Wy)#4j5m1FC^#f@}T=4 zd+Kf>=pTqcdc(a?9vBqb9q|8vHw>)GsimgIY2bx+K)E7m$?v?n#ghMEH+%Qz4)$=& zb1$UVf7aF^in+I1);H} literal 0 HcmV?d00001 diff --git a/test/test_compilation/datadir_datadir/songs/subdir/subdir.sg b/test/test_compilation/datadir_datadir/songs/subdir/subdir.sg new file mode 100644 index 00000000..f86b47b4 --- /dev/null +++ b/test/test_compilation/datadir_datadir/songs/subdir/subdir.sg @@ -0,0 +1,10 @@ +\beginsong{Image included from a nested song directory\\\LaTeX} + [cov={subdir}] + + \cover + + \lilypond{subdir.ly} + + \image{subdir} + +\endsong diff --git a/test/test_compilation/datadir_datadir/songs/subdir/subdir.sgc b/test/test_compilation/datadir_datadir/songs/subdir/subdir.sgc new file mode 100644 index 00000000..0f2cb436 --- /dev/null +++ b/test/test_compilation/datadir_datadir/songs/subdir/subdir.sgc @@ -0,0 +1,7 @@ +{title : Image included from a nested song directory} +{subtitle: Chordpro} +{cover: subdir.png} +{lang: en} + +{partition: subdir.ly} +{image: subdir.png} From e91a52604c7344c25c120546f988981dff034f9f Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 29 Oct 2015 15:05:22 +0100 Subject: [PATCH 21/24] Travis should skip only the full compilation --- test/test_compilation/test_compilation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_compilation/test_compilation.py b/test/test_compilation/test_compilation.py index a3a402d4..15f62ec5 100644 --- a/test/test_compilation/test_compilation.py +++ b/test/test_compilation/test_compilation.py @@ -48,8 +48,6 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): def _create_test(cls, base): """Return a function testing that `base` compiles.""" - @unittest.skipIf('TRAVIS' in os.environ, - "Travis does not support lualatex compilation yet") def test_compile(self): """Test that `base` is correctly compiled.""" if base is None: @@ -86,7 +84,9 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): ) # Check compilation - self.assertEqual(0, self.compile_songbook(songbook)) + if not 'TRAVIS' in os.environ: + # Travis does not support lualatex compilation yet + self.assertEqual(0, self.compile_songbook(songbook)) test_compile.__doc__ = ( "Test that '{base}' is correctly compiled." From e7babf5afb1678ecbea815df3677fd7b2adfb6d9 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 29 Oct 2015 15:08:19 +0100 Subject: [PATCH 22/24] Correct travis check --- test/test_compilation/test_compilation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_compilation/test_compilation.py b/test/test_compilation/test_compilation.py index 15f62ec5..11bb197b 100644 --- a/test/test_compilation/test_compilation.py +++ b/test/test_compilation/test_compilation.py @@ -84,7 +84,7 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): ) # Check compilation - if not 'TRAVIS' in os.environ: + if 'TRAVIS' not in os.environ: # Travis does not support lualatex compilation yet self.assertEqual(0, self.compile_songbook(songbook)) From 7d3864b72a5fd5d34eb6344b0573a3ed278a2440 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 29 Oct 2015 15:16:23 +0100 Subject: [PATCH 23/24] Correct test --- test/test_compilation/datadir.tex.control | 1 - 1 file changed, 1 deletion(-) diff --git a/test/test_compilation/datadir.tex.control b/test/test_compilation/datadir.tex.control index 4f6c8521..90c8d34b 100644 --- a/test/test_compilation/datadir.tex.control +++ b/test/test_compilation/datadir.tex.control @@ -32,7 +32,6 @@ guitar, \usepackage{lmodern} -\PassOptionsToPackage{english}{babel} \PassOptionsToPackage{english}{babel} \usepackage[english]{babel} \lang{english} From d905b5f4c0cf6e42a4c586d6f0cb7dc1c459d70a Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 29 Oct 2015 22:42:01 +0100 Subject: [PATCH 24/24] [test] Split compilation test into generation and compilation So that compilation test can be skipped on systems where lualatex is not installed. --- test/dynamic.py | 10 ++---- test/test_chordpro/test_parser.py | 2 +- test/test_compilation/test_compilation.py | 44 ++++++++++++++--------- 3 files changed, 32 insertions(+), 24 deletions(-) diff --git a/test/dynamic.py b/test/dynamic.py index 19b721a3..494dfc8f 100644 --- a/test/dynamic.py +++ b/test/dynamic.py @@ -13,13 +13,9 @@ class DynamicTest(type): def __init__(cls, name, bases, nmspc): super().__init__(name, bases, nmspc) - for methodname, args in cls._iter_testmethods(): - setattr(cls, methodname, cls._create_test(*args)) + for methodname, testmethod in cls._iter_testmethods(): + setattr(cls, methodname, testmethod) def _iter_testmethods(cls): - """Iterate over test methods.""" - raise NotImplementedError() - - def _create_test(cls, *args, **kwargs): - """Create and return a test method.""" + """Iterate over dynamically generated test methods.""" raise NotImplementedError() diff --git a/test/test_chordpro/test_parser.py b/test/test_chordpro/test_parser.py index 727cabba..f0e94290 100644 --- a/test/test_chordpro/test_parser.py +++ b/test/test_chordpro/test_parser.py @@ -58,7 +58,7 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): continue yield ( "test_{}_{}".format(os.path.basename(base), dest), - [base, dest], + cls._create_test(base, dest), ) @classmethod diff --git a/test/test_compilation/test_compilation.py b/test/test_compilation/test_compilation.py index 11bb197b..dc07107a 100644 --- a/test/test_compilation/test_compilation.py +++ b/test/test_compilation/test_compilation.py @@ -3,10 +3,10 @@ # pylint: disable=too-few-public-methods import glob +import logging import os import subprocess import unittest -import logging from patacrep.encoding import open_read @@ -30,7 +30,7 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): @classmethod def _iter_testmethods(cls): - """Iterate over songbook files to test.""" + """Iterate over dynamically generated test methods.""" for songbook in sorted(glob.glob(os.path.join( os.path.dirname(__file__), '*.sb', @@ -40,19 +40,20 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): if not os.path.exists(control): continue yield ( - "test_{}".format(os.path.basename(base)), - [base], + "test_generation_{}".format(os.path.basename(base)), + cls._create_generation_test(base), + ) + yield ( + "test_compilation_{}".format(os.path.basename(base)), + cls._create_compilation_test(base), ) @classmethod - def _create_test(cls, base): - """Return a function testing that `base` compiles.""" - - def test_compile(self): - """Test that `base` is correctly compiled.""" - if base is None: - return + def _create_generation_test(cls, base): + """Return a function testing that `base.tex` is correctly generated.""" + def test_generation(self): + """Test that `base.tex` is correctly generated.""" songbook = "{}.sb".format(base) # Check tex generation @@ -83,15 +84,26 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): expected, ) + test_generation.__doc__ = ( + "Test that '{base}' is correctly generated." + ).format(base=os.path.basename(base)) + return test_generation + + @classmethod + def _create_compilation_test(cls, base): + """Return a function testing that `base.tex` is correctly compiled.""" + @unittest.skipIf('TRAVIS' in os.environ, + "Travis does not support lualatex compilation yet") + def test_compilation(self): + """Test that `base` is rendered to pdf.""" # Check compilation - if 'TRAVIS' not in os.environ: - # Travis does not support lualatex compilation yet - self.assertEqual(0, self.compile_songbook(songbook)) + songbook = "{}.sb".format(base) + self.assertEqual(0, self.compile_songbook(songbook)) - test_compile.__doc__ = ( + test_compilation.__doc__ = ( "Test that '{base}' is correctly compiled." ).format(base=os.path.basename(base)) - return test_compile + return test_compilation @staticmethod def compile_songbook(songbook, steps=None):