From 8e89a38737281f7618a1284fe9e68eb6bb1fe99d Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 23 Apr 2024 15:29:41 -0700 Subject: tests: rename poorly named function and add report argument The poorly named `print_tool_versions()` doesn't just print the tools versions, it finds them and populates a global table, without which some tests will fail. Rename the function and add a `report` argument so that calls can decide whether they want to have the printed message, because the single runner doesn't in quick mode. --- run_project_tests.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'run_project_tests.py') diff --git a/run_project_tests.py b/run_project_tests.py index a1feecdfc..7551c8da9 100755 --- a/run_project_tests.py +++ b/run_project_tests.py @@ -1513,7 +1513,7 @@ class ToolInfo(T.NamedTuple): regex: T.Pattern match_group: int -def print_tool_versions() -> None: +def detect_tools(report: bool = True) -> None: tools: T.List[ToolInfo] = [ ToolInfo( 'ninja', @@ -1553,6 +1553,11 @@ def print_tool_versions() -> None: return f'{exe} (unknown)' + if not report: + for tool in tools: + get_version(tool) + return + print() print('tools') print() @@ -1646,7 +1651,7 @@ if __name__ == '__main__': print('VSCMD version', os.environ['VSCMD_VER']) setup_commands(options.backend) detect_system_compiler(options) - print_tool_versions() + detect_tools() script_dir = os.path.split(__file__)[0] if script_dir != '': os.chdir(script_dir) -- cgit v1.2.3