mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-03 22:30:29 +00:00
fileapi: Make launcher attribute 'arguments' optional
This was missed in commit 80a64c9ce5 (fileapi: Add cross-compiling
emulator to codemodel-v2, 2023-11-11).
This commit is contained in:
@@ -2102,7 +2102,9 @@ Json::Value Target::DumpLauncher(const char* name, const char* type)
|
|||||||
for (std::string const& arg : cmMakeRange(commandWithArgs).advance(1)) {
|
for (std::string const& arg : cmMakeRange(commandWithArgs).advance(1)) {
|
||||||
args.append(arg);
|
args.append(arg);
|
||||||
}
|
}
|
||||||
launcher["arguments"] = std::move(args);
|
if (!args.empty()) {
|
||||||
|
launcher["arguments"] = std::move(args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return launcher;
|
return launcher;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -410,15 +410,18 @@ def check_target(c):
|
|||||||
expected_keys.append("launchers")
|
expected_keys.append("launchers")
|
||||||
def check_launcher(actual, expected):
|
def check_launcher(actual, expected):
|
||||||
assert is_dict(actual)
|
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 sorted(actual.keys()) == sorted(launcher_keys)
|
||||||
assert matches(actual["command"], expected["command"])
|
assert matches(actual["command"], expected["command"])
|
||||||
assert matches(actual["type"], expected["type"])
|
assert matches(actual["type"], expected["type"])
|
||||||
if expected["arguments"] is not None:
|
if "arguments" in expected:
|
||||||
check_list_match(lambda a, e: matches(a, e),
|
if expected["arguments"] is not None:
|
||||||
actual["arguments"], expected["arguments"],
|
check_list_match(lambda a, e: matches(a, e),
|
||||||
missing_exception=lambda e: "argument: %s" % e,
|
actual["arguments"], expected["arguments"],
|
||||||
extra_exception=lambda a: "argument: %s" % actual["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"]),
|
check_list_match(lambda a, e: matches(a["type"], e["type"]),
|
||||||
obj["launchers"], expected["launchers"],
|
obj["launchers"], expected["launchers"],
|
||||||
check=check_launcher,
|
check=check_launcher,
|
||||||
|
|||||||
@@ -80,7 +80,6 @@
|
|||||||
"install": null,
|
"install": null,
|
||||||
"launchers" : [
|
"launchers" : [
|
||||||
{
|
{
|
||||||
"arguments" : null,
|
|
||||||
"command": "^no-such-emulator(\\.exe)?$",
|
"command": "^no-such-emulator(\\.exe)?$",
|
||||||
"type" : "emulator"
|
"type" : "emulator"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user