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

Side by Side Diff: base/test/test_suite.cc

Issue 11293028: GTTF: remove FAILS_ prefix, part 1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/message_loop_unittest.cc ('k') | chrome/browser/browser_keyevents_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/test/test_suite.h" 5 #include "base/test/test_suite.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/base_paths.h" 8 #include "base/base_paths.h"
9 #include "base/base_switches.h" 9 #include "base/base_switches.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // Initialize(). See bug 6436. 121 // Initialize(). See bug 6436.
122 } 122 }
123 123
124 124
125 // static 125 // static
126 bool TestSuite::IsMarkedFlaky(const testing::TestInfo& test) { 126 bool TestSuite::IsMarkedFlaky(const testing::TestInfo& test) {
127 return strncmp(test.name(), "FLAKY_", 6) == 0; 127 return strncmp(test.name(), "FLAKY_", 6) == 0;
128 } 128 }
129 129
130 // static 130 // static
131 bool TestSuite::IsMarkedFailing(const testing::TestInfo& test) {
132 return strncmp(test.name(), "FAILS_", 6) == 0;
133 }
134
135 // static
136 bool TestSuite::IsMarkedMaybe(const testing::TestInfo& test) { 131 bool TestSuite::IsMarkedMaybe(const testing::TestInfo& test) {
137 return strncmp(test.name(), "MAYBE_", 6) == 0; 132 return strncmp(test.name(), "MAYBE_", 6) == 0;
138 } 133 }
139 134
140 // static 135 // static
141 bool TestSuite::ShouldIgnoreFailure(const testing::TestInfo& test) { 136 bool TestSuite::ShouldIgnoreFailure(const testing::TestInfo& test) {
142 if (CommandLine::ForCurrentProcess()->HasSwitch(kStrictFailureHandling)) 137 if (CommandLine::ForCurrentProcess()->HasSwitch(kStrictFailureHandling))
143 return false; 138 return false;
144 return IsMarkedFlaky(test) || IsMarkedFailing(test); 139 return IsMarkedFlaky(test);
145 } 140 }
146 141
147 // static 142 // static
148 bool TestSuite::NonIgnoredFailures(const testing::TestInfo& test) { 143 bool TestSuite::NonIgnoredFailures(const testing::TestInfo& test) {
149 return test.should_run() && test.result()->Failed() && 144 return test.should_run() && test.result()->Failed() &&
150 !ShouldIgnoreFailure(test); 145 !ShouldIgnoreFailure(test);
151 } 146 }
152 147
153 int TestSuite::GetTestCount(TestMatch test_match) { 148 int TestSuite::GetTestCount(TestMatch test_match) {
154 testing::UnitTest* instance = testing::UnitTest::GetInstance(); 149 testing::UnitTest* instance = testing::UnitTest::GetInstance();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 if (result != 0 && GetTestCount(&TestSuite::NonIgnoredFailures) == 0) 197 if (result != 0 && GetTestCount(&TestSuite::NonIgnoredFailures) == 0)
203 result = 0; 198 result = 0;
204 199
205 // Display the number of flaky tests. 200 // Display the number of flaky tests.
206 int flaky_count = GetTestCount(&TestSuite::IsMarkedFlaky); 201 int flaky_count = GetTestCount(&TestSuite::IsMarkedFlaky);
207 if (flaky_count) { 202 if (flaky_count) {
208 printf(" YOU HAVE %d FLAKY %s\n\n", flaky_count, 203 printf(" YOU HAVE %d FLAKY %s\n\n", flaky_count,
209 flaky_count == 1 ? "TEST" : "TESTS"); 204 flaky_count == 1 ? "TEST" : "TESTS");
210 } 205 }
211 206
212 // Display the number of tests with ignored failures (FAILS).
213 int failing_count = GetTestCount(&TestSuite::IsMarkedFailing);
214 if (failing_count) {
215 printf(" YOU HAVE %d %s with ignored failures (FAILS prefix)\n\n",
216 failing_count, failing_count == 1 ? "test" : "tests");
217 }
218
219 #if defined(OS_MACOSX) 207 #if defined(OS_MACOSX)
220 // This MUST happen before Shutdown() since Shutdown() tears down 208 // This MUST happen before Shutdown() since Shutdown() tears down
221 // objects (such as NotificationService::current()) that Cocoa 209 // objects (such as NotificationService::current()) that Cocoa
222 // objects use to remove themselves as observers. 210 // objects use to remove themselves as observers.
223 scoped_pool.Recycle(); 211 scoped_pool.Recycle();
224 #endif 212 #endif
225 213
226 Shutdown(); 214 Shutdown();
227 215
228 return result; 216 return result;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 icu_util::Initialize(); 288 icu_util::Initialize();
301 289
302 CatchMaybeTests(); 290 CatchMaybeTests();
303 ResetCommandLine(); 291 ResetCommandLine();
304 292
305 TestTimeouts::Initialize(); 293 TestTimeouts::Initialize();
306 } 294 }
307 295
308 void TestSuite::Shutdown() { 296 void TestSuite::Shutdown() {
309 } 297 }
OLDNEW
« no previous file with comments | « base/message_loop_unittest.cc ('k') | chrome/browser/browser_keyevents_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698