Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor scripts to use config.py instead of config.pl #178

Merged
merged 2 commits into from
Nov 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions resources/windows/windows_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Historical note: we need this script to run with all maintained branches, not just the latest. The last supported branch of Mbed TLS that had only config.pl and not config.py was 2.16. The oldest still-supported branch is 2.28, and it has config.py. Therefore it's ok to remove support for branches that don't have config.py.

self.python_command = "python"

def this_version_forbids_c99(self, path):
# If CMakeLists.txt contains -Wdeclaration-after-statement,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down