MantisBT - CMake
View Issue Details
0011774CMakeCTestpublic2011-01-28 11:142016-06-10 14:31
tyler 
Kitware Robot 
normalminoralways
closedmoved 
All
CMake 2.8.3 
 
0011774: ctest_test causes an error when no tests are found
Reported here:
http://www.mail-archive.com/cmake@cmake.org/msg34218.html [^]

David Cole replied here, agreeing that this is a bug:
http://www.mail-archive.com/cmake@cmake.org/msg34227.html [^]

"I think it would be a good idea to make ctest_test not induce an error just because there are no
tests to run."

David also suggested some other useful enhancements to ctest_test()'s behavior, but I don't want to bury this bug under a ton of feature requests.
1. Run a ctest -S script to build a project that doesn't include tests added via add_test().
2. Upon reaching the ctest_test() command in the ctest script, ctest will report:

    Test project
/satsop/build/kitt-cmake-based-addons-for-legacy-trunk/binary/addons/trunk/linux64.26/release
    Constructing a list of tests
    Done constructing a list of tests
    Checking test dependency graph...
    No tests were found!!!

and upon reaching the end of the script, it exits with an error:

    Error in read script:
/satsop/build/kitt-cmake-based-addons-for-legacy-trunk/kitt.cmake
No tags attached.
Issue History
2011-01-28 11:14tylerNew Issue
2011-01-28 11:28David ColeAssigned To => David Cole
2011-01-28 11:28David ColeStatusnew => assigned
2011-12-13 16:06Derek BrueningNote Added: 0027958
2012-08-13 15:12David ColeStatusassigned => backlog
2012-08-13 15:12David ColeNote Added: 0030600
2012-08-13 15:20David ColeAssigned ToDavid Cole =>
2016-06-10 14:28Kitware RobotNote Added: 0041791
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0027958)
Derek Bruening   
2011-12-13 16:06   
This bug is preventing our project from using the exit code of ctest to detect failures. We use ctest suites to build multiple builds. For some builds we run tests; for others we just ensure it builds, depending on the suite. Whenever we have a build with no tests, we hit this bug. Should be an easy fix: just change the cmCTestLog() on zero tests from ERROR_MESSAGE to WARNING like so:

diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 9b12393..1bfcac2 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -573,7 +573,7 @@ int cmCTestTestHandler::ProcessHandler()
     {
     if ( !this->CTest->GetShowOnly() && !this->CTest->ShouldPrintLabels() )
       {
- cmCTestLog(this->CTest, ERROR_MESSAGE, "No tests were found!!!"
+ cmCTestLog(this->CTest, WARNING, "No tests were found!!!"
         << std::endl);
       }
     }
(0030600)
David Cole   
2012-08-13 15:12   
Sending old, not-recently-updated issues to the backlog.

(The age of the bug alone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0041791)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.