mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-07 06:09:52 -06:00
CTest: Teach --show-only= to reject unknown values
This commit is contained in:
@@ -1944,6 +1944,9 @@ bool cmCTest::HandleCommandLineArguments(size_t& i,
|
||||
this->Quiet = true;
|
||||
this->OutputAsJson = true;
|
||||
this->OutputAsJsonVersion = 1;
|
||||
} else if (format != "human") {
|
||||
errormsg = "'--show-only=' given unknown value '" + format + "'";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -203,6 +203,8 @@ function(run_ShowOnly)
|
||||
set_tests_properties(ShowOnly PROPERTIES WILL_FAIL true _BACKTRACE_TRIPLES \"file1;1;add_test;file0;;\")
|
||||
add_test(ShowOnlyNotAvailable NOT_AVAILABLE)
|
||||
")
|
||||
run_cmake_command(show-only_human ${CMAKE_CTEST_COMMAND} --show-only=human)
|
||||
run_cmake_command(show-only_bad ${CMAKE_CTEST_COMMAND} --show-only=bad)
|
||||
run_cmake_command(show-only_json-v1 ${CMAKE_CTEST_COMMAND} --show-only=json-v1)
|
||||
endfunction()
|
||||
run_ShowOnly()
|
||||
|
||||
1
Tests/RunCMake/CTestCommandLine/show-only_bad-result.txt
Normal file
1
Tests/RunCMake/CTestCommandLine/show-only_bad-result.txt
Normal file
@@ -0,0 +1 @@
|
||||
1
|
||||
1
Tests/RunCMake/CTestCommandLine/show-only_bad-stderr.txt
Normal file
1
Tests/RunCMake/CTestCommandLine/show-only_bad-stderr.txt
Normal file
@@ -0,0 +1 @@
|
||||
^CMake Error: '--show-only=' given unknown value 'bad'$
|
||||
@@ -0,0 +1 @@
|
||||
Test #1: ShowOnly
|
||||
Reference in New Issue
Block a user