How would one go about testing a whole program? So far, the only things I can think of are:
I could compile the binary and run a test suite on that but that would require a system independent way to call it in C, which is a nightmare based on other questions. I could probably figure out Boost.Process, but Boost isn't currently a dependency so I'd rather not add it just for testing.
Or, using some preprocessor stuff like below (untested), I might be able to rename the main
function, make it defined in a header file, and include that in the test suite.
#ifdef TEST_MAIN
#include "progname.h"
int main_test(...){
#else
int main(...){
#endif
Is this necessary or is there a more obvious way to go about this? If it matters, I'm using CMake and Check.