allow to give the testcase name without the final 'TestCase' postfix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59679 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -231,16 +231,23 @@ int TestApp::OnRun()
|
|||||||
{
|
{
|
||||||
CppUnit::TextTestRunner runner;
|
CppUnit::TextTestRunner runner;
|
||||||
|
|
||||||
for (size_t i = 0; i < m_registries.size(); i++) {
|
for (size_t i = 0; i < m_registries.size(); i++)
|
||||||
auto_ptr<Test> test(m_registries[i].empty() ?
|
{
|
||||||
|
std::string reg = m_registries[i];
|
||||||
|
if (!reg.empty() && !wxString(reg).EndsWith("TestCase"))
|
||||||
|
reg += "TestCase";
|
||||||
|
// allow the user to specify the name of the testcase "in short form"
|
||||||
|
// (all wx test cases end with TestCase postfix)
|
||||||
|
|
||||||
|
auto_ptr<Test> test(reg.empty() ?
|
||||||
TestFactoryRegistry::getRegistry().makeTest() :
|
TestFactoryRegistry::getRegistry().makeTest() :
|
||||||
TestFactoryRegistry::getRegistry(m_registries[i]).makeTest());
|
TestFactoryRegistry::getRegistry(reg).makeTest());
|
||||||
|
|
||||||
TestSuite *suite = dynamic_cast<TestSuite*>(test.get());
|
TestSuite *suite = dynamic_cast<TestSuite*>(test.get());
|
||||||
|
|
||||||
if (suite && suite->countTestCases() == 0)
|
if (suite && suite->countTestCases() == 0)
|
||||||
wxLogError(_T("No such test suite: %s"),
|
wxLogError(_T("No such test suite: %s"),
|
||||||
wxString(m_registries[i].c_str(), wxConvUTF8).c_str());
|
wxString(reg.c_str(), wxConvUTF8).c_str());
|
||||||
else if (m_list)
|
else if (m_list)
|
||||||
List(test.get());
|
List(test.get());
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user