From 925859f25c29d3491f867577d8e785986789b94f Mon Sep 17 00:00:00 2001 From: Joseph Brill <48932340+jcbrill@users.noreply.github.com> Date: Thu, 21 Sep 2023 20:29:13 -0400 Subject: MSVC: Fix unhandled MissingConfiguration exception. Fix an issue with an unhandled MissingConfiguration exception due to an msvc registry query that returns a path that does not exist. Multiple invocation paths were not prepared to handle the MissingConfiguration exception. The MissingConfiguration exception type was removed. --- CHANGES.txt | 4 ++++ SCons/Tool/MSCommon/vc.py | 10 +--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 287fd18..f087508 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -38,6 +38,10 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER module was refactored. - Add arm64 to the MSVS supported architectures list for VS2017 and later to be consistent with the current documentation of MSVS_ARCH. + - Fix an issue with an unhandled MissingConfiguration exception due to an msvc + registry query that returns a path that does not exist. Multiple invocation + paths were not prepared to handle the MissingConfiguration exception. The + MissingConfiguration exception type was removed. From Vitaly Cheptsov: - Fix race condition in `Mkdir` which can happen when two `SConscript` diff --git a/SCons/Tool/MSCommon/vc.py b/SCons/Tool/MSCommon/vc.py index fd806bd..56d9c38 100644 --- a/SCons/Tool/MSCommon/vc.py +++ b/SCons/Tool/MSCommon/vc.py @@ -89,9 +89,6 @@ class MSVCUseSettingsError(MSVCUserError): class UnsupportedVersion(VisualCException): pass -class MissingConfiguration(VisualCException): - pass - class BatchFileExecutionError(VisualCException): pass @@ -873,9 +870,8 @@ def find_vc_pdir(env, msvc_version): Raises: UnsupportedVersion: if the version is not known by this file. - MissingConfiguration: found version but the directory is missing. - Both exceptions inherit from VisualCException. + UnsupportedVersion inherits from VisualCException. """ root = 'Software\\' @@ -917,7 +913,6 @@ def find_vc_pdir(env, msvc_version): return comps else: debug('reg says dir is %s, but it does not exist. (ignoring)', comps) - raise MissingConfiguration(f"registry dir {comps} not found on the filesystem") return None def find_batch_file(msvc_version, host_arch, target_arch, pdir): @@ -1344,9 +1339,6 @@ def msvc_find_valid_batch_script(env, version): except UnsupportedVersion: # Unsupported msvc version (raise MSVCArgumentError?) pass - except MissingConfiguration: - # Found version, directory missing - pass debug('product directory: version=%s, pdir=%s', version, pdir) # Find the host, target, and all candidate (host, target) platform combinations: -- cgit v0.12 From f65c04aadc679de79e9517a0d0651cddf3d42006 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Fri, 22 Sep 2023 07:33:38 -0600 Subject: Bump dependency versions [skip appveyor] Sphinx ceiling version bumped to 6.x. While it *works* with current Sphinx 7.x, sphinx-book-theme is actually pinned to <7, so to avoid install complaints, leave Sphinx down-rev for now. lxml version pin bumped, and the fence for not installing on Python 3.12 is changed to 3.13 - PyPI packages for 3.12 are up. Update doc/generated/variables.mod as it contains new construction variables from the 4.6 development: all the generated files will be updated at release time, but this allows a build *without* regenerating to not fail. Signed-off-by: Mats Wichmann --- bin/docs-create-example-outputs.py | 6 +++++- bin/docs-update-generated.py | 10 +++++++--- bin/docs-validate.py | 4 ++++ doc/generated/variables.mod | 10 ++++++++++ requirements-dev.txt | 2 +- requirements-pkg.txt | 2 +- 6 files changed, 28 insertions(+), 6 deletions(-) diff --git a/bin/docs-create-example-outputs.py b/bin/docs-create-example-outputs.py index e5d40ce..2df6f90 100644 --- a/bin/docs-create-example-outputs.py +++ b/bin/docs-create-example-outputs.py @@ -1,8 +1,12 @@ #!/usr/bin/env python # +# SPDX-License-Identifier: MIT +# +# Copyright The SCons Foundation +# # Searches through the whole doc/user tree and creates # all output files for the single examples. -# + import os import sys import SConsExamples diff --git a/bin/docs-update-generated.py b/bin/docs-update-generated.py index 9fbd95c..1599617 100644 --- a/bin/docs-update-generated.py +++ b/bin/docs-update-generated.py @@ -1,11 +1,15 @@ #!/usr/bin/env python # +# SPDX-License-Identifier: MIT +# +# Copyright The SCons Foundation +# # Searches through the whole source tree and updates # the generated *.gen/*.mod files in the docs folder, keeping all # documentation for the tools, builders and functions... # as well as the entity declarations for them. # Uses scons-proc.py under the hood... -# + import os import sys import subprocess @@ -63,8 +67,8 @@ def generate_all(): print("Generation failed", file=sys.stderr) return False return True - - + + if __name__ == "__main__": if not generate_all(): sys.exit(1) diff --git a/bin/docs-validate.py b/bin/docs-validate.py index 6d8fd77..06a7906 100644 --- a/bin/docs-validate.py +++ b/bin/docs-validate.py @@ -1,5 +1,9 @@ #!/usr/bin/env python # +# SPDX-License-Identifier: MIT +# +# Copyright The SCons Foundation +# # Searches through the whole source tree and validates all # documentation files against our own XSD in docs/xsd. # diff --git a/doc/generated/variables.mod b/doc/generated/variables.mod index c10e520..c3787ea 100644 --- a/doc/generated/variables.mod +++ b/doc/generated/variables.mod @@ -80,6 +80,10 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $DFLAGPREFIX"> $DFLAGS"> $DFLAGSUFFIX"> +$DI_FILE_DIR"> +$DI_FILE_DIR_PREFIX"> +$DI_FILE_DIR_SUFFFIX"> +$DI_FILE_SUFFIX"> $DINCPREFIX"> $DINCSUFFIX"> $Dir"> @@ -662,6 +666,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $XGETTEXTPATHSUFFIX"> $YACC"> $YACC_GRAPH_FILE"> +$YACC_GRAPH_FILE_SUFFIX"> $YACC_HEADER_FILE"> $YACCCOM"> $YACCCOMSTR"> @@ -756,6 +761,10 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $DFLAGPREFIX"> $DFLAGS"> $DFLAGSUFFIX"> +$DI_FILE_DIR"> +$DI_FILE_DIR_PREFIX"> +$DI_FILE_DIR_SUFFFIX"> +$DI_FILE_SUFFIX"> $DINCPREFIX"> $DINCSUFFIX"> $Dir"> @@ -1338,6 +1347,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $XGETTEXTPATHSUFFIX"> $YACC"> $YACC_GRAPH_FILE"> +$YACC_GRAPH_FILE_SUFFIX"> $YACC_HEADER_FILE"> $YACCCOM"> $YACCCOMSTR"> diff --git a/requirements-dev.txt b/requirements-dev.txt index 82faa28..8a526fe 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,7 +5,7 @@ # for now keep pinning "known working" lxml, # it's been a troublesome component in the past. # Skip lxml for win32 as no tests which require it currently pass on win32 -lxml==4.9.2; python_version < '3.12' and sys_platform != 'win32' +lxml==4.9.3; python_version < '3.13' and sys_platform != 'win32' ninja diff --git a/requirements-pkg.txt b/requirements-pkg.txt index 3fb4aeb..c83375e 100644 --- a/requirements-pkg.txt +++ b/requirements-pkg.txt @@ -8,7 +8,7 @@ readme-renderer # sphinx pinned because it has broken several times on new releases -sphinx < 6.0 +sphinx < 7.0 sphinx-book-theme rst2pdf -- cgit v0.12 From 1b72993de5e119e1a6443d324d039d9f8b390b79 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Fri, 22 Sep 2023 09:09:48 -0600 Subject: TeX tests: skip if no makeindex A number of tests fail if the makeindex command is not installed, as there were not skip checks for them. Added. Also dropped in some TODOs for future work - trying to keep this change to the minimum. Signed-off-by: Mats Wichmann --- CHANGES.txt | 1 + test/DVIPDF/makeindex.py | 13 ++++++++----- test/DVIPS/DVIPS.py | 12 ++++++------ test/TEX/LATEX.py | 17 +++++++++++------ test/TEX/LATEX2.py | 16 +++++++++++----- test/TEX/LATEXFLAGS.py | 9 ++++----- test/TEX/TEX.py | 16 ++++++++-------- test/TEX/TEXFLAGS.py | 9 ++++----- test/TEX/bibliography.py | 14 ++++++-------- test/TEX/glossaries.py | 18 ++++++++++-------- test/TEX/multi-run.py | 12 +++++++----- test/TEX/multiple_include.py | 15 +++++++++------ test/TEX/multiple_include_subdir.py | 15 +++++++++------ test/TEX/newglossary.py | 18 ++++++++++-------- test/TEX/subdir_variantdir_include.py | 13 ++++++++----- test/TEX/subdir_variantdir_include2.py | 13 ++++++++----- test/TEX/subdir_variantdir_input.py | 13 ++++++++----- test/TEX/variant_dir.py | 20 +++++++++++++------- test/TEX/variant_dir_newglossary.py | 19 ++++++++++--------- 19 files changed, 151 insertions(+), 112 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 287fd18..befffca 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -168,6 +168,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER builds. Also add a simple filesystem-based locking protocol to try to avoid the problem occuring. - Update the first two chapters on building with SCons in the User Guide. + - TeX tests: skip tests that use makeindex command when not found. From Jonathon Reinhart: - Fix another instance of `int main()` in CheckLib() causing failures diff --git a/test/DVIPDF/makeindex.py b/test/DVIPDF/makeindex.py index bb44d27..d9ba597 100644 --- a/test/DVIPDF/makeindex.py +++ b/test/DVIPDF/makeindex.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # 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__" import TestSCons @@ -37,11 +36,15 @@ if not dvipdf: tex = test.where_is('tex') if not tex: test.skip_test("Could not find 'tex'; skipping test(s).\n") - + latex = test.where_is('latex') if not latex: test.skip_test("Could not find 'latex'; skipping test(s).\n") +makeindex = test.where_is('makeindex') +if not makeindex: + test.skip_test("Could not find 'makeindex'; skipping test.\n") + diff --git a/test/DVIPS/DVIPS.py b/test/DVIPS/DVIPS.py index 3cfd730..0e688ae 100644 --- a/test/DVIPS/DVIPS.py +++ b/test/DVIPS/DVIPS.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # 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__" import TestSCons @@ -114,8 +113,9 @@ test.must_match('test3.ps', "This is a .ltx test.\n", mode='r') test.must_match('test4.ps', "This is a .latex test.\n", mode='r') -have_latex = test.where_is('latex') -if not have_latex: +# TODO: split this test? Taking a skip here invalidates the above, too +latex = test.where_is('latex') +if not latex: test.skip_test("Could not find 'latex'; skipping test(s).\n") dvips = test.where_is('dvips') diff --git a/test/TEX/LATEX.py b/test/TEX/LATEX.py index 85cc7d8..94d8404 100644 --- a/test/TEX/LATEX.py +++ b/test/TEX/LATEX.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,11 +22,8 @@ # 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""" +""" 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. @@ -38,7 +37,13 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() +latex = test.where_is('latex') +if not latex: + test.skip_test("Could not find 'latex'; skipping test.\n") +makeindex = test.where_is('makeindex') +if not makeindex: + test.skip_test("Could not find 'makeindex'; skipping test.\n") test.write('mylatex.py', r""" import sys @@ -95,8 +100,8 @@ test.must_not_exist('test2.log') +# TODO: split this test? We already bailed above so check is useless. latex = test.where_is('latex') - if latex: test.file_fixture('wrapper.py') diff --git a/test/TEX/LATEX2.py b/test/TEX/LATEX2.py index 1628bb9..6dc5050 100644 --- a/test/TEX/LATEX2.py +++ b/test/TEX/LATEX2.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,11 +22,8 @@ # 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""" +""" Validate that we can produce several .pdf at once from several sources. """ @@ -36,7 +35,14 @@ test = TestSCons.TestSCons() latex = test.where_is('latex') +if not latex: + test.skip_test("Could not find 'latex'; skipping test.\n") + +makeindex = test.where_is('makeindex') +if not makeindex: + test.skip_test("Could not find 'makeindex'; skipping test.\n") +# TODO: reformat, check is now unneeded. if latex: test.write('SConstruct', """ diff --git a/test/TEX/LATEXFLAGS.py b/test/TEX/LATEXFLAGS.py index 5e8b4af..32e41df 100644 --- a/test/TEX/LATEXFLAGS.py +++ b/test/TEX/LATEXFLAGS.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # 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__" import os @@ -75,8 +74,8 @@ test.must_match('test2.dvi', " -t\nThis is a .latex test.\n", mode='r') +# TODO: split this test? Taking a skip here invalidates the above, too latex = test.where_is('latex') - if latex: test.file_fixture('wrapper.py') diff --git a/test/TEX/TEX.py b/test/TEX/TEX.py index 4c4bd87..0688a96 100644 --- a/test/TEX/TEX.py +++ b/test/TEX/TEX.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -21,23 +23,21 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -r""" +""" Validate that we can set the TEX 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. """ -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - import TestSCons _python_ = TestSCons._python_ test = TestSCons.TestSCons() -have_latex = test.where_is('latex') -if not have_latex: - test.skip_test("Could not find 'latex'; skipping test(s).\n") +latex = test.where_is('latex') +if not latex: + test.skip_test("Could not find 'latex'; skipping test.\n") test.write('mytex.py', r""" @@ -82,8 +82,8 @@ test.must_not_exist('test.log') +# TODO: split this test? Taking a skip here invalidates the above, too tex = test.where_is('tex') - if tex: test.file_fixture('wrapper.py') diff --git a/test/TEX/TEXFLAGS.py b/test/TEX/TEXFLAGS.py index 287b537..fe19fec 100644 --- a/test/TEX/TEXFLAGS.py +++ b/test/TEX/TEXFLAGS.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # 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__" import os @@ -68,8 +67,8 @@ test.must_match('test.dvi'," -x\nThis is a test.\n", mode='r') +# TODO: split this test? Taking a skip here invalidates the above, too tex = test.where_is('tex') - if tex: test.file_fixture('wrapper.py') diff --git a/test/TEX/bibliography.py b/test/TEX/bibliography.py index afccf8f..122a0d6 100644 --- a/test/TEX/bibliography.py +++ b/test/TEX/bibliography.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,11 +22,8 @@ # 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""" +""" Validate that use of \bibliography in TeX source files causes SCons to be aware of the necessary created bibliography files. @@ -36,7 +35,6 @@ import TestSCons test = TestSCons.TestSCons() dvips = test.where_is('dvips') - if not dvips: test.skip_test("Could not find 'dvips'; skipping test(s).\n") @@ -44,8 +42,8 @@ bibtex = test.where_is('bibtex') if not bibtex: test.skip_test("Could not find 'bibtex'; skipping test(s).\n") -have_latex = test.where_is('latex') -if not have_latex: +latex = test.where_is('latex') +if not latex: test.skip_test("Could not find 'latex'; skipping test(s).\n") diff --git a/test/TEX/glossaries.py b/test/TEX/glossaries.py index a9fd1dc..069fcc3 100644 --- a/test/TEX/glossaries.py +++ b/test/TEX/glossaries.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,11 +22,8 @@ # 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""" +""" Validate that use of \glossaries in TeX source files causes SCons to be aware of the necessary created glossary files. @@ -38,13 +37,16 @@ import TestSCons test = TestSCons.TestSCons() latex = test.where_is('latex') - if not latex: - test.skip_test("Could not find 'latex'; skipping test(s).\n") + test.skip_test("Could not find 'latex'; skipping test.\n") + +makeindex = test.where_is('makeindex') +if not makeindex: + test.skip_test("Could not find 'makeindex'; skipping test.\n") cp = subprocess.run('kpsewhich glossaries.sty', shell=True) if cp.returncode: - test.skip_test("glossaries.sty not installed; skipping test(s).\n") + test.skip_test("glossaries.sty not installed; skipping test.\n") test.write('SConstruct', """\ import os diff --git a/test/TEX/multi-run.py b/test/TEX/multi-run.py index 3c4e901..29b8f1f 100644 --- a/test/TEX/multi-run.py +++ b/test/TEX/multi-run.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,11 +22,8 @@ # 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""" +""" Validate that both .tex and .ltx files can handle a LaTeX-style bibliography (by calling $BIBTEX to generate a .bbl file) and correctly re-run to resolve undefined references. @@ -130,6 +129,8 @@ bibfile = r""" } """ +# TODO: check is useless: we already bailed at top if tex not found. +# Should we split test into plain and -live instead? if tex: test.write(['work1', 'SConstruct'], """\ @@ -165,6 +166,7 @@ env.DVI( "foo3.tex" ) +# TODO: split this test? this check is useless after skip above if latex: test.write(['work2', 'SConstruct'], """\ diff --git a/test/TEX/multiple_include.py b/test/TEX/multiple_include.py index 76a95e2..8817c94 100644 --- a/test/TEX/multiple_include.py +++ b/test/TEX/multiple_include.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,11 +22,8 @@ # 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 fully-featured TeX document (with bibliography and index) in a variant_dir. @@ -36,13 +35,17 @@ import TestSCons test = TestSCons.TestSCons() latex = test.where_is('latex') -epstopdf = test.where_is('epstopdf') if not latex: test.skip_test("Could not find 'latex'; skipping test.\n") +epstopdf = test.where_is('epstopdf') if not epstopdf: test.skip_test("Could not find 'epstopdf'; skipping test.\n") +makeindex = test.where_is('makeindex') +if not makeindex: + test.skip_test("Could not find 'makeindex'; skipping test.\n") + test.subdir(['docs']) diff --git a/test/TEX/multiple_include_subdir.py b/test/TEX/multiple_include_subdir.py index 589aa06..980a79c 100644 --- a/test/TEX/multiple_include_subdir.py +++ b/test/TEX/multiple_include_subdir.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,11 +22,8 @@ # 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 Tex document with nested includes in a subdir that needs to create a fig.pdf. @@ -36,13 +35,17 @@ import TestSCons test = TestSCons.TestSCons() latex = test.where_is('latex') -epstopdf = test.where_is('epstopdf') if not latex: test.skip_test("Could not find 'latex'; skipping test.\n") +epstopdf = test.where_is('epstopdf') if not epstopdf: test.skip_test("Could not find 'epstopdf'; skipping test.\n") +makeindex = test.where_is('makeindex') +if not makeindex: + test.skip_test("Could not find 'makeindex'; skipping test.\n") + test.subdir(['docs']) diff --git a/test/TEX/newglossary.py b/test/TEX/newglossary.py index e6a8c4b..37e5c26 100644 --- a/test/TEX/newglossary.py +++ b/test/TEX/newglossary.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,11 +22,8 @@ # 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""" +""" Validate that use of \newglossary in TeX source files causes SCons to be aware of the necessary created glossary files. @@ -38,13 +37,16 @@ import TestSCons test = TestSCons.TestSCons() latex = test.where_is('latex') - if not latex: - test.skip_test("Could not find 'latex'; skipping test(s).\n") + test.skip_test("Could not find 'latex'; skipping test.\n") + +makeindex = test.where_is('makeindex') +if not makeindex: + test.skip_test("Could not find 'makeindex'; skipping test.\n") cp = subprocess.run('kpsewhich glossaries.sty', shell=True) if cp.returncode: - test.skip_test("glossaries.sty not installed; skipping test(s).\n") + test.skip_test("glossaries.sty not installed; skipping test.\n") test.write('SConstruct', """\ import os diff --git a/test/TEX/subdir_variantdir_include.py b/test/TEX/subdir_variantdir_include.py index d99d996..784533a 100644 --- a/test/TEX/subdir_variantdir_include.py +++ b/test/TEX/subdir_variantdir_include.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,11 +22,8 @@ # 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""" +""" Verify that we execute TeX in a subdirectory (if that's where the document resides) by checking that all the auxiliary files get created there and not in the top-level directory. Test this when variantDir is used @@ -46,6 +45,10 @@ pdflatex = test.where_is('pdflatex') if not pdflatex: test.skip_test("Could not find 'pdflatex'; skipping test.\n") +makeindex = test.where_is('makeindex') +if not makeindex: + test.skip_test("Could not find 'makeindex'; skipping test.\n") + test.subdir('docs') test.subdir(['docs','sub']) test.subdir(['docs','sub','sub2']) diff --git a/test/TEX/subdir_variantdir_include2.py b/test/TEX/subdir_variantdir_include2.py index 790eb66..953a229 100644 --- a/test/TEX/subdir_variantdir_include2.py +++ b/test/TEX/subdir_variantdir_include2.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,11 +22,8 @@ # 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""" +""" Verify that we execute TeX in a subdirectory (if that's where the document resides) by checking that all the auxiliary files get created there and not in the top-level directory. Test this when variantDir is used @@ -47,6 +46,10 @@ pdflatex = test.where_is('pdflatex') if not pdflatex: test.skip_test("Could not find 'pdflatex'; skipping test.\n") +makeindex = test.where_is('makeindex') +if not makeindex: + test.skip_test("Could not find 'makeindex'; skipping test.\n") + test.subdir('docs') test.subdir(['docs','content']) test.subdir(['docs','fig']) diff --git a/test/TEX/subdir_variantdir_input.py b/test/TEX/subdir_variantdir_input.py index 83c72aa..679434e 100644 --- a/test/TEX/subdir_variantdir_input.py +++ b/test/TEX/subdir_variantdir_input.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,11 +22,8 @@ # 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""" +""" Verify that we execute TeX in a subdirectory (if that's where the document resides) by checking that all the auxiliary files get created there and not in the top-level directory. Test this when variantDir is used @@ -46,6 +45,10 @@ pdflatex = test.where_is('pdflatex') if not pdflatex: test.skip_test("Could not find 'pdflatex'; skipping test.\n") +makeindex = test.where_is('makeindex') +if not makeindex: + test.skip_test("Could not find 'makeindex'; skipping test.\n") + test.subdir('docs') test.subdir(['docs','sub']) diff --git a/test/TEX/variant_dir.py b/test/TEX/variant_dir.py index 9d05863..4280f59 100644 --- a/test/TEX/variant_dir.py +++ b/test/TEX/variant_dir.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,11 +22,8 @@ # 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 fully-featured TeX document (with bibliography and index) in a variant_dir. @@ -36,9 +35,16 @@ import TestSCons test = TestSCons.TestSCons() latex = test.where_is('latex') +if not latex: + test.skip_test("Could not find 'latex'; skipping test.\n") + dvipdf = test.where_is('dvipdf') -if not all((latex, dvipdf)): - test.skip_test("Could not find 'latex' and/or 'dvipdf'; skipping test(s).\n") +if not dvipdf: + test.skip_test("Could not find 'dvipdf'; skipping test.\n") + +makeindex = test.where_is('makeindex') +if not makeindex: + test.skip_test("Could not find 'makeindex'; skipping test.\n") test.subdir(['docs']) diff --git a/test/TEX/variant_dir_newglossary.py b/test/TEX/variant_dir_newglossary.py index ae865aa..30afebc 100644 --- a/test/TEX/variant_dir_newglossary.py +++ b/test/TEX/variant_dir_newglossary.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,11 +22,8 @@ # 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""" +""" Validate the use of \newglossary in TeX source files in conjunction with variant_dir. @@ -38,14 +37,16 @@ import TestSCons test = TestSCons.TestSCons() latex = test.where_is('latex') - if not latex: - test.skip_test("Could not find 'latex'; skipping test(s).\n") + test.skip_test("Could not find 'latex'; skipping test.\n") + +makeindex = test.where_is('makeindex') +if not makeindex: + test.skip_test("Could not find 'makeindex'; skipping test.\n") cp = subprocess.run('kpsewhich glossaries.sty', shell=True) if cp.returncode: - test.skip_test("glossaries.sty not installed; skipping test(s).\n") - + test.skip_test("glossaries.sty not installed; skipping test.\n") test.subdir(['src']) -- cgit v0.12 From b1ffe613ed5cf2eb22b1b8d5a0cbda5c2448e4a8 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Fri, 22 Sep 2023 10:46:12 -0700 Subject: [ci skip] Updated blurb in CHANGES/RELEASE.txt --- CHANGES.txt | 4 +++- RELEASE.txt | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index befffca..5f186c9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -168,7 +168,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER builds. Also add a simple filesystem-based locking protocol to try to avoid the problem occuring. - Update the first two chapters on building with SCons in the User Guide. - - TeX tests: skip tests that use makeindex command when not found. + - TeX tests: skip tests that use makeindex or epstopdf not installed, or + if `kpsewhich glossaries.sty` fails. + From Jonathon Reinhart: - Fix another instance of `int main()` in CheckLib() causing failures diff --git a/RELEASE.txt b/RELEASE.txt index e45284c..258d1c5 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -147,6 +147,8 @@ DEVELOPMENT doesn't use so it can be instantiated by unittests and others. - Added more type annotations to internal routines. - Cleaned up dblite module (checker warnings, etc.). +- TeX tests: skip tests that use makeindex or epstopdf not installed, or + if `kpsewhich glossaries.sty` fails. Thanks to the following contributors listed below for their contributions to this release. ========================================================================================== -- cgit v0.12