X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8dae91699caa44c499dffb1b4f305bdeca91cb3c..c0b0635cf69537ca32377bad5650b39402cb21b6:/tests/test.cpp?ds=inline diff --git a/tests/test.cpp b/tests/test.cpp index d54a53583f..1990698b1d 100644 --- a/tests/test.cpp +++ b/tests/test.cpp @@ -129,11 +129,18 @@ int TestApp::OnRun() runner.addTest(test.release()); } +#if wxUSE_LOG // Switch off logging unless --verbose wxLog::EnableLogging(wxLog::GetVerbose()); - - return m_list || runner.run("", false, true, !wxLog::GetVerbose()) ? - EXIT_SUCCESS : EXIT_FAILURE; +#endif // wxUSE_LOG + + return m_list || runner.run("", false, true, +#if wxUSE_LOG + !wxLog::GetVerbose() +#else + true +#endif // wxUSE_LOG + ) ? EXIT_SUCCESS : EXIT_FAILURE; } // List the tests @@ -143,7 +150,7 @@ void TestApp::List(Test *test, const string& parent /*=""*/) const TestSuite *suite = dynamic_cast(test); string name; - if (suite || m_longlist) { + if (suite) { // take the last component of the name and append to the parent name = test->getName(); string::size_type i = name.find_last_of(".:"); @@ -156,15 +163,19 @@ void TestApp::List(Test *test, const string& parent /*=""*/) const cout << " "; cout << " " << name.substr(i + 1) << "\n"; } - } - if (suite) { - typedef const vector Tests; + typedef vector Tests; typedef Tests::const_iterator Iter; - Tests& tests = suite->getTests(); + const Tests& tests = suite->getTests(); for (Iter it = tests.begin(); it != tests.end(); ++it) List(*it, name); } + else if (m_longlist) { + string::size_type i = 0; + while ((i = parent.find('.', i + 1)) != string::npos) + cout << " "; + cout << " " << test->getName() << "\n"; + } }