diff options
author | Mats Wichmann <mats@linux.com> | 2019-01-24 01:26:46 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2020-01-11 18:21:26 (GMT) |
commit | 3247b7e825c78eae110651d363d0bfd36d0e1081 (patch) | |
tree | b95c00a31d54071053fd1ec582ee138cfe1c39a6 /test/DVIPS | |
parent | 9340ef85fea770d01d416ac2dbc2f4991a67e027 (diff) | |
download | SCons-3247b7e825c78eae110651d363d0bfd36d0e1081.zip SCons-3247b7e825c78eae110651d363d0bfd36d0e1081.tar.gz SCons-3247b7e825c78eae110651d363d0bfd36d0e1081.tar.bz2 |
Align way TeX and related tool names reported by tests
Two concrete changes:
DVIPS/DVIPS test ran only if dvips tool is found, but did not leave
any message if not. Print a skip message if tool not found, which
also lets us dedent the rest of the test for the case where we
continue due to having found it.
TEX/variant_dir test did not check for dvipdf tool, but then calls
the tool. Add a check so we get a skip message instead of a fail
(the fail had lots of lines but it hard to see actual reason).
Fix one test which failed for me due to not checking for its tool.
For the rest, align "Could not find" messages to quote the tool name,
which most of the tests do - so this is just stylistic, has no
functional effect. Also stylistic: use any/all for checking
multiple tools' existence.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'test/DVIPS')
-rw-r--r-- | test/DVIPS/DVIPS.py | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/test/DVIPS/DVIPS.py b/test/DVIPS/DVIPS.py index 27e89ba..df7811a 100644 --- a/test/DVIPS/DVIPS.py +++ b/test/DVIPS/DVIPS.py @@ -116,13 +116,13 @@ test.must_match('test4.ps', "This is a .latex test.\n", mode='r') have_latex = test.where_is('latex') if not have_latex: - test.skip_test('Could not find latex; skipping test(s).\n') + test.skip_test("Could not find 'latex'; skipping test(s).\n") dvips = test.where_is('dvips') +if not dvips: + test.skip_test("Could not find 'dvips'; skipping test(s).\n") -if dvips: - - test.write("wrapper.py", """ +test.write("wrapper.py", """ import os import sys cmd = " ".join(sys.argv[1:]) @@ -130,7 +130,7 @@ open('%s', 'a').write("%%s\\n" %% cmd) os.system(cmd) """ % test.workpath('wrapper.out').replace('\\', '\\\\')) - test.write('SConstruct', """ +test.write('SConstruct', """ import os ENV = { 'PATH' : os.environ['PATH'] } foo = Environment(ENV = ENV) @@ -142,41 +142,41 @@ bar.PostScript(target = 'bar2', source = 'bar2.ltx') bar.PostScript(target = 'bar3', source = 'bar3.latex') """ % locals()) - tex = r""" +tex = r""" This is the %s TeX file. \end """ - latex = r""" +latex = r""" \documentclass{letter} \begin{document} This is the %s LaTeX file. \end{document} """ - test.write('foo.tex', tex % 'foo.tex') - test.write('bar1.tex', tex % 'bar1.tex') - test.write('bar2.ltx', latex % 'bar2.ltx') - test.write('bar3.latex', latex % 'bar3.latex') +test.write('foo.tex', tex % 'foo.tex') +test.write('bar1.tex', tex % 'bar1.tex') +test.write('bar2.ltx', latex % 'bar2.ltx') +test.write('bar3.latex', latex % 'bar3.latex') - test.run(arguments = 'foo.dvi', stderr = None) +test.run(arguments = 'foo.dvi', stderr = None) - test.must_not_exist(test.workpath('wrapper.out')) +test.must_not_exist(test.workpath('wrapper.out')) - test.must_exist(test.workpath('foo.dvi')) +test.must_exist(test.workpath('foo.dvi')) - test.run(arguments = 'bar1.ps bar2.ps bar3.ps', stderr = None) +test.run(arguments = 'bar1.ps bar2.ps bar3.ps', stderr = None) - expect = """dvips -o bar1.ps bar1.dvi +expect = """dvips -o bar1.ps bar1.dvi dvips -o bar2.ps bar2.dvi dvips -o bar3.ps bar3.dvi """ - test.must_match('wrapper.out', expect, mode='r') +test.must_match('wrapper.out', expect, mode='r') - test.must_exist(test.workpath('bar1.ps')) - test.must_exist(test.workpath('bar2.ps')) - test.must_exist(test.workpath('bar3.ps')) +test.must_exist(test.workpath('bar1.ps')) +test.must_exist(test.workpath('bar2.ps')) +test.must_exist(test.workpath('bar3.ps')) test.pass_test() |