From 30b2f77f6728976ffda5c1e3249acef465cd19e9 Mon Sep 17 00:00:00 2001 From: Harry Ramsey Date: Mon, 7 Oct 2024 10:30:27 +0100 Subject: [PATCH 1/2] Refactor scripts to use config.py instead of config.pl This commit refactors Windows testing scripts to use config.py instead of config.pl because config.pl is being removed from the Mbed TLS repository. Signed-off-by: Harry Ramsey --- resources/windows/windows_testing.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/windows/windows_testing.py b/resources/windows/windows_testing.py index c24739b49..9be25de01 100644 --- a/resources/windows/windows_testing.py +++ b/resources/windows/windows_testing.py @@ -163,11 +163,11 @@ def __init__(self, self.selftest_success_pattern = "\[ All tests (PASS|passed) \]" self.test_suites_success_pattern = "100% tests passed, 0 tests failed" self.mingw_success_pattern = "PASSED \(\d+ suites, \d+ tests run\)" - self.config_pl_location = os.path.join("scripts", "config.pl") + self.config_py_location = os.path.join("scripts", "config.py") self.selftest_exe = "selftest.exe" self.mingw_command = "mingw32-make" self.git_command = "git" - self.perl_command = "perl" + self.python_command = "python.exe" def this_version_forbids_c99(self, path): # If CMakeLists.txt contains -Wdeclaration-after-statement, @@ -259,11 +259,11 @@ def set_config_on_code(self, git_worktree_path, logger): """Enables all config specified in config.pl, then disables config based on the version being tested.""" logger.info("Enabling as much of {} as possible".format( - self.config_pl_location + self.config_py_location )) try: enable_output = subprocess.run( - [self.perl_command, self.config_pl_location, "full"], + [self.python_command, self.config_py_location, "full"], cwd=git_worktree_path, encoding=sys.stdout.encoding, stdout=subprocess.PIPE, @@ -273,7 +273,7 @@ def set_config_on_code(self, git_worktree_path, logger): logger.info(enable_output.stdout) for option in self.config_to_disable: disable_output = subprocess.run( - [self.perl_command, self.config_pl_location, + [self.python_command, self.config_py_location, "unset", option], cwd=git_worktree_path, encoding=sys.stdout.encoding, From 8e4283c9455b7f9f2c533a75dada895e582c346c Mon Sep 17 00:00:00 2001 From: Harry Ramsey Date: Mon, 18 Nov 2024 13:07:21 +0000 Subject: [PATCH 2/2] Replace python.exe with python This commit replaces python.exe with python to run python scripts. Signed-off-by: Harry Ramsey --- resources/windows/windows_testing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/windows/windows_testing.py b/resources/windows/windows_testing.py index 9be25de01..3b815b737 100644 --- a/resources/windows/windows_testing.py +++ b/resources/windows/windows_testing.py @@ -167,7 +167,7 @@ def __init__(self, self.selftest_exe = "selftest.exe" self.mingw_command = "mingw32-make" self.git_command = "git" - self.python_command = "python.exe" + self.python_command = "python" def this_version_forbids_c99(self, path): # If CMakeLists.txt contains -Wdeclaration-after-statement,