I have a C++ cmake project that uses Boost Test for unit testing. Now I would like to expose a series of bash scripts (used for integration testing) to cmake. Suppose each of this script to return 0 in case of PASS or something != 0 in case of FAILURE. I would like each script to be executed whenever I run cmake test
.
What's the simplest and quickest way to obtain such behavior
Basically, you want to start by locating the bash program
find_program (BASH_PROGRAM bash)
Then just add your script to the list of tests
if (BASH_PROGRAM)
add_test (mytest ${BASH_PROGRAM} ${CMAKE_CURRENT_SOURCE_DIR}/script.sh)
endif (BASH_PROGRAM)
And all of that should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With