summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-11-06 17:03:25 (GMT)
committerSteven Knight <knight@baldmt.com>2005-11-06 17:03:25 (GMT)
commit6100e6fec11023b5ee239b097d240b1cbd32a739 (patch)
treeb4ad541bd0361ccea3b838aa3dc3fa4d71c8438c /test
parent0113b86def554ddcd54b3b9eace409e16bf8a5a7 (diff)
downloadSCons-6100e6fec11023b5ee239b097d240b1cbd32a739.zip
SCons-6100e6fec11023b5ee239b097d240b1cbd32a739.tar.gz
SCons-6100e6fec11023b5ee239b097d240b1cbd32a739.tar.bz2
Correct $SOURCES on TeX command lines. (Sanjoy Mahajan) Add scanning of LaTeX files for implicit dependencies. (August Hörandl) Add support for generating indices from .idx files. (August Hörandl)
Diffstat (limited to 'test')
-rw-r--r--test/TEX/LATEX.py59
1 files changed, 54 insertions, 5 deletions
diff --git a/test/TEX/LATEX.py b/test/TEX/LATEX.py
index 4f19bc1..a9530fc 100644
--- a/test/TEX/LATEX.py
+++ b/test/TEX/LATEX.py
@@ -83,12 +83,19 @@ os.system(string.join(sys.argv[1:], " "))
test.write('SConstruct', """
import os
-ENV = { 'PATH' : os.environ['PATH'] }
+ENV = { 'PATH' : os.environ['PATH'],
+ 'TEXINPUTS' : [ 'subdir', os.environ.get('TEXINPUTS', '') ] }
foo = Environment(ENV = ENV)
latex = foo.Dictionary('LATEX')
-bar = Environment(ENV = ENV, LATEX = r'%s wrapper.py ' + latex)
+makeindex = foo.Dictionary('MAKEINDEX')
+bar = Environment(ENV = ENV,
+ LATEX = r'%s wrapper.py ' + latex,
+ MAKEINDEX = r' wrapper.py ' + makeindex)
foo.DVI(target = 'foo.dvi', source = 'foo.ltx')
bar.DVI(target = 'bar', source = 'bar.latex')
+
+bar.DVI(target = 'makeindex', source = 'makeindex.tex')
+foo.DVI(target = 'latexi', source = 'latexi.tex')
""" % python)
latex = r"""
@@ -98,20 +105,62 @@ This is the %s LaTeX file.
\end{document}
"""
+ makeindex = r"""
+\documentclass{letter}
+\usepackage{makeidx}
+\makeindex
+\begin{document}
+\index{info}
+This is the %s LaTeX file.
+\printindex{}
+\end{document}
+"""
+
+ latex1 = r"""
+\documentclass{letter}
+\usepackage{makeidx}
+\makeindex
+\begin{document}
+\index{info}
+This is the %s LaTeX file.
+
+It has an Index and includes another file.
+\include{latexincludefile}
+\end{document}
+"""
+
+ latex2 = r"""
+\index{include}
+This is the include file.
+\printindex{}
+"""
+
test.write('foo.ltx', latex % 'foo.ltx')
test.write('bar.latex', latex % 'bar.latex')
- test.run(arguments = 'foo.dvi', stderr = None)
+ test.write('makeindex.tex', makeindex % 'makeindex.tex');
+ test.write('makeindex.idx', '');
- test.fail_test(os.path.exists(test.workpath('wrapper.out')))
+ test.subdir('subdir')
+ test.write('latexi.tex', latex1 % 'latexi.tex');
+ test.write([ 'subdir', 'latexincludefile.tex'], latex2)
+ test.run(arguments = 'foo.dvi', stderr = None)
+ test.fail_test(os.path.exists(test.workpath('wrapper.out')))
test.fail_test(not os.path.exists(test.workpath('foo.dvi')))
test.run(arguments = 'bar.dvi', stderr = None)
+ test.fail_test(test.read('wrapper.out') != "wrapper.py\n")
+ test.fail_test(not os.path.exists(test.workpath('bar.dvi')))
+ test.run(arguments = 'makeindex.dvi', stderr = None)
test.fail_test(test.read('wrapper.out') != "wrapper.py\n")
- test.fail_test(not os.path.exists(test.workpath('bar.dvi')))
+ test.run(arguments = 'latexi.dvi', stderr = None)
+ test.fail_test(not os.path.exists(test.workpath('latexi.dvi')))
+ test.fail_test(not os.path.exists(test.workpath('latexi.ind')))
+
+
test.pass_test()