summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/FileAPI/codemodel-v2-check.py
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2023-12-11 22:30:03 (GMT)
committerBrad King <brad.king@kitware.com>2023-12-13 15:20:41 (GMT)
commit478a5f4e044d253971e71a41ad6fc6b8aa4e1c07 (patch)
treea20da67142a7a14076f8aeed145c780963650450 /Tests/RunCMake/FileAPI/codemodel-v2-check.py
parentb44e38a39736318aaf21a6865fdbee28a0e26700 (diff)
downloadCMake-478a5f4e044d253971e71a41ad6fc6b8aa4e1c07.zip
CMake-478a5f4e044d253971e71a41ad6fc6b8aa4e1c07.tar.gz
CMake-478a5f4e044d253971e71a41ad6fc6b8aa4e1c07.tar.bz2
fileapi: Make launcher attribute 'arguments' optional
This was missed in commit 80a64c9ce5 (fileapi: Add cross-compiling emulator to codemodel-v2, 2023-11-11).
Diffstat (limited to 'Tests/RunCMake/FileAPI/codemodel-v2-check.py')
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
index cb90eba..f46448b 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -410,15 +410,18 @@ def check_target(c):
expected_keys.append("launchers")
def check_launcher(actual, expected):
assert is_dict(actual)
- launcher_keys = ["arguments", "command", "type"]
+ launcher_keys = ["command", "type"]
+ if "arguments" in expected:
+ launcher_keys.append("arguments")
assert sorted(actual.keys()) == sorted(launcher_keys)
assert matches(actual["command"], expected["command"])
assert matches(actual["type"], expected["type"])
- if expected["arguments"] is not None:
- check_list_match(lambda a, e: matches(a, e),
- actual["arguments"], expected["arguments"],
- missing_exception=lambda e: "argument: %s" % e,
- extra_exception=lambda a: "argument: %s" % actual["arguments"])
+ if "arguments" in expected:
+ if expected["arguments"] is not None:
+ check_list_match(lambda a, e: matches(a, e),
+ actual["arguments"], expected["arguments"],
+ missing_exception=lambda e: "argument: %s" % e,
+ extra_exception=lambda a: "argument: %s" % actual["arguments"])
check_list_match(lambda a, e: matches(a["type"], e["type"]),
obj["launchers"], expected["launchers"],
check=check_launcher,