From 3f51411943296e0b71c63fab59d60b247b4cd3db Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Fri, 13 Nov 2015 18:16:52 +0100 Subject: [PATCH] Test tsg parsing --- test/test_song/greensleeves.tsg.source | 68 ++++++++++++++++++++++++++ test/test_song/test_parser.py | 7 ++- 2 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 test/test_song/greensleeves.tsg.source diff --git a/test/test_song/greensleeves.tsg.source b/test/test_song/greensleeves.tsg.source new file mode 100644 index 00000000..c4bc461d --- /dev/null +++ b/test/test_song/greensleeves.tsg.source @@ -0,0 +1,68 @@ +\selectlanguage{english} +\songcolumns{2} + +\beginsong{Greensleeves\\ +Un autre sous-titre\\ +Un sous titre}[ + by={ + Traditionnel }, + album={Angleterre}, + cover={img/traditionnel}, +] + +\cover + + + +\lilypond{scores/greensleeves.ly} + + + +\begin{verse} + A\[Am]las, my love, ye \[G]do me wrong + To \[Am]cast me oft dis\[E]curteously + And \[Am]I have loved \[G]you so long + De\[Am]lighting \[E]in your \[Am]companie +\end{verse} + + +\begin{chorus} + \[C]Green\[B]sleeves was \[G]all my joy + \[Am]Greensleeves was \[E]my delight + \[C]Greensleeves was my \[G]heart of gold + And \[Am]who but \[E]Ladie \[Am]Greensleeves +\end{chorus} + + +\begin{verse} + I \[Am]have been ready \[G]at your hand + To \[Am]grant what ever \[E]you would crave + I \[Am]have both waged \[G]life and land + Your \[Am]love and \[E]good will \[Am]for to have +\end{verse} + + +\begin{verse} + I \[Am]bought thee kerchers \[G]to thy head + That \[Am]were wrought fine and \[E]gallantly + I \[Am]kept thee both at \[G]boord and bed + Which \[Am]cost my \[E]purse well \[Am]favouredly +\end{verse} + + +\begin{verse} + I \[Am]bought thee peticotes \[G]of the best + The \[Am]cloth so fine as \[E]fine might be + I \[Am]gave thee jewels \[G]for thy chest + And \[Am]all this \[E]cost I \[Am]spent on thee +\end{verse} + + +\begin{verse} + Thy \[Am]smock of silke, both \[G]faire and white + With \[Am]gold embrodered \[E]gorgeously + Thy \[Am]peticote of \[G]sendall right + And \[Am]this I \[E]bought thee \[Am]gladly +\end{verse} + +\endsong diff --git a/test/test_song/test_parser.py b/test/test_song/test_parser.py index cd38afcd..11a8f30e 100644 --- a/test/test_song/test_parser.py +++ b/test/test_song/test_parser.py @@ -15,7 +15,10 @@ from patacrep.encoding import open_read from .. import disable_logging from .. import dynamic # pylint: disable=unused-import -OUTPUTS = ['csg', 'tsg', 'html'] +OUTPUTS = { + 'csg': ['csg', 'tsg', 'html'], + 'tsg': ['tsg'], +} class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): """Test of chorpro parser, and several renderers. @@ -81,7 +84,7 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): for source in sorted(glob.glob('*.*.source')): [*base, in_format, _] = source.split('.') base = '.'.join(base) - for out_format in OUTPUTS: + for out_format in OUTPUTS[in_format]: outname = "{}.{}".format(base, out_format) if not os.path.exists(outname): continue