I'm trying to test parts of my code. I wrote the following test.h
file:
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE(my_test) {
BOOST_CHECK(true);
}
If I run the test, my application's main method is invoked and since the command line arguments are missing, it terminates. I want to just run the test suite as it is and succeed since BOOST_CHECK
on true
should be a passed test. Once this works, I would add calls to functions from my code base one by one for regression testing. Is this possible to do? If yes, how?
This post suggests adding the following define to the top of the test.h
file but it does not work for skipping the main method invocation:
#define BOOST_TEST_NO_MAIN true