I have a C++ CMake project where I use Google Test for unit testing and I'm happy with the XML reports produced using ctest -T Test. Now I would like to implement couple of integration tests that run specific application scenarios and expect a specific output e.g. running a C++ executable with default values should produce a specific output e.g. the following integration_test_01.sh bash shell would be such a test:
#!/bin/bash
./my_algorithm > out && grep "mse\=1\.2345e\-6" out
if [ $? == 0 ]; then
echo "integration test succeeded"
else
echo "integration test failed" >&2
fi
rm out | cat
Is there a way to integrate such test with CMake or CTest and maybe even get some XML output?