diff options
author | Mats Wichmann <mats@linux.com> | 2024-06-25 14:08:56 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2024-07-06 12:16:55 (GMT) |
commit | 9fc18579b415b39cfb69e8af80551f9a5f83d2f0 (patch) | |
tree | aecbf1b5e06609b0f008d98689777dbda145f1ee /testing | |
parent | b51ea227d892c073b06f68d178972e75de20364e (diff) | |
download | SCons-9fc18579b415b39cfb69e8af80551f9a5f83d2f0.zip SCons-9fc18579b415b39cfb69e8af80551f9a5f83d2f0.tar.gz SCons-9fc18579b415b39cfb69e8af80551f9a5f83d2f0.tar.bz2 |
Some minor test tweaking
Don't """code block""" % locals() if there's not actually a substitution
in the code block. While there, fix any old-style file headers,
and add a DefaultEnvironment call if not present.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'testing')
-rw-r--r-- | testing/framework/TestCommonTests.py | 12 | ||||
-rw-r--r-- | testing/framework/TestSCons.py | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/testing/framework/TestCommonTests.py b/testing/framework/TestCommonTests.py index 31e13e9..014a018 100644 --- a/testing/framework/TestCommonTests.py +++ b/testing/framework/TestCommonTests.py @@ -762,7 +762,7 @@ class must_contain_exactly_lines_TestCase(TestCommonTestCase): 'www' 'zzz' Extra output =================================================================== - """ % globals()) + """) run_env.run(program=sys.executable, stdin=script) stdout = run_env.stdout() @@ -848,7 +848,7 @@ class must_contain_exactly_lines_TestCase(TestCommonTestCase): 'www' 'zzz' Extra STDOUT =================================================================== - """ % globals()) + """) run_env.run(program=sys.executable, stdin=script) stdout = run_env.stdout() @@ -2234,10 +2234,14 @@ TypeError: forced TypeError self.run_execution_test(script, "", "") def test_signal_handling(self) -> None: - """Test run(): signal handling""" + """Test run(): signal handling. + Only strange platforms unlikely to support SCons like the + webassembly ones don't support kill(), but keep the test + in place anyway. + """ try: - os.kill + _ = os.kill except AttributeError: sys.stderr.write('can not test, no os.kill ... ') return diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index 2b40a36..e0b4537 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -426,12 +426,12 @@ class TestSCons(TestCommon): Makes a complete message to match against. Args: - read_str: the message for the execution part of the output. + build_str: the message for the execution part of the output. If non-empty, needs to be newline-terminated. read_str: the message for the reading-sconscript part of the output. If non-empty, needs to be newline-terminated. error: if true, expect a fail message rather than a done message. - cleaning (int): index into type messages, if 0 selects + cleaning: index into type messages, if 0 selects build messages, if 1 selects clean messages. """ cap, lc = [('Build', 'build'), |