aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2024-04-23 15:29:41 -0700
committerEli Schwartz <eschwartz93@gmail.com>2024-07-12 15:37:24 -0400
commit8e89a38737281f7618a1284fe9e68eb6bb1fe99d (patch)
tree77ef080f0361f2c302553d3bb5b87143bf1b08d6
parentf5d66b4932f94fbe78058e617c2d83a454107008 (diff)
downloadmeson-8e89a38737281f7618a1284fe9e68eb6bb1fe99d.zip
meson-8e89a38737281f7618a1284fe9e68eb6bb1fe99d.tar.gz
meson-8e89a38737281f7618a1284fe9e68eb6bb1fe99d.tar.bz2
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.
-rwxr-xr-xrun_project_tests.py9
-rwxr-xr-xrun_single_test.py6
2 files changed, 10 insertions, 5 deletions
diff --git a/run_project_tests.py b/run_project_tests.py
index a1feecd..7551c8d 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)
diff --git a/run_single_test.py b/run_single_test.py
index 8db9b40..0b4750b 100755
--- a/run_single_test.py
+++ b/run_single_test.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
-# Copyright © 2021-2023 Intel Corporation
+# Copyright © 2021-2024 Intel Corporation
"""Script for running a single project test.
@@ -15,7 +15,7 @@ import typing as T
from mesonbuild import mlog
from run_tests import handle_meson_skip_test
from run_project_tests import TestDef, load_test_json, run_test, BuildStep
-from run_project_tests import setup_commands, detect_system_compiler, print_tool_versions
+from run_project_tests import setup_commands, detect_system_compiler, detect_tools
if T.TYPE_CHECKING:
from run_project_tests import CompilerArgumentType
@@ -47,7 +47,7 @@ def main() -> None:
setup_commands(args.backend)
if not args.quick:
detect_system_compiler(args)
- print_tool_versions()
+ detect_tools(not args.quick)
test = TestDef(args.case, args.case.stem, [])
tests = load_test_json(test, False)