Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Bugfix/managan/latex scanner #3854

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions SCons/Tool/tex.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
73 changes: 73 additions & 0 deletions test/TEX/missingInput.py
Original file line number Diff line number Diff line change
@@ -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: