MantisBT - CMake
View Issue Details
0014829CMake(No Category)public2014-03-24 12:312016-06-10 14:31
Mathieu Malaterre 
Kitware Robot 
normalminorhave not tried
closedmoved 
 
 
0014829: DEPENDS: Specifies that this test should only be run after the specified list of tests.
ctest documentation defines:

"DEPENDS: Set this to a list of tests that must finish before this test is run."

However it should read as

"DEPENDS: Set this to a list of tests that must execute before this test is run."
Steps:

$ cat CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
project(timeout NONE)
enable_testing()
# timeout
add_test(NAME dummy1 COMMAND sleep 10)
set_tests_properties(dummy1 PROPERTIES TIMEOUT 4)
add_test(NAME dummy2 COMMAND echo "not ok !")
set_tests_properties(dummy2 PROPERTIES DEPENDS dummy1)
set_tests_properties(dummy2 PROPERTIES WILL_FAIL 1)
# failed test:
add_test(NAME dummy3 COMMAND ls /urs)
add_test(NAME dummy4 COMMAND echo "not ok !")
set_tests_properties(dummy4 PROPERTIES DEPENDS dummy3)
set_tests_properties(dummy4 PROPERTIES WILL_FAIL 1)
$ cmake . && make
$ make test
Running tests...
Test project /tmp/hh/timeout
    Start 1: dummy1
1/4 Test #1: dummy1 ...........................***Timeout 4.00 sec
    Start 2: dummy2
2/4 Test 0000002: dummy2 ...........................***Failed 0.00 sec
    Start 3: dummy3
3/4 Test 0000003: dummy3 ...........................***Failed 0.00 sec
    Start 4: dummy4
4/4 Test 0000004: dummy4 ...........................***Failed 0.00 sec

0% tests passed, 4 tests failed out of 4

Total Test time (real) = 4.01 sec

The following tests FAILED:
      1 - dummy1 (Timeout)
      2 - dummy2 (Failed)
      3 - dummy3 (Failed)
      4 - dummy4 (Failed)
Errors while running CTest
make: *** [test] Erreur 8
It would make sense to have another property "DEPENDS_NOFAILURE" which would execute a test only if none of the dependee tests failed (whether a test failure or a timeout occur).

This will make sure that a test is not wrongly executed, but only if all tests dependencies have executed and finished properly.
No tags attached.
Issue History
2014-03-24 12:31Mathieu MalaterreNew Issue
2014-03-24 13:10Ben BoeckelNote Added: 0035485
2014-03-24 13:12Mathieu MalaterreNote Added: 0035486
2016-06-10 14:29Kitware RobotNote Added: 0042515
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0035485)
Ben Boeckel   
2014-03-24 13:10   
What about an alternative "Not Run (Dependency Failed)" status for the test (so that it still shows up on the dashboard)?
(0035486)
Mathieu Malaterre   
2014-03-24 13:12   
Good point ! That makes reading even easier.
(0042515)
Kitware Robot   
2016-06-10 14:29   
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.