From 1dc2f3dd3d1152a498d3c9e286bfa1c16d183854 Mon Sep 17 00:00:00 2001 From: Rob Managan Date: Mon, 4 Jan 2021 15:06:02 -0800 Subject: [PATCH 1/2] Fix case of referencing undefined variable by fixing indentation --- SCons/Tool/tex.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SCons/Tool/tex.py b/SCons/Tool/tex.py index 0ca7e2da4b..b11770d57f 100644 --- a/SCons/Tool/tex.py +++ b/SCons/Tool/tex.py @@ -559,9 +559,9 @@ def is_LaTeX(flist,env,abspath): if srcNode is not None: file_test = is_LaTeX(fileList, env, abspath) - # return on first file that finds latex is needed. - if file_test: - return file_test + # return on first file that finds latex is needed. + if file_test: + return file_test if Verbose: print(" done scanning ",str(f)) From 48b91f5b1c9cad1861146456972f1bd10a12c860 Mon Sep 17 00:00:00 2001 From: Rob Managan Date: Mon, 4 Jan 2021 15:12:19 -0800 Subject: [PATCH 2/2] Place holder for test This currently fails regardless. The Latex scanner need fixing to report that a required file that is input was not found --- test/TEX/missingInput.py | 73 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 test/TEX/missingInput.py diff --git a/test/TEX/missingInput.py b/test/TEX/missingInput.py new file mode 100644 index 0000000000..527b30396b --- /dev/null +++ b/test/TEX/missingInput.py @@ -0,0 +1,73 @@ +#!/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__" + +r""" +Test creation of a LaTeX document that uses \input{filename}. +Check that SCons does not throw an exception when the +file is not found. + + +Test courtesy Rob Managan. +""" + +import TestSCons + +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 = Environment(tools = ['pdflatex', 'pdftex']) + +test = env.PDF(source='test.tex') +""") + +test.write(['test.tex'], +r""" +\input{preamble.tex} + +\begin{document} +\title{The uncountability of SCons features} +\author{Adam Ehlers Nyholm Thomsen} +\maketitle + +\end{document} +""") + +# will write status messages to stderr (grrr...), so ignore it. +test.run(arguments = '.', stderr=None) + +test.pass_test() + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: