Add test/TEX/multi-line_include_options.py
[scons.git] / test / TEX / multi-line_include_options.py
1 #!/usr/bin/env python
2 #
3 # __COPYRIGHT__
4 #
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:
12 #
13 # The above copyright notice and this permission notice shall be included
14 # in all copies or substantial portions of the Software.
15 #
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.
23 #
24
25 __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
26
27 """
28 This is an obscure test case. When
29   1) a file without a suffix is included in a TeX build and
30   2) there is a directory with the same name as that file,
31 verify that a TypeError is not thrown upon trying to recursively scan
32 the contents of includes. The TypeError indicates that the directory
33 with the same name was trying to be scanned as the include file, which
34 it clearly is not.
35 """
36
37 import TestSCons
38
39 _exe = TestSCons._exe
40
41 test = TestSCons.TestSCons()
42
43 test.write('SConstruct', """\
44 env = Environment()
45 env.DVI('root.tex')
46 """)
47
48 test.write('root.tex',
49 r"""\documentclass{article}
50 \usepackage{graphicx}
51 \begin{document}
52   \includegraphics[height=1.75ex,%
53   clip=true]{square}
54 \end{document}
55 """)
56
57 # Dummy EPS file drawing a square
58 test.write('square.eps',
59 r"""%!PS-Adobe-2.0 EPSF-1.2
60 %%BoundingBox: 0 0 20 20
61  newpath
62   5 5 moveto
63  15 5 lineto
64  15 15 lineto
65  5 15 lineto
66  5  5 lineto
67  stroke
68 %%EOF
69 """)
70
71 test.run(arguments = '.')
72
73 test.must_exist(test.workpath('root.dvi'))
74 test.must_exist(test.workpath('root.log'))
75
76 test.pass_test()
77
78 # Local Variables:
79 # tab-width:4
80 # indent-tabs-mode:nil
81 # End:
82 # vim: set expandtab tabstop=4 shiftwidth=4: