I am using CxxTest for unit testing. I followed the docs.
First command I executed was:
cxxtestgen --error-printer -o runner.cpp MyTestSuite1.h
Output of the command is runner.cpp file.
According to the documentation, next command should be:
g++ -o runner -I(location_of_the_cxxTest_headers) runner.cpp
but I am unable to execute it, I am receiving the error about missing entry point. In other words, runner.cpp is missing main.
Same thing happens with the test files included with CxxTest.
I am running Windows 8.1.
My question is marked as a duplicate, but I didn't find solution in the another question. I am not building a GUI application. Question is about CxxTest and how does it even start without a main() function? Where is the entry point?
I have found a solution after looking at a python script
cxxtestgen.pywhich is used to generaterunner.cpp. There is an if statement at the beginning of awriteMain(output)function which writesmainfunction in an output file:At least one of the two options,
--runner=CLASSand--gui=CLASSis required when generating output file from test suites. After adding one option everything runs fine.