mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-16 14:08:35 +08:00
CTest: Fix --show-only=json-v1 output with REQUIRED_FILES property
Fixes: #19629
This commit is contained in:
@@ -855,8 +855,8 @@ static Json::Value DumpCTestProperties(
|
|||||||
DumpCTestProperty("PROCESSORS", testProperties.Processors));
|
DumpCTestProperty("PROCESSORS", testProperties.Processors));
|
||||||
}
|
}
|
||||||
if (!testProperties.RequiredFiles.empty()) {
|
if (!testProperties.RequiredFiles.empty()) {
|
||||||
properties["REQUIRED_FILES"] =
|
properties.append(DumpCTestProperty(
|
||||||
DumpToJsonArray(testProperties.RequiredFiles);
|
"REQUIRED_FILES", DumpToJsonArray(testProperties.RequiredFiles)));
|
||||||
}
|
}
|
||||||
if (!testProperties.LockedResources.empty()) {
|
if (!testProperties.LockedResources.empty()) {
|
||||||
properties.append(DumpCTestProperty(
|
properties.append(DumpCTestProperty(
|
||||||
|
@@ -200,7 +200,11 @@ function(run_ShowOnly)
|
|||||||
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
|
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
|
||||||
file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
|
file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" "
|
||||||
add_test(ShowOnly \"${CMAKE_COMMAND}\" -E echo)
|
add_test(ShowOnly \"${CMAKE_COMMAND}\" -E echo)
|
||||||
set_tests_properties(ShowOnly PROPERTIES WILL_FAIL true _BACKTRACE_TRIPLES \"file1;1;add_test;file0;;\")
|
set_tests_properties(ShowOnly PROPERTIES
|
||||||
|
WILL_FAIL true
|
||||||
|
REQUIRED_FILES RequiredFileDoesNotExist
|
||||||
|
_BACKTRACE_TRIPLES \"file1;1;add_test;file0;;\"
|
||||||
|
)
|
||||||
add_test(ShowOnlyNotAvailable NOT_AVAILABLE)
|
add_test(ShowOnlyNotAvailable NOT_AVAILABLE)
|
||||||
")
|
")
|
||||||
run_cmake_command(show-only_human ${CMAKE_CTEST_COMMAND} --show-only=human)
|
run_cmake_command(show-only_human ${CMAKE_CTEST_COMMAND} --show-only=human)
|
||||||
|
@@ -63,6 +63,15 @@ def check_command(c):
|
|||||||
assert is_string(c[2])
|
assert is_string(c[2])
|
||||||
assert c[2] == "echo"
|
assert c[2] == "echo"
|
||||||
|
|
||||||
|
def check_reqfiles_property(p):
|
||||||
|
assert is_dict(p)
|
||||||
|
assert sorted(p.keys()) == ["name", "value"]
|
||||||
|
assert is_string(p["name"])
|
||||||
|
assert is_list(p["value"])
|
||||||
|
assert p["name"] == "REQUIRED_FILES"
|
||||||
|
assert len(p["value"]) == 1
|
||||||
|
assert p["value"][0] == "RequiredFileDoesNotExist"
|
||||||
|
|
||||||
def check_willfail_property(p):
|
def check_willfail_property(p):
|
||||||
assert is_dict(p)
|
assert is_dict(p)
|
||||||
assert sorted(p.keys()) == ["name", "value"]
|
assert sorted(p.keys()) == ["name", "value"]
|
||||||
@@ -81,9 +90,10 @@ def check_workingdir_property(p):
|
|||||||
|
|
||||||
def check_properties(p):
|
def check_properties(p):
|
||||||
assert is_list(p)
|
assert is_list(p)
|
||||||
assert len(p) == 2
|
assert len(p) == 3
|
||||||
check_willfail_property(p[0])
|
check_reqfiles_property(p[0])
|
||||||
check_workingdir_property(p[1])
|
check_willfail_property(p[1])
|
||||||
|
check_workingdir_property(p[2])
|
||||||
|
|
||||||
def check_tests(t):
|
def check_tests(t):
|
||||||
assert is_list(t)
|
assert is_list(t)
|
||||||
|
Reference in New Issue
Block a user