I’m porting code that has a lot of test suites based on CppUnit 1.9.11 or so. My test runner could print all the named test suites using this (deprecated?) idiom:
cout << "\n Usage: UnitTest testSuiteName ...\n\n";
cout << " Tests available: \n";
CppUnit::TestFactoryRegistry registry("All Tests");
CppUnit::Test* test = registry.getRegistry().makeTest();
CppUnit::Registries registryList = registry.getRegistryList();
CppUnit::Registries::iterator it;
for (it = registryList.begin(); it != registryList.end(); ++it)
{
cout << " - " << it->first << endl;
}
Obviously getRegistryList() doesn’t exist in CppUnit 1.12. Is there an equivalent idiom to get all the registered, named test suites?
Answering my own question: