summaryrefslogtreecommitdiff
path: root/test/TEX
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2010-06-15 17:01:27 +0000
committerSteven Knight <knight@baldmt.com>2010-06-15 17:01:27 +0000
commitc24d3ebbe70d64a0e3a9663e04e2ecf3333ec961 (patch)
tree64467db0c059aa39aaf6f44dfa207394865947b1 /test/TEX
parentaf8c91d0d187c69bcbc126b0e0ddc3c9a1039014 (diff)
downloadscons-c24d3ebbe70d64a0e3a9663e04e2ecf3333ec961.tar.gz
Merged revisions 4727-4729,4731-4938,4940-5028 via svnmerge from
http://scons.tigris.org/svn/scons/branches/pending ........ r4942 | stevenknight | 2010-06-03 12:41:20 -0700 (Thu, 03 Jun 2010) | 13 lines Isseu 2641: Latest drop of the TestCmd infrastructure, v. 1.3, including: * Support for test timeouts. * Ability to set separate match_stdout and match_stderr functions. * Ability to set separate diff_stdout and diff_stderr functions. * Static methods for the various underlying match* and diff* functionality. * Ability to get at the various match* and diff* functions by attribute name. * Got rid of checks for difflib now that Python 2.3 is the floor (for this infrastructure, anyway). Ripple effects in two test scripts. Added upstream unit test modules (QMTest/Test{Cmd,Common}Tests.py). Added a README.txt file. ........ r4943 | stevenknight | 2010-06-03 13:00:31 -0700 (Thu, 03 Jun 2010) | 2 lines Grab the correct TestCmd files with the updated version number. ........ r4946 | managan | 2010-06-04 09:39:20 -0700 (Fri, 04 Jun 2010) | 4 lines On Windows add a '/D' to the command line so it recognizes drive letters in the source or target file paths ........ r4947 | managan | 2010-06-04 09:51:48 -0700 (Fri, 04 Jun 2010) | 5 lines The scanner was not parsing the dependencies in \includegraphics commands when there was whitespace (including carriage returns) in the command. While we need a better long term fix this covers this concern. ........ r4948 | managan | 2010-06-04 11:13:12 -0700 (Fri, 04 Jun 2010) | 3 lines Dropped an import line that is needed by the last commit of mine for Windows depenedant option on latex command lines ........ r4949 | managan | 2010-06-04 12:27:48 -0700 (Fri, 04 Jun 2010) | 7 lines Some latex packages break up commands where you normally could not by using a comment character at the end of the first line. Our current scanner broke on this and lost some dependecies. While we need general fix, this patch solves this problem ........ r4950 | managan | 2010-06-04 15:51:36 -0700 (Fri, 04 Jun 2010) | 5 lines Tweak how we handle comments within Latex source files when scanning and looking for dependencies. We were adding a space when a comment broke a line and we should not have. ........ r4984 | managan | 2010-06-07 09:37:40 -0700 (Mon, 07 Jun 2010) | 6 lines The multi-line_include-options test failed to check for the existence of latex. Added that so this test is skipped on systems without latex. ........
Diffstat (limited to 'test/TEX')
-rw-r--r--test/TEX/eps_graphics2.py6
-rw-r--r--test/TEX/multi-line_include_options.py90
2 files changed, 94 insertions, 2 deletions
diff --git a/test/TEX/eps_graphics2.py b/test/TEX/eps_graphics2.py
index d291b0b8..d388b692 100644
--- a/test/TEX/eps_graphics2.py
+++ b/test/TEX/eps_graphics2.py
@@ -158,7 +158,9 @@ To get a hard copy of this report call me.
\begin{figure}[htbp]
\begin{center}
-\includegraphics{Fig1}
+\includegraphics
+ [width=.5\textwidth]
+ {Fig1}
\caption{Zone and Node indexing}
\label{fig1}
\end{center}
@@ -170,7 +172,7 @@ All done now.
""")
# makeindex will write status messages to stderr (grrr...), so ignore it.
-test.run(arguments = '.', stderr=None)
+test.run(arguments = 'docs/test.pdf', stderr=None)
# All (?) the files we expect will get created in the docs directory
diff --git a/test/TEX/multi-line_include_options.py b/test/TEX/multi-line_include_options.py
new file mode 100644
index 00000000..7d536dcd
--- /dev/null
+++ b/test/TEX/multi-line_include_options.py
@@ -0,0 +1,90 @@
+#!/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__"
+
+"""
+When an inclusion's optional argument (enclosed in square brackets:
+[]) spans multiple lines (via comment wrapping), ensure that the LaTeX
+Scanner doesn't throw an IndexError.
+
+An example of this in the wild is in Thomas Heim's epsdice LaTeX package:
+ \includegraphics[height=1.75ex,viewport= 3 4 38 39,%
+ clip=true]{\dicefile}%
+In epsdice 2007/02/15, v. 2.1.
+"""
+
+import TestSCons
+
+_exe = TestSCons._exe
+
+test = TestSCons.TestSCons()
+
+latex = test.where_is('latex')
+
+if not latex:
+ test.skip_test("Could not find latex; skipping test(s).\n")
+
+test.write('SConstruct', """\
+import os
+env = Environment(ENV = { 'PATH' : os.environ['PATH'] })
+env.DVI('root.tex')
+""")
+
+test.write('root.tex',
+r"""\documentclass{article}
+\usepackage{graphicx}
+\begin{document}
+ \includegraphics[height=1.75ex,%
+ clip=true]{square}
+\end{document}
+""")
+
+# Dummy EPS file drawing a square
+test.write('square.eps',
+r"""%!PS-Adobe-2.0 EPSF-1.2
+%%BoundingBox: 0 0 20 20
+ newpath
+ 5 5 moveto
+ 15 5 lineto
+ 15 15 lineto
+ 5 15 lineto
+ 5 5 lineto
+ stroke
+%%EOF
+""")
+
+test.run(arguments = '.')
+
+test.must_exist(test.workpath('root.dvi'))
+test.must_exist(test.workpath('root.log'))
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
+