summaryrefslogtreecommitdiffstats
path: root/test/TEX/dryrun.py
diff options
context:
space:
mode:
authorRobert Managan <managan1@llnl.gov>2008-09-04 18:05:49 (GMT)
committerRobert Managan <managan1@llnl.gov>2008-09-04 18:05:49 (GMT)
commit6a4d9df86030463c35d40e1a314721eb546fb84e (patch)
tree5fcab134f7685c3c589cd2b701d811b6cbc12131 /test/TEX/dryrun.py
parent43528ea6633d5d0d2005de38298b45d631642436 (diff)
downloadSCons-6a4d9df86030463c35d40e1a314721eb546fb84e.zip
SCons-6a4d9df86030463c35d40e1a314721eb546fb84e.tar.gz
SCons-6a4d9df86030463c35d40e1a314721eb546fb84e.tar.bz2
Added a strfunction to the various tex builders. Since the sub-actions report
their commands as they build the strfunction only returns a string for GetOption("no_exec") which covers --dry-run. Therefore --dry-run now gets output, the first command to be run plus " ..." to indicate that the ral builder may repeat or run bibtex, makeindex,... Also updating the flags to pass -interaction=nonstopmode This prevents errors in the .tex files from stopping the build while Latex asks for input. Updated several tests to handle this new flag by switching to getopt module
Diffstat (limited to 'test/TEX/dryrun.py')
-rw-r--r--test/TEX/dryrun.py67
1 files changed, 67 insertions, 0 deletions
diff --git a/test/TEX/dryrun.py b/test/TEX/dryrun.py
new file mode 100644
index 0000000..80458af
--- /dev/null
+++ b/test/TEX/dryrun.py
@@ -0,0 +1,67 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Validate that we can set the LATEX string to our own utility, that
+the produced .dvi, .aux and .log files get removed by the -c option,
+and that we can use this to wrap calls to the real latex utility.
+"""
+
+import os
+import os.path
+import string
+import sys
+import TestSCons
+
+_python_ = TestSCons._python_
+
+test = TestSCons.TestSCons()
+
+latex = test.where_is('latex')
+
+if not latex:
+ test.skip_test('could not find latex; skipping test\n')
+
+test.write('SConstruct', """
+import os
+ENV = { 'PATH' : os.environ['PATH'] }
+foo = Environment(ENV = ENV)
+foo.DVI(target = 'foo.dvi', source = 'foo.ltx')
+""" % locals())
+
+test.write('foo.ltx', r"""
+\documentclass{letter}
+\begin{document}
+This is the foo.ltx file.
+\end{document}
+""")
+
+test.run(arguments = '--dry-run', stdout = test.wrap_stdout("""\
+cd . && latex -interaction=nonstopmode foo.ltx ...
+"""), stderr = None)
+
+
+test.pass_test()