5 # Copyright The SCons Foundation
7 # Permission is hereby granted, free of charge, to any person obtaining
8 # a copy of this software and associated documentation files (the
9 # "Software"), to deal in the Software without restriction, including
10 # without limitation the rights to use, copy, modify, merge, publish,
11 # distribute, sublicense, and/or sell copies of the Software, and to
12 # permit persons to whom the Software is furnished to do so, subject to
13 # the following conditions:
15 # The above copyright notice and this permission notice shall be included
16 # in all copies or substantial portions of the Software.
18 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
19 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 Validate that both .tex and .ltx files can handle a LaTeX-style
28 bibliography (by calling $BIBTEX to generate a .bbl file) and
29 correctly re-run to resolve undefined references.
31 Also verifies that package warnings are caught and re-run as needed.
36 test
= TestSCons
.TestSCons()
38 tex
= test
.where_is('tex')
39 latex
= test
.where_is('latex')
40 if not all((tex
, latex
)):
41 test
.skip_test("Could not find 'tex' and/or 'latex'; skipping test(s).\n")
43 test
.subdir('work1', 'work2', 'work3', 'work4')
47 \documentclass{article}
50 As stated in \cite{X}, this is a bug-a-boo.
52 \bibliographystyle{plain}
57 \documentclass{article}
60 % \bibliography{fooref}
61 % \bibliographystyle{plain}
66 \documentclass{article}
67 \usepackage{longtable}
70 As stated in the last paper, this is a bug-a-boo.
71 here is some more junk and another table
72 here is some more junk and another table
74 \begin{longtable}[l]{rlll}
75 Isotope &\multicolumn{1}{c}{Abar} &Name\\
77 1001 &1.0078 &Proton &$p$\\
78 1002 &2.0141 &Deuterium &$d$\\
79 1003 &3.0170 &Tritium &$t$\\
80 2003 &3.0160 &Helium 3 &He$^3$\\
81 2004 &4.0026 &Helium 4 &He$^{4}$\\
86 These parameters and arrays are filled in when the parameter \textbf{iftnrates}
89 \begin{longtable}[l]{ll}
91 \textbf{nxxxx} &Total number of particles made by xxxx reaction\\
92 \textbf{pxxxx} &Total number of particles made by xxxx reaction\\
93 \textbf{nxxxxx} &Total number of particles made by xxxxx reaction\\
94 \textbf{nxxxx} &Total number of particles made by xxxx reaction\\
95 \textbf{pxxxx} &Total number of particles made by xxxx reaction\\
96 \textbf{nxxxx} &Total number of particles made by xxxx reaction\\
97 \textbf{pxxxx} &Total number of particles made by xxxx reaction\\
98 \textbf{nxxxxx} &Total number of particles made by xxxxx reaction\\
99 \textbf{nxxxx} &Total number of particles made by xxxx reaction\\
100 \textbf{pxxxx} &Total number of particles made by xxxx reaction\\
102 \textbf{rnxxxx} &Regional total of particles made by xxxx reaction\\
103 \textbf{rpxxxx} &Regional total of particles made by xxxx reaction\\
104 \textbf{rnxxxxx} &Regional total of particles made by xxxxx reaction\\
105 \textbf{rnxxxx} &Regional total of particles made by xxxx reaction\\
106 \textbf{rpxxxx} &Regional total of particles made by xxxx reaction\\
107 \textbf{rnxxxx} &Regional total of particles made by xxxx reaction\\
108 \textbf{rpxxxx} &Regional total of particles made by xxxx reaction\\
109 \textbf{rnxxxxx} &Regional total of particles made by xxxxx reaction\\
110 \textbf{rnxxxx} &Regional total of particles made by xxxx reaction\\
111 \textbf{rpxxxx} &Regional total of particles made by xxxx reaction\\
113 \textbf{reactot}(r) &Total number of reactions for reaction r\\
114 \textbf{reacreg}(r,ir) &Total number of reactions for reaction r in region ir\\
124 title = "A determination of bug-a-boo-ness",
125 journal = "Journal of B.a.B.",
132 # TODO: check is useless: we already bailed at top if tex not found.
133 # Should we split test into plain and -live instead?
136 test
.write(['work1', 'SConstruct'], """\
138 env = Environment(tools = ['pdftex', 'dvipdf', 'tex', 'latex'])
143 test
.write(['work1', 'foo.tex'], input_file
)
144 test
.write(['work1', 'fooref.bib'], bibfile
)
146 test
.run(chdir
= 'work1', arguments
= '.')
148 test
.must_exist(['work1', 'foo.bbl'])
150 foo_log
= test
.read(['work1', 'foo.log'], mode
='r')
151 test
.must_not_contain_any_line(foo_log
, ['undefined references'], 'foo.log')
153 test
.write(['work3', 'SConstruct'], """\
155 env = Environment(tools = ['tex', 'latex'],
156 ENV = {'PATH' : os.environ['PATH']})
157 env.DVI( "foo3.tex" )
160 test
.write(['work3', 'foo3.tex'], input_file3
)
162 test
.run(chdir
= 'work3', arguments
= '.')
164 foo_log
= test
.read(['work3', 'foo3.log'], mode
='r')
165 test
.must_not_contain_any_line(foo_log
, ['Rerun LaTeX'], 'foo3.log')
169 # TODO: split this test? this check is useless after skip above
172 test
.write(['work2', 'SConstruct'], """\
174 env = Environment(tools = ['dvi', 'pdf', 'pdftex', 'dvipdf', 'pdflatex', 'tex', 'latex'],
175 ENV = {'PATH' : os.environ['PATH']})
180 test
.write(['work2', 'foo.ltx'], input_file
)
181 test
.write(['work2', 'fooref.bib'], bibfile
)
183 test
.run(chdir
= 'work2', arguments
= '.')
185 test
.must_exist(['work2', 'foo.bbl'])
187 foo_log
= test
.read(['work2', 'foo.log'], mode
='r')
188 test
.must_not_contain_any_line(foo_log
, ['undefined references'], 'foo.log')
190 test
.write(['work3', 'SConstruct'], """\
192 env = Environment(tools = ['pdftex', 'dvipdf', 'tex', 'latex'],
193 ENV = {'PATH' : os.environ['PATH']})
194 env.DVI( "foo3.tex" )
195 env.PDF( "foo3.tex" )
198 test
.write(['work3', 'foo3.tex'], input_file3
)
200 test
.run(chdir
= 'work3', arguments
= '.')
202 foo_log
= test
.read(['work3', 'foo3.log'], mode
='r')
203 test
.must_not_contain_any_line(foo_log
, ['Rerun LaTeX'], 'foo3.log')
206 test
.write(['work4', 'SConstruct'], """\
208 env = Environment(tools = ['tex', 'latex'],
209 ENV = {'PATH' : os.environ['PATH']})
212 test
.write(['work4', 'foo.ltx'], input_file2
)
214 test
.run(chdir
= 'work4', arguments
= '.')
216 test
.up_to_date(chdir
= 'work4', arguments
= '.')
223 # indent-tabs-mode:nil
225 # vim: set expandtab tabstop=4 shiftwidth=4: