From d6817c0ae7670902f11ccd47f5923b9d34e8a469 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Tue, 29 Nov 2022 13:31:04 -0700 Subject: Fix interpreter usage in another FW test [skip appveyor] Signed-off-by: Mats Wichmann --- CHANGES.txt | 4 ++++ testing/framework/TestCmdTests.py | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index d13ee27..7a7b3b6 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -69,6 +69,10 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER so maybe this helps a bit. - Remove an extra existence check in one ninja test that caused it to be skipped on some otherwise-valid Windows installations. + - test framework tests now pass on Linux and Windows (the latter can + still run into problems on some configurations), and automated + tests are now run on changes in this area so future problems can + be spotted. From Andrew Morrow diff --git a/testing/framework/TestCmdTests.py b/testing/framework/TestCmdTests.py index 7dd2c88..0a1fa26 100644 --- a/testing/framework/TestCmdTests.py +++ b/testing/framework/TestCmdTests.py @@ -40,6 +40,7 @@ from SCons.Util import to_bytes, to_str sys.path = sys.path[1:] import TestCmd +from TestCmd import _python_ def _is_readable(path): # XXX this doesn't take into account UID, it assumes it's our file @@ -95,9 +96,9 @@ class TestCmdTestCase(unittest.TestCase): textx = fmt % (t.scriptx, t.scriptx) if sys.platform == 'win32': textx = textx.replace('%', '%%') - textx = f"@python -c \"{textx}\" %1 %2 %3 %4 %5 %6 %7 %8 %9\n" + textx = f"@{_python_} -c \"{textx}\" %1 %2 %3 %4 %5 %6 %7 %8 %9\n" else: - textx = f"#! /usr/bin/env python\n{textx}\n" + textx = f"#!{_python_}\n{textx}\n" text1 = f"A first line to be ignored!\n{fmt % (t.script1, t.script1)}" textout = fmtout % t.scriptout texterr = fmterr % t.scripterr -- cgit v0.12