- Test *test = m_registry.empty()?
- TestFactoryRegistry::getRegistry().makeTest() :
- TestFactoryRegistry::getRegistry(m_registry).makeTest();
-
- if (m_list) {
- List(test);
- return EXIT_SUCCESS;
- } else {
- TextUi::TestRunner runner;
- runner.addTest(test);
- return runner.run("", false, true, false) ? EXIT_SUCCESS : EXIT_FAILURE;
+ TextUi::TestRunner runner;
+
+ for (size_t i = 0; i < m_registries.size(); i++) {
+ auto_ptr<Test> test(m_registries[i].empty() ?
+ TestFactoryRegistry::getRegistry().makeTest() :
+ TestFactoryRegistry::getRegistry(m_registries[i]).makeTest());
+
+ TestSuite *suite = dynamic_cast<TestSuite*>(test.get());
+
+ if (suite && suite->countTestCases() == 0)
+ wxLogError(_T("No such test suite: %s"),
+ wxString(m_registries[i].c_str(), wxConvUTF8).c_str());
+ else if (m_list)
+ List(test.get());
+ else
+ runner.addTest(test.release());