MantisBT - CMake
View Issue Details
0011487CMakeCTestpublic2010-11-19 15:232011-04-04 12:00
Clinton Stimpson 
David Cole 
normalminoralways
closedfixed 
Linux
CMake 2.8.3 
CMake 2.8.4CMake 2.8.4 
0011487: multiple ctest_test() calls with *_LABEL flag not handled right
a call to ctest_test(EXCLUDE_LABEL ...) messes up tests are run in a subsequent call to ctest_test()
To compare, the "EXCLUDE" option doesn't do this.
=== CMakeLists.txt ===
enable_testing()
add_test(test1 ${CMAKE_COMMAND} --help)
set_tests_properties(test1 PROPERTIES LABELS test1)
add_test(test2 ${CMAKE_COMMAND} --help)
set_tests_properties(test2 PROPERTIES LABELS test2)

=== test.ctest ===
get_filename_component(ROOT "." ABSOLUTE)
set(CTEST_SOURCE_DIRECTORY ${ROOT})
set(CTEST_BINARY_DIRECTORY ${ROOT}/build)
# need configured build to start with
ctest_start(Experimental)
ctest_test(EXCLUDE_LABEL test1)
#ctest_test(EXCLUDE test1)

ctest_start(Experimental)
ctest_test(INCLUDE_LABEL test1)
ctest_test(INCLUDE test1)
ctest_test()
ctest -V -S test.ctest gives:

Run dashboard with model Experimental
...
    Start 2: test2
1/1 Test 0000002: test2 ............................ Passed 0.02 sec
...
Run dashboard with model Experimental
...
No tests were found!!!
...
No tests were found!!!
...
No tests were found!!!
No tags attached.
Issue History
2010-11-19 15:23Clinton StimpsonNew Issue
2010-11-19 16:30Clinton StimpsonNote Added: 0023456
2010-12-09 11:43David ColeAssigned To => David Cole
2010-12-09 11:43David ColeStatusnew => assigned
2010-12-09 11:43David ColeTarget Version => CMake 2.8.4
2010-12-17 17:41David ColeNote Added: 0024255
2010-12-17 17:41David ColeStatusassigned => resolved
2010-12-17 17:41David ColeFixed in Version => CMake 2.8.4
2010-12-17 17:41David ColeResolutionopen => fixed
2011-04-04 12:00David ColeNote Added: 0026074
2011-04-04 12:00David ColeStatusresolved => closed

Notes
(0023456)
Clinton Stimpson   
2010-11-19 16:30   
Here's the fix:

diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 6dd348d..6eec3c8 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -438,6 +438,8 @@ void cmCTestTestHandler::Initialize()
 
   this->TestsToRun.clear();
 
+ this->UseIncludeLabelRegExpFlag = false;
+ this->UseExcludeLabelRegExpFlag = false;
   this->UseIncludeRegExpFlag = false;
   this->UseExcludeRegExpFlag = false;
   this->UseExcludeRegExpFirst = false;
(0024255)
David Cole   
2010-12-17 17:41   
Fixed and pushed to CMake 'next' with this commit:
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=744366fc0b63ff8e9f6e57a0648508e3dfe52709 [^]

Should appear in CMake 2.8.4
(0026074)
David Cole   
2011-04-04 12:00   
Closing resolved issues that have not been updated in more than 3 months.