I'm looking for suggestions from someone who has used CTest to report results
to a dashboard other than CDash.
I'd like to be able to simply type
gmake test TESTOPTS="-report"
then have CTest traverse all the directories and run the defined tests. Not
only would I like it to run these tests, but I'd like it to run it through a
wrapper script that I use to report the results to a different dashboard.
I've tried this with
set( TEST_WRAPPER /full/path/to/test_wrapper )
...
add_test( unit_test1 )
# syntax 1
add_test( /full/path/to/test_wrapper --report unit_test2 ) # syntax 2
add_test( ${TEST_WRAPPER} ${TESTOPTS} unit_test3 ) # syntax 3
There are several problems I've noticed with this:
Syntax 1 works fine. It knows where the name unit_test1 is located and runs,
but since it isn't run through the wrapper script, nothing is reported to our
dashboard.
Syntax 2 works does not work. All the arguments are quoted. "-report" fails
as an option because of the quotes, and "unit_test2" is treated as a string not
as a name of a CMake object with a location.
Syntax 3 is just a variation of syntax 2 and also fails, but it is preferable
to define the wrapper script in the highest level CMakeLists.txt file and have
that value carried through to sub directories.
So I tried this
set( TEST_WRAPPER /full/path/to/test_wrapper_report )
...
add_test( ${TEST_WRAPPER_REPORT} "${CURRENT_DIR}/ unit_test4" )
# syntax 4
I modified the test wrapper to report without having to specify the -report
option.
In this case, everything seemed to work, but the return/exit value coming back
from the wrapper script was wrong. It seems that something is going on in the
CTest framework that changes this value. Instead of getting a value like -1,
0, 1, I was getting a value like 32844. I verified that unit_test4 returned
the correct return status to the wrapper script and the wrapper script returned
the correct return status when run outside of the CTest framework.
If anyone has suggestions, I would appreciate it.
Gantry York
Boeing/KinetX
Iridium SCS Development Team
--
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake