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
31 Add use of \include and \includegraphics from within the included file
33 Also check that we find files
35 Test case courtesy Joel B. Mohler.
40 test = TestSCons.TestSCons()
44 latex = test.where_is('latex')
46 test.skip_test("Could not find 'latex'; skipping test.\n")
48 pdflatex = test.where_is('pdflatex')
50 test.skip_test("Could not find 'pdflatex'; skipping test.\n")
53 test.subdir(['docs','content'])
54 test.subdir(['docs','fig'])
56 test.write('SConstruct', """\
58 env = Environment(TOOLS = ['tex', 'pdftex'],ENV = {'PATH' : os.environ['PATH']})
60 env.VariantDir('build', 'docs', duplicate=0)
61 graph = env.PDF('build/fig/graph.eps')
62 pdf = env.PDF('build/main.tex')
66 test.write(['docs','main.tex'],
67 r"""\documentclass{article}
74 \include{content/chapter}
79 test.write(['docs','content','chapter.tex'], """\
81 \input{content/subchap}
85 test.write(['docs','content','subchap.tex'], """\
90 test.write(['docs','fig','graph.eps'], """\
91 %!PS-Adobe-2.0 EPSF-2.0
93 %%Creator: fig2dev Version 3.2 Patchlevel 4
94 %%CreationDate: Tue Apr 25 09:56:11 2006
95 %%For: managan@mangrove.llnl.gov (Rob Managan)
96 %%BoundingBox: 0 0 98 98
97 %%Magnification: 1.0000
99 /$F2psDict 200 dict def
101 $F2psDict /mtrx matrix put
102 /col-1 {0 setgray} bind def
103 /col0 {0.000 0.000 0.000 srgb} bind def
107 newpath 0 98 moveto 0 0 lineto 98 0 lineto 98 98 lineto closepath clip newpath
108 -24.9 108.2 translate
111 /gr {grestore} bind def
113 /rs {restore} bind def
114 /n {newpath} bind def
116 /slw {setlinewidth} bind def
117 /srgb {setrgbcolor} bind def
119 /sf {setfont} bind def
120 /scf {scalefont} bind def
121 /tr {translate} bind def
129 /savematrix mtrx currentmatrix def
130 x y tr xrad yrad sc 0 0 1 startangle endangle arc
135 /$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
136 /$F2psEnd {$F2psEnteredState restore end} def
146 n 1170 945 766 766 0 360 DrawEllipse gs col0 s gr
152 #test.run(arguments = '.')
153 test.run(arguments = '.', stderr=None, stdout=None)
155 test.must_exist(['build', 'main.aux'])
156 test.must_exist(['build', 'main.fls'])
157 test.must_exist(['build', 'main.idx'])
158 test.must_exist(['build', 'main.ilg'])
159 test.must_exist(['build', 'main.ind'])
160 test.must_exist(['build', 'main.log'])
161 test.must_exist(['build', 'main.pdf'])
163 test.must_exist(['build', 'content', 'chapter.aux'])
165 test.must_not_exist('main.aux')
166 test.must_not_exist('main.dvi')
167 test.must_not_exist('main.idx')
168 test.must_not_exist('main.ilg')
169 test.must_not_exist('main.ind')
170 test.must_not_exist('main.log')
171 test.must_not_exist('main.pdf')
173 test.must_not_exist(['docs', 'main.aux'])
174 test.must_not_exist(['docs', 'main.dvi'])
175 test.must_not_exist(['docs', 'main.idx'])
176 test.must_not_exist(['docs', 'main.ilg'])
177 test.must_not_exist(['docs', 'main.ind'])
178 test.must_not_exist(['docs', 'main.log'])
179 test.must_not_exist(['docs', 'main.pdf'])
181 test.must_not_exist(['docs', 'content', 'main.aux'])
182 test.must_not_exist(['docs', 'content', 'main.dvi'])
183 test.must_not_exist(['docs', 'content', 'main.idx'])
184 test.must_not_exist(['docs', 'content', 'main.ilg'])
185 test.must_not_exist(['docs', 'content', 'main.ind'])
186 test.must_not_exist(['docs', 'content', 'main.log'])
187 test.must_not_exist(['docs', 'content', 'main.pdf'])
189 test.must_not_exist(['docs', 'content', 'chapter.aux'])
191 test.up_to_date(arguments = '.', stderr=None, stdout=None)
193 test.write(['docs','content', 'subchap.tex'], """\
197 test.not_up_to_date(arguments = '.')
198 #test.up_to_date(arguments = '.', stderr=None, stdout=None)
204 # indent-tabs-mode:nil
206 # vim: set expandtab tabstop=4 shiftwidth=4: