summaryrefslogtreecommitdiffstats
path: root/base/test/test_suite.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-16 04:18:41 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-16 04:18:41 +0000
commit6fa18d1c50a9fda0462eec8da70190504bfec520 (patch)
tree00af6f00a9c7c75e364a6ad3736c2d8766a7adf5 /base/test/test_suite.h
parent9924bf0c7641495b6e27195b088ebbab1c1afc4f (diff)
downloadchromium_src-6fa18d1c50a9fda0462eec8da70190504bfec520.zip
chromium_src-6fa18d1c50a9fda0462eec8da70190504bfec520.tar.gz
chromium_src-6fa18d1c50a9fda0462eec8da70190504bfec520.tar.bz2
Separate out the constructor and Run from test_suite.cc. This is an isolated
part of r55416 to test that the files that use test_suite have the proper project dependencies. TEST=everything compiles BUG=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56182 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/test/test_suite.h')
-rw-r--r--base/test/test_suite.h54
1 files changed, 2 insertions, 52 deletions
diff --git a/base/test/test_suite.h b/base/test/test_suite.h
index eb688f4..3cfc7ec 100644
--- a/base/test/test_suite.h
+++ b/base/test/test_suite.h
@@ -58,17 +58,7 @@ class TestIsolationEnforcer : public testing::EmptyTestEventListener {
class TestSuite {
public:
- TestSuite(int argc, char** argv) {
- base::EnableTerminationOnHeapCorruption();
- CommandLine::Init(argc, argv);
- testing::InitGoogleTest(&argc, argv);
-#if defined(TOOLKIT_USES_GTK)
- g_thread_init(NULL);
- gtk_init_check(&argc, &argv);
-#endif // defined(TOOLKIT_USES_GTK)
- // Don't add additional code to this constructor. Instead add it to
- // Initialize(). See bug 6436.
- }
+ TestSuite(int argc, char** argv);
virtual ~TestSuite() {
CommandLine::Reset();
@@ -134,47 +124,7 @@ class TestSuite {
listeners.Append(new MaybeTestDisabler);
}
- // Don't add additional code to this method. Instead add it to
- // Initialize(). See bug 6436.
- int Run() {
- base::ScopedNSAutoreleasePool scoped_pool;
-
- Initialize();
- std::string client_func =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- kRunClientProcess);
- // Check to see if we are being run as a client process.
- if (!client_func.empty())
- return multi_process_function_list::InvokeChildProcessTest(client_func);
- int result = RUN_ALL_TESTS();
-
- // If there are failed tests, see if we should ignore the failures.
- if (result != 0 && GetTestCount(&TestSuite::NonIgnoredFailures) == 0)
- result = 0;
-
- // Display the number of flaky tests.
- int flaky_count = GetTestCount(&TestSuite::IsMarkedFlaky);
- if (flaky_count) {
- printf(" YOU HAVE %d FLAKY %s\n\n", flaky_count,
- flaky_count == 1 ? "TEST" : "TESTS");
- }
-
- // Display the number of tests with ignored failures (FAILS).
- int failing_count = GetTestCount(&TestSuite::IsMarkedFailing);
- if (failing_count) {
- printf(" YOU HAVE %d %s with ignored failures (FAILS prefix)\n\n",
- failing_count, failing_count == 1 ? "test" : "tests");
- }
-
- // This MUST happen before Shutdown() since Shutdown() tears down
- // objects (such as NotificationService::current()) that Cocoa
- // objects use to remove themselves as observers.
- scoped_pool.Recycle();
-
- Shutdown();
-
- return result;
- }
+ int Run();
protected:
class MaybeTestDisabler : public testing::EmptyTestEventListener {