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'])
54 test.write('SConstruct', """\
56 env = Environment(TOOLS = ['tex', 'pdftex'],ENV = {'PATH' : os.environ['PATH']})
58 env.VariantDir('build', 'docs',duplicate=0)
59 env.SConscript('build/SConscript', exports = ['env'])
62 test.write(['docs','SConscript'], """\
65 env.PDF( 'sub/x.tex' )
66 env.DVI( 'sub/x.tex' )
69 test.write(['docs','sub', 'x.tex'],
70 r"""\documentclass{article}
81 test.write(['docs','sub', 'y.tex'], """\
85 #test.run(arguments = '.')
86 test.run(arguments = '.', stderr=None, stdout=None)
88 test.must_exist(['build', 'sub', 'x.aux'])
89 test.must_exist(['build', 'sub', 'x.dvi'])
90 test.must_exist(['build', 'sub', 'x.idx'])
91 test.must_exist(['build', 'sub', 'x.ilg'])
92 test.must_exist(['build', 'sub', 'x.ind'])
93 test.must_exist(['build', 'sub', 'x.log'])
94 test.must_exist(['build', 'sub', 'x.pdf'])
96 test.must_not_exist('x.aux')
97 test.must_not_exist('x.dvi')
98 test.must_not_exist('x.idx')
99 test.must_not_exist('x.ilg')
100 test.must_not_exist('x.ind')
101 test.must_not_exist('x.log')
102 test.must_not_exist('x.pdf')
104 test.must_not_exist(['docs', 'x.aux'])
105 test.must_not_exist(['docs', 'x.dvi'])
106 test.must_not_exist(['docs', 'x.idx'])
107 test.must_not_exist(['docs', 'x.ilg'])
108 test.must_not_exist(['docs', 'x.ind'])
109 test.must_not_exist(['docs', 'x.log'])
110 test.must_not_exist(['docs', 'x.pdf'])
112 test.must_not_exist(['docs', 'sub', 'x.aux'])
113 test.must_not_exist(['docs', 'sub', 'x.dvi'])
114 test.must_not_exist(['docs', 'sub', 'x.idx'])
115 test.must_not_exist(['docs', 'sub', 'x.ilg'])
116 test.must_not_exist(['docs', 'sub', 'x.ind'])
117 test.must_not_exist(['docs', 'sub', 'x.log'])
118 test.must_not_exist(['docs', 'sub', 'x.pdf'])
120 test.up_to_date(arguments = '.', stderr=None, stdout=None)
122 test.write(['docs','sub', 'y.tex'], """\
126 test.not_up_to_date(arguments = '.')
127 #test.up_to_date(arguments = '.', stderr=None, stdout=None)
133 # indent-tabs-mode:nil
135 # vim: set expandtab tabstop=4 shiftwidth=4: