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 we can produce several .pdf at once from several sources.
32 _python_
= TestSCons
._python
_
34 test
= TestSCons
.TestSCons()
37 latex
= test
.where_is('latex')
39 test
.skip_test("Could not find 'latex'; skipping test.\n")
41 makeindex
= test
.where_is('makeindex')
43 test
.skip_test("Could not find 'makeindex'; skipping test.\n")
45 # TODO: reformat, check is now unneeded.
48 test
.write('SConstruct', """
51 _ = DefaultEnvironment(tools=[])
53 foo['TEXINPUTS'] = ['subdir',os.environ.get('TEXINPUTS', '')]
54 foo.PDF(source = ['foo.ltx','bar.latex','makeindex.tex','latexi.tex'])
58 \documentclass{letter}
60 This is the %s LaTeX file.
65 \documentclass{report}
70 This is the %s LaTeX file.
76 \documentclass{report}
78 \input{latexinputfile}
81 This is the %s LaTeX file.
83 It has an Index and includes another file.
84 \include{latexincludefile}
94 This is the include file. mod %s
98 test
.write('foo.ltx', latex
% 'foo.ltx')
100 test
.write('bar.latex', latex
% 'bar.latex')
102 test
.write('makeindex.tex', makeindex
% 'makeindex.tex')
103 test
.write('makeindex.idx', '')
105 test
.subdir('subdir')
106 test
.write('latexi.tex', latex1
% 'latexi.tex')
107 test
.write([ 'subdir', 'latexinputfile'], latex2
)
108 test
.write([ 'subdir', 'latexincludefile.tex'], latex3
% '1')
110 test
.run(stderr
= None)
111 test
.must_not_exist('wrapper.out')
112 test
.must_exist('foo.pdf')
114 test
.must_exist('bar.pdf')
116 test
.must_exist('latexi.pdf')
117 test
.must_exist('latexi.ind')
119 test
.write([ 'subdir', 'latexincludefile.tex'], latex3
% '2')
120 test
.not_up_to_date(arguments
= 'latexi.pdf', stderr
= None)
122 test
.run(arguments
= '-c', stderr
= None)
123 test
.must_not_exist('latexi.ind')
124 test
.must_not_exist('latexi.ilg')
131 # indent-tabs-mode:nil
133 # vim: set expandtab tabstop=4 shiftwidth=4: