ctest: Print GENERATED_RESOURCE_SPEC_FILE property in show-only output

This was missed in commit c8c1dd0d95 (CTest: Add ability to dynamically
generate resource spec file, 2023-07-20, v3.28.0-rc1~233^2).
This commit is contained in:
Brad King
2024-11-25 11:57:27 -05:00
parent 733808150b
commit 7b041f7fe8
3 changed files with 32 additions and 16 deletions

View File

@@ -1156,6 +1156,11 @@ static Json::Value DumpCTestProperties(
properties.append(DumpCTestProperty(
"FIXTURES_SETUP", DumpToJsonArray(testProperties.FixturesSetup)));
}
if (!testProperties.GeneratedResourceSpecFile.empty()) {
properties.append(
DumpCTestProperty("GENERATED_RESOURCE_SPEC_FILE",
testProperties.GeneratedResourceSpecFile));
}
if (!testProperties.Labels.empty()) {
properties.append(
DumpCTestProperty("LABELS", DumpToJsonArray(testProperties.Labels)));

View File

@@ -469,6 +469,7 @@ function(run_ShowOnly)
file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
add_test(ShowOnly \"${CMAKE_COMMAND}\" -E echo)
set_tests_properties(ShowOnly PROPERTIES
GENERATED_RESOURCE_SPEC_FILE \"/Path/Does/Not/Exist\"
RESOURCE_GROUPS \"2,threads:2,gpus:4;gpus:2,threads:4\"
REQUIRED_FILES RequiredFileDoesNotExist
_BACKTRACE_TRIPLES \"file1;1;add_test;file0;;\"

View File

@@ -65,6 +65,14 @@ def check_command(c):
assert is_string(c[2])
assert c[2] == "echo"
def check_generated_resource_spec_file_property(p):
assert is_dict(p)
assert sorted(p.keys()) == ["name", "value"]
assert is_string(p["name"])
assert is_string(p["value"])
assert p["name"] == "GENERATED_RESOURCE_SPEC_FILE"
assert p["value"] == "/Path/Does/Not/Exist"
def check_reqfiles_property(p):
assert is_dict(p)
assert sorted(p.keys()) == ["name", "value"]
@@ -182,23 +190,25 @@ def check_defined_properties(p_list):
def check_properties(p):
assert is_list(p)
if sys.platform in ("win32"):
assert len(p) == 7
check_resource_groups_property(p[0])
check_reqfiles_property(p[1])
check_timeout_property(p[2])
check_willfail_property(p[3])
check_workingdir_property(p[4])
check_defined_properties(p[5:6])
assert len(p) == 8
check_generated_resource_spec_file_property(p[0])
check_resource_groups_property(p[1])
check_reqfiles_property(p[2])
check_timeout_property(p[3])
check_willfail_property(p[4])
check_workingdir_property(p[5])
check_defined_properties(p[6:7])
else:
assert len(p) == 9
check_resource_groups_property(p[0])
check_reqfiles_property(p[1])
check_timeout_property(p[2])
check_timeout_signal_name_property(p[3])
check_timeout_signal_grace_property(p[4])
check_willfail_property(p[5])
check_workingdir_property(p[6])
check_defined_properties(p[7:8])
assert len(p) == 10
check_generated_resource_spec_file_property(p[0])
check_resource_groups_property(p[1])
check_reqfiles_property(p[2])
check_timeout_property(p[3])
check_timeout_signal_name_property(p[4])
check_timeout_signal_grace_property(p[5])
check_willfail_property(p[6])
check_workingdir_property(p[7])
check_defined_properties(p[8:9])
def check_tests(t):
assert is_list(t)