Browse Source

[test] Create test for content plugins

pull/176/head
Louis 9 years ago
parent
commit
8b7d99af72
  1. 3
      test/test_chordpro/errors/invalid_content.csg.source
  2. 13
      test/test_compilation/content.sb
  3. 156
      test/test_compilation/content.tex.control
  4. 1
      test/test_compilation/content_datadir/content/foo.tex
  5. 5
      test/test_compilation/content_datadir/content/inter.isg
  6. 2
      test/test_compilation/content_datadir/content/song.csg
  7. 3
      test/test_compilation/content_datadir/content/song.tsg
  8. 1
      test/test_compilation/content_datadir/songs/include.sbc
  9. 5
      test/test_compilation/content_datadir/songs/inter.isg
  10. 3
      test/test_compilation/content_datadir/songs/song.csg
  11. 3
      test/test_compilation/content_datadir/songs/song.tsg

3
test/test_chordpro/errors/invalid_content.csg.source

@ -1,3 +0,0 @@
{soc}
Chorus
{eoc

13
test/test_compilation/content.sb

@ -0,0 +1,13 @@
{
"datadir": ["content_datadir"],
"content": [
["section", "Test of section"],
["sorted"],
["songsection", "Test of song section"],
["cwd(content_datadir/content)",
"song.csg", "song.tsg",
["tex", "foo.tex"]
],
["include", "include.sbc"]
]
}

156
test/test_compilation/content.tex.control

@ -0,0 +1,156 @@
%% 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 <http://www.patacrep.com>
\makeatletter
\def\input@path{ %
{/home/louis/projets/patacrep/patacrep/test/test_compilation/content_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{lmodern}
\PassOptionsToPackage{english}{babel}
\PassOptionsToPackage{english}{babel}
\usepackage[english]{babel}
\lang{english}
\usepackage{graphicx}
\graphicspath{ %
{/home/louis/projets/patacrep/patacrep/test/test_compilation/content_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
\usepackage{chords}
\title{Guitar songbook}
\author{The Patacrep Team}
\newindex{titleidx}{content_title}
\newauthorindex{authidx}{content_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}
\section{Test of section}
\begin{songs}{titleidx,authidx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% songs/./song.tsg
\import{/home/louis/projets/patacrep/patacrep/test/test_compilation/content_datadir/songs/}{song.tsg}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% songs/./song.csg
\selectlanguage{english}
\beginsong{This is a song}[
by={
},
]
\begin{verse}
Foo
\end{verse}
\endsong
\end{songs}
\songsection{Test of song section}
\begin{songs}{titleidx,authidx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% content_datadir/content/song.csg
\selectlanguage{english}
\beginsong{Yet another song}[
by={
},
]
\begin{verse}
Baz
\end{verse}
\endsong
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% content_datadir/content/song.tsg
\import{/home/louis/projets/patacrep/patacrep/test/test_compilation/content_datadir/content/}{song.tsg}
\end{songs}
\input{content_datadir/content/foo.tex}
\section{This is an included section}
\end{document}

1
test/test_compilation/content_datadir/content/foo.tex

@ -0,0 +1 @@
This is a \LaTeX{} file.

5
test/test_compilation/content_datadir/content/inter.isg

@ -0,0 +1,5 @@
\begin{intersong}
\sortassong{}[by={The Patacrep Team}]
This is another example of an intersong.
\end{intersong}

2
test/test_compilation/content_datadir/content/song.csg

@ -0,0 +1,2 @@
{title : Yet another song}
Baz

3
test/test_compilation/content_datadir/content/song.tsg

@ -0,0 +1,3 @@
\beginsong{One last song}
Tagada
\endsong

1
test/test_compilation/content_datadir/songs/include.sbc

@ -0,0 +1 @@
[["section", "This is an included section"]]

5
test/test_compilation/content_datadir/songs/inter.isg

@ -0,0 +1,5 @@
\begin{intersong}
\sortassong{}[by={The Patacrep Team}]
This is an example of an intersong.
\end{intersong}

3
test/test_compilation/content_datadir/songs/song.csg

@ -0,0 +1,3 @@
{title : This is a song}
Foo

3
test/test_compilation/content_datadir/songs/song.tsg

@ -0,0 +1,3 @@
\beginsong{This is another song}
Bar.
\endsong
Loading…
Cancel
Save