How do I run a single test with UnitTest++ ?
I am running UnitTest++ out of the box as is. My main
function looks like:
int main()
{
printf("diamond test v0.1 %s\n\n",TIMESTAMP);
diamond::startup();
UnitTest::RunAllTests();
diamond::shutdown();
printf("press any key to continue...");
getc(stdin);
}
For debugging I would like to write something like UnitTest::RunSingleTests("MyNewUnitTest");
instead of UnitTest::RunAllTests();
. Does UnitTest++ provide such a function and if so, what is the syntax?
try this as your main() for unittest (I actually put this in a file and added that to the unittest library, so that when linking to the library the executable automatically uses this main(). very convenient.)
invoke with arguments to run a single test:
or single suite