[cmake-developers] [CMake 0015431]: Skipped tests (SKIP_RETURN_CODE) cause non-zero exit code

Mantis Bug Tracker mantis at public.kitware.com
Thu Mar 5 10:08:43 EST 2015


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15431 
====================================================================== 
Reported By:                hansmi
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15431
Category:                   CTest
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-03-05 10:08 EST
Last Modified:              2015-03-05 10:08 EST
====================================================================== 
Summary:                    Skipped tests (SKIP_RETURN_CODE) cause non-zero exit
code
Description: 
Issue http://public.kitware.com/Bug/view.php?id=8466 implemented a property
named SKIP_RETURN_CODE for tests. It works as intended, but CTest's exit status
is non-zero when one or more tests were skipped. CMake's support for CTest
automatically generates a target which relies on the exit code of CTest to
indicate success.

There should probably be a flag (and/or environment variable) to indicate that
skipped tests are acceptable.

Steps to Reproduce: 
Add a skipped test:

add_test(NAME mytest COMMAND bash -c "exit 77")
set_property(TEST mytest PROPERTY SKIP_RETURN_CODE 77)

Then run “cmake --build . --target test”. At least with GNU make this causes
a failure.

1/1 Test   http://public.kitware.com/Bug/view.php?id=1: mytest
...............***Skipped   0.00 sec
…
The following tests FAILED:
  1 - mytest (Not Run)
Errors while running CTest
Makefile:117: recipe for target 'test' failed
make: *** [test] Error 8

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-03-05 10:08 hansmi         New Issue                                    
======================================================================



More information about the cmake-developers mailing list