GTTF: No more FLAKY_ .
Please note that FLAKY_ tests have been ignored anyway. When tests started
crashing, people just flipped that to DISABLED_ . Why not go straight to
DISABLED_ then, so that we avoid wasting time on stupid test prefix games?
With DISABLED_ it is clear to everyone that there is no coverage from given
test. FLAKY_ creates an illusion of coverage, while in fact the test is still
ignored.
If a FLAKY_ test fails and nobody notices, does it still make a sound? ;-)
Finally, note that gtest has a --gtest_also_run_disabled_tests if you need
to run tests manually.
TBR=jam
BUG=none
Review URL: https://codereview.chromium.org/11664013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174472 0039d316-1c4b-4281-b951-d872f2087c98
CrOS-Libchrome-Original-Commit: 1e09ec8405edea095b9c1a064197d44098a02620
diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc
index 824fbc6..c5c3368 100644
--- a/base/test/test_suite.cc
+++ b/base/test/test_suite.cc
@@ -78,8 +78,6 @@
} // namespace
-const char TestSuite::kStrictFailureHandling[] = "strict_failure_handling";
-
TestSuite::TestSuite(int argc, char** argv) : initialized_command_line_(false) {
PreInitialize(argc, argv, true);
}
@@ -124,44 +122,10 @@
// static
-bool TestSuite::IsMarkedFlaky(const testing::TestInfo& test) {
- return strncmp(test.name(), "FLAKY_", 6) == 0;
-}
-
-// static
bool TestSuite::IsMarkedMaybe(const testing::TestInfo& test) {
return strncmp(test.name(), "MAYBE_", 6) == 0;
}
-// static
-bool TestSuite::ShouldIgnoreFailure(const testing::TestInfo& test) {
- if (CommandLine::ForCurrentProcess()->HasSwitch(kStrictFailureHandling))
- return false;
- return IsMarkedFlaky(test);
-}
-
-// static
-bool TestSuite::NonIgnoredFailures(const testing::TestInfo& test) {
- return test.should_run() && test.result()->Failed() &&
- !ShouldIgnoreFailure(test);
-}
-
-int TestSuite::GetTestCount(TestMatch test_match) {
- testing::UnitTest* instance = testing::UnitTest::GetInstance();
- int count = 0;
-
- for (int i = 0; i < instance->total_test_case_count(); ++i) {
- const testing::TestCase& test_case = *instance->GetTestCase(i);
- for (int j = 0; j < test_case.total_test_count(); ++j) {
- if (test_match(*test_case.GetTestInfo(j))) {
- count++;
- }
- }
- }
-
- return count;
-}
-
void TestSuite::CatchMaybeTests() {
testing::TestEventListeners& listeners =
testing::UnitTest::GetInstance()->listeners();
@@ -194,17 +158,6 @@
#endif
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");
- }
-
#if defined(OS_MACOSX)
// This MUST happen before Shutdown() since Shutdown() tears down
// objects (such as NotificationService::current()) that Cocoa
diff --git a/base/test/test_suite.h b/base/test/test_suite.h
index 1758f86..9f139ed 100644
--- a/base/test/test_suite.h
+++ b/base/test/test_suite.h
@@ -28,36 +28,17 @@
TestSuite(int argc, char** argv);
virtual ~TestSuite();
- // Returns true if the test is marked as flaky.
- static bool IsMarkedFlaky(const testing::TestInfo& test);
-
- // Returns true if the test is marked as failing.
- static bool IsMarkedFailing(const testing::TestInfo& test);
-
// Returns true if the test is marked as "MAYBE_".
// When using different prefixes depending on platform, we use MAYBE_ and
// preprocessor directives to replace MAYBE_ with the target prefix.
static bool IsMarkedMaybe(const testing::TestInfo& test);
- // Returns true if the test failure should be ignored.
- static bool ShouldIgnoreFailure(const testing::TestInfo& test);
-
- // Returns true if the test failed and the failure shouldn't be ignored.
- static bool NonIgnoredFailures(const testing::TestInfo& test);
-
- // Returns the number of tests where the match function returns true.
- int GetTestCount(TestMatch test_match);
-
void CatchMaybeTests();
void ResetCommandLine();
int Run();
- // A command-line flag that makes a test failure always result in a non-zero
- // process exit code.
- static const char kStrictFailureHandling[];
-
protected:
// This constructor is only accessible to specialized test suite
// implementations which need to control the creation of an AtExitManager
diff --git a/dbus/bus_unittest.cc b/dbus/bus_unittest.cc
index 769b6d7..ca24041 100644
--- a/dbus/bus_unittest.cc
+++ b/dbus/bus_unittest.cc
@@ -109,7 +109,7 @@
}
// http://crbug.com/137846
-TEST(BusTest, FLAKY_UnregisterExportedObject) {
+TEST(BusTest, DISABLED_UnregisterExportedObject) {
// Start the D-Bus thread.
base::Thread::Options thread_options;
thread_options.message_loop_type = MessageLoop::TYPE_IO;