diff options
author | Brad King <brad.king@kitware.com> | 2019-08-23 14:04:00 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-08-23 14:07:32 (GMT) |
commit | a6b01b7d454c31a2f2b21f3c2c29bb341d733719 (patch) | |
tree | b75ca890b5dadd2eeddea726fc54acb704a1ee56 | |
parent | 76891a4a7a77868a025030ee92ff8dddb8fc3932 (diff) | |
parent | 5778880d20a7fb78ee6144b52d93ff371df54a41 (diff) | |
download | CMake-a6b01b7d454c31a2f2b21f3c2c29bb341d733719.zip CMake-a6b01b7d454c31a2f2b21f3c2c29bb341d733719.tar.gz CMake-a6b01b7d454c31a2f2b21f3c2c29bb341d733719.tar.bz2 |
Merge topic 'ctest-json-REQUIRED_FILES'
5778880d20 CTest: Fix --show-only=json-v1 output with REQUIRED_FILES property
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3719
-rw-r--r-- | Source/CTest/cmCTestMultiProcessHandler.cxx | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py | 16 |
3 files changed, 20 insertions, 6 deletions
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index 2d07420..9925dc1 100644 --- a/Source/CTest/cmCTestMultiProcessHandler.cxx +++ b/Source/CTest/cmCTestMultiProcessHandler.cxx @@ -858,8 +858,8 @@ static Json::Value DumpCTestProperties( DumpCTestProperty("PROCESSORS", testProperties.Processors)); } if (!testProperties.RequiredFiles.empty()) { - properties["REQUIRED_FILES"] = - DumpToJsonArray(testProperties.RequiredFiles); + properties.append(DumpCTestProperty( + "REQUIRED_FILES", DumpToJsonArray(testProperties.RequiredFiles))); } if (!testProperties.LockedResources.empty()) { properties.append(DumpCTestProperty( diff --git a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake index 3fee79c..ca2975a 100644 --- a/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CTestCommandLine/RunCMakeTest.cmake @@ -256,7 +256,11 @@ function(run_ShowOnly) file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") file(WRITE "${RunCMake_TEST_BINARY_DIR}/CTestTestfile.cmake" " 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) ") run_cmake_command(show-only_human ${CMAKE_CTEST_COMMAND} --show-only=human) diff --git a/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py b/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py index 4dff90c..3ad5768 100644 --- a/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py +++ b/Tests/RunCMake/CTestCommandLine/show-only_json-v1_check.py @@ -63,6 +63,15 @@ def check_command(c): assert is_string(c[2]) 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): assert is_dict(p) assert sorted(p.keys()) == ["name", "value"] @@ -81,9 +90,10 @@ def check_workingdir_property(p): def check_properties(p): assert is_list(p) - assert len(p) == 2 - check_willfail_property(p[0]) - check_workingdir_property(p[1]) + assert len(p) == 3 + check_reqfiles_property(p[0]) + check_willfail_property(p[1]) + check_workingdir_property(p[2]) def check_tests(t): assert is_list(t) |