Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3249)

Unified Diff: base/test/test_suite.cc

Issue 11664013: GTTF: No more FLAKY_ . (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/test/test_suite.cc
diff --git a/base/test/test_suite.cc b/base/test/test_suite.cc
index 824fbc6496be6aea75baf241b1d8352d5a101db8..c5c3368449eaea971e60f33e776e1cf62653ccd6 100644
--- a/base/test/test_suite.cc
+++ b/base/test/test_suite.cc
@@ -78,8 +78,6 @@ class TestClientInitializer : public testing::EmptyTestEventListener {
} // 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 @@ void TestSuite::PreInitialize(int argc, char** argv,
// 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 @@ int TestSuite::Run() {
#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

Powered by Google App Engine
This is Rietveld 408576698