mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
@@ -54,6 +54,9 @@ in the following cases:
|
||||
|
||||
* An error occurs, such as failure to process invalid arguments.
|
||||
|
||||
* .. versionadded:: 4.4
|
||||
No arguments are given and no ``CTestTestfile.cmake`` exists.
|
||||
|
||||
* The :option:`--no-tests=error <ctest --no-tests>` argument is given and no
|
||||
tests are executed, e.g., when ``CTestTestfile.cmake`` defines no tests,
|
||||
or when the given arguments exclude all tests.
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
ctest-error-exit
|
||||
----------------
|
||||
|
||||
* :manual:`ctest(1)` now exits with non-zero if invoked with no
|
||||
arguments and no test input file exists.
|
||||
+6
-4
@@ -209,12 +209,13 @@ int main(int argc, char const* const* argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool const haveTestfile = cmSystemTools::FileExists("CTestTestfile.cmake") ||
|
||||
cmSystemTools::FileExists("DartTestfile.txt");
|
||||
|
||||
// If there is a testing input file, check for documentation options
|
||||
// only if there are actually arguments. We want running without
|
||||
// arguments to run tests.
|
||||
if (argc > 1 ||
|
||||
!(cmSystemTools::FileExists("CTestTestfile.cmake") ||
|
||||
cmSystemTools::FileExists("DartTestfile.txt"))) {
|
||||
if (argc > 1 || !haveTestfile) {
|
||||
if (argc == 1) {
|
||||
std::cerr << "*********************************\n"
|
||||
"No test configuration file found!\n"
|
||||
@@ -228,7 +229,8 @@ int main(int argc, char const* const* argv)
|
||||
doc.SetSection("Name", cmDocumentationName);
|
||||
doc.SetSection("Usage", cmDocumentationUsage);
|
||||
doc.PrependSection("Options", cmDocumentationOptions);
|
||||
return !doc.PrintRequestedDocumentation(std::cout);
|
||||
return !doc.PrintRequestedDocumentation(std::cout) ||
|
||||
(argc == 1 && !haveTestfile);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -424,6 +424,8 @@ add_test(test2 \"${CMAKE_COMMAND}\" -E echo \"not running\")
|
||||
endfunction()
|
||||
run_stop_on_failure()
|
||||
|
||||
run_cmake_command(usage ${CMAKE_CTEST_COMMAND})
|
||||
|
||||
function(run_TestAffinity)
|
||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/TestAffinity)
|
||||
set(RunCMake_TEST_NO_CLEAN 1)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,3 @@
|
||||
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
|
||||
No test configuration file found!
|
||||
\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
|
||||
@@ -0,0 +1,3 @@
|
||||
Usage
|
||||
|
||||
ctest \[options\]
|
||||
Reference in New Issue
Block a user