5 # Permission is hereby granted, free of charge, to any person obtaining
6 # a copy of this software and associated documentation files (the
7 # "Software"), to deal in the Software without restriction, including
8 # without limitation the rights to use, copy, modify, merge, publish,
9 # distribute, sublicense, and/or sell copies of the Software, and to
10 # permit persons to whom the Software is furnished to do so, subject to
11 # the following conditions:
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
17 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
18 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
28 Verify that we execute TeX in a subdirectory (if that's where the document
29 resides) by checking that all the auxiliary files get created there and
30 not in the top-level directory. Test this when variantDir is used
32 Also check that we find files
34 Test case courtesy Joel B. Mohler.
39 test = TestSCons.TestSCons()
43 latex = test.where_is('latex')
45 test.skip_test("Could not find 'latex'; skipping test.\n")
47 pdflatex = test.where_is('pdflatex')
49 test.skip_test("Could not find 'pdflatex'; skipping test.\n")
52 test.subdir(['docs','sub'])
53 test.subdir(['docs','sub','sub2'])
55 test.write('SConstruct', """\
57 env = Environment(TOOLS = ['tex', 'pdftex'],ENV = {'PATH' : os.environ['PATH']})
59 env.VariantDir('build', 'docs',duplicate=0)
60 env.SConscript('build/SConscript', exports = ['env'])
63 test.write(['docs','SConscript'], """\
66 env.PDF( 'sub/x.tex' )
67 env.DVI( 'sub/x.tex' )
70 test.write(['docs','sub', 'x.tex'],
71 r"""\documentclass{article}
82 test.write(['docs','sub','sub2','y.tex'], """\
86 #test.run(arguments = '.')
87 test.run(arguments = '.', stderr=None, stdout=None)
89 test.must_exist(['build', 'sub', 'x.aux'])
90 test.must_exist(['build', 'sub', 'x.dvi'])
91 test.must_exist(['build', 'sub', 'x.fls'])
92 test.must_exist(['build', 'sub', 'x.idx'])
93 test.must_exist(['build', 'sub', 'x.ilg'])
94 test.must_exist(['build', 'sub', 'x.ind'])
95 test.must_exist(['build', 'sub', 'x.log'])
96 test.must_exist(['build', 'sub', 'x.pdf'])
98 test.must_exist(['build', 'sub', 'sub2', 'y.aux'])
100 test.must_not_exist('x.aux')
101 test.must_not_exist('x.dvi')
102 test.must_not_exist('x.idx')
103 test.must_not_exist('x.ilg')
104 test.must_not_exist('x.ind')
105 test.must_not_exist('x.log')
106 test.must_not_exist('x.pdf')
108 test.must_not_exist(['docs', 'x.aux'])
109 test.must_not_exist(['docs', 'x.dvi'])
110 test.must_not_exist(['docs', 'x.idx'])
111 test.must_not_exist(['docs', 'x.ilg'])
112 test.must_not_exist(['docs', 'x.ind'])
113 test.must_not_exist(['docs', 'x.log'])
114 test.must_not_exist(['docs', 'x.pdf'])
116 test.must_not_exist(['docs', 'sub', 'x.aux'])
117 test.must_not_exist(['docs', 'sub', 'x.dvi'])
118 test.must_not_exist(['docs', 'sub', 'x.idx'])
119 test.must_not_exist(['docs', 'sub', 'x.ilg'])
120 test.must_not_exist(['docs', 'sub', 'x.ind'])
121 test.must_not_exist(['docs', 'sub', 'x.log'])
122 test.must_not_exist(['docs', 'sub', 'x.pdf'])
124 test.must_not_exist(['docs', 'sub', 'sub2', 'y.aux'])
126 test.up_to_date(arguments = '.', stderr=None, stdout=None)
128 test.write(['docs','sub', 'sub2', 'y.tex'], """\
132 test.not_up_to_date(arguments = '.')
133 #test.up_to_date(arguments = '.', stderr=None, stdout=None)
139 # indent-tabs-mode:nil
141 # vim: set expandtab tabstop=4 shiftwidth=4: