3 # quick latex writer test runner
6 echo "THIS is not updated in normal commits"
13 CHECKS
=$
((CHECKS
+ 1))
15 if test $?
-gt 0 ; then
17 FAIL_QUEUE
="$FAIL_QUEUE,$1"
22 echo "-------------------------------------"
23 if test $FAILS -eq 0 ; then
24 echo "OK: all $CHECKS tests passed"
26 echo "ERROR: $FAILS of $CHECKS failed"
27 echo "Failed tests: $FAIL_QUEUE"
31 BARE_CMD
="../../docutils/tools/rst2latex.py --traceback "
32 BASE_CMD
="$BARE_CMD --stylesheet= "
41 for INF
in `ls test/$FM` ; do
45 if [ $INF = "test/unicode-box.txt" ] ; then
48 $CMD $OPT $2 $3 $INF > $OUTF
52 if [ -n "$1" -a ! "$1" == "-" ] ; then
57 # stylesheet embedding
59 # fail for no extension
61 STF
=test
/dummy_stylesheet
62 echo -e "% dummy stylesheet\n% second line" > $STF
63 OUTF
="$INF-embed-stylesheet.err"
65 $CMD --stylesheet-path=$STF --embed-stylesheet $2 $3 $INF > $OUTF 2>&1
69 OUTF
="$INF-embed-stylesheet.tex"
71 $CMD --stylesheet-path=$STF.inc
--embed-stylesheet $2 $3 $INF > $OUTF 2>&1
75 OUTF
="$INF-embed-stylesheet-sty.tex"
77 $CMD --stylesheet-path=$STF.sty
--embed-stylesheet $2 $3 $INF > $OUTF 2>&1
81 for GO
in "" auto pdftex dvips
,300dpi
; do
82 OUTF
="$INF-graphicx-option-$GO.tex"
84 $CMD --graphicx-option=$GO $2 $3 $INF > $OUTF
89 for FONTENC
in "" T1 OT1
; do
90 for INF
in `ls test/characters.txt` ; do
91 OUTF
="$INF-$FONTENC.tex"
93 if [ -z $FONTENC ] ; then
94 $CMD $2 $3 $INF > $OUTF
96 $CMD --font-encoding=$FONTENC $2 $3 $INF > $OUTF
103 for LR
in "" "ref" ; do
104 for INF
in test
/links.txt
; do
107 $CMD --reference-label=$LR $2 $3 $INF > $OUTF
112 INF
="test/tables.txt"
113 OUTF
="$INF-verbatim.tex"
115 $CMD --use-verbatim-when-possible $2 $3 $INF > $OUTF
118 INF
="test/tables.txt"
119 OUTF
="$INF-literal-block-env.tex"
121 $CMD --literal-block-env="lstlisting[language=Python]" $2 $3 $INF > $OUTF
125 for TABSTYLE
in "" standard booktabs nolines
; do
126 for INF
in `ls test/tables.txt` ; do
127 OUTF
="$INF-$TABSTYLE.tex"
129 if [ -z $TABSTYLE ] ; then
130 $CMD $2 $3 $INF > $OUTF
132 $CMD --table-style=$TABSTYLE $2 $3 $INF > $OUTF
138 INF
=test
/sections.txt
139 OUTF
="$INF-parts.tex"
141 $CMD --use-part-section $2 $3 $INF > $OUTF
145 INF
=test
/tables-multirow.txt
151 # with generated footer
158 CMD
="$BASE_CMD --documentclass=book"
165 CMD
="$BASE_CMD --documentclass=custom"
167 OUTF
="$INF-custom.tex"
172 CMD
="$BASE_CMD --no-doc-info"
174 OUTF
="$INF-no-info.tex"
179 CMD
="$BASE_CMD --no-doc-title"
181 OUTF
="$INF-no-title.tex"
186 CMD
="$BASE_CMD --no-doc-title --no-doc-info"
188 OUTF
="$INF-no-title-info.tex"
193 CMD
="$BASE_CMD --use-titlepage-env"
194 for F
in docinfo docinfo-1 docinfo-2 docinfo-3
; do
196 OUTF
="$INF-use-titlepage-env.tex"
202 CMD
="$BASE_CMD --use-latex-abstract --use-titlepage-env"
203 for F
in docinfo-2 docinfo-3
; do
205 OUTF
="$INF-use-titlepage-env-latexabstract.tex"
211 CMD
="$BASE_CMD --use-latex-abstract"
214 OUTF
="$INF-use-latex-abstract.tex"
219 CMD
="$BASE_CMD --use-latex-docinfo"
220 for F
in docinfo docinfo-2
; do
222 OUTF
="$INF-use-latex-docinfo.tex"
230 for F
in toc toc-autonr
; do
232 OUTF
="$INF-use-latex-toc.tex"
234 $CMD --use-latex-toc $INF > $OUTF
239 for F
in toc quotes
; do
240 for L
in de fr it
; do
244 $CMD -l $L $INF > $OUTF
249 # spanish --language=es flags inhibits --use-latex-docinfo when using
250 # --documentclass=book and --use-latex-toc
251 CMD
="$BASE_CMD --documentclass=book --use-latex-toc --use-latex-docinfo"
252 for F
in toc quotes
; do
254 OUTF
="$INF-latex-docinfo.tex"
259 OUTF
="$INF-$LANG-latex-docinfo.tex"
261 $CMD --language=$LANG $INF > $OUTF
265 # use latex footnotes
266 CMD
="$BASE_CMD --use-latex-footnotes"
267 INF
=test
/footnotes.txt
268 OUTF
="$INF-use-latex-footnotes.tex"
273 # use latex citations
274 CMD
="$BASE_CMD --use-latex-citations"
275 for F
in footnotes.txt no-citations.txt citation_labels.txt
; do
277 OUTF
="$INF-use-latex-citations.tex"
284 INF
=test
/citations.txt
285 CMD
="$BASE_CMD --use-latex-citations --use-bibtex=mystyle,mydb1,mydb2"
286 OUTF
="$INF-use-bibtex.tex"
291 CMD
="$BASE_CMD --use-verbatim-when-possible"
293 OUTF
="$INF-use-verbatim-when-possible.tex"
298 for L
in en de es
; do
303 $CMD --lang=$L $INF > $OUTF
305 OUTF
="$INF-$L-verb.tex"
307 $CMD --use-verbatim-when-possible --language=$L $INF > $OUTF
312 echo "CHECK: toc with latex toc "
321 $CMD -l de
$INF > $OUTF
324 CMD
="$BASE_CMD --attribution=parens"
325 INF
=test
/attribution.txt
326 OUTF
="$INF-parens-attribution.tex"
331 INF
=test
/iso-8859-15.txt
334 $CMD --input-encoding=iso-8859-15
--output-encoding=iso-8859-15
$INF > $OUTF