summaryrefslogtreecommitdiffstats
path: root/chrome/test/out_of_proc_test_runner.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 06:20:25 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 06:20:25 +0000
commite511d09d990972f5ca1cbf888234878be3f912a2 (patch)
treed75f2ed97e661a439ad868dd19442a628e339ed1 /chrome/test/out_of_proc_test_runner.cc
parent3c1139fc18193fa1726648c791d07a5a683802c3 (diff)
downloadchromium_src-e511d09d990972f5ca1cbf888234878be3f912a2.zip
chromium_src-e511d09d990972f5ca1cbf888234878be3f912a2.tar.gz
chromium_src-e511d09d990972f5ca1cbf888234878be3f912a2.tar.bz2
GTTF: do not ignore crashy or hangy test failures in browser_tests launcher.
BUG=59330 TEST=browser_tests Review URL: http://codereview.chromium.org/4000002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63489 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/out_of_proc_test_runner.cc')
-rw-r--r--chrome/test/out_of_proc_test_runner.cc28
1 files changed, 19 insertions, 9 deletions
diff --git a/chrome/test/out_of_proc_test_runner.cc b/chrome/test/out_of_proc_test_runner.cc
index 09fb960..64ceb161 100644
--- a/chrome/test/out_of_proc_test_runner.cc
+++ b/chrome/test/out_of_proc_test_runner.cc
@@ -226,8 +226,9 @@ bool MatchesFilter(const std::string& name, const std::string& filter) {
}
}
-// Returns true if the test succeeded, false if it failed.
-bool RunTest(const std::string& test_name) {
+// Runs test specified by |test_name| in a child process,
+// and returns the exit code.
+int RunTest(const std::string& test_name) {
// Some of the below method calls will leak objects if there is no
// autorelease pool in place.
base::mac::ScopedNSAutoreleasePool pool;
@@ -319,7 +320,7 @@ bool RunTest(const std::string& test_name) {
}
#endif
- return exit_code == 0;
+ return exit_code;
}
bool RunTests() {
@@ -361,18 +362,27 @@ bool RunTests() {
}
base::Time start_time = base::Time::Now();
++test_run_count;
- if (!RunTest(test_name.c_str())) {
+ int exit_code = RunTest(test_name);
+ if (exit_code == 0) {
+ // Test passed.
+ printer.OnTestEnd(test_info->name(), test_case->name(), true, false,
+ false,
+ (base::Time::Now() - start_time).InMillisecondsF());
+ } else {
failed_tests.push_back(test_name);
- bool ignore_failure = base::TestSuite::ShouldIgnoreFailure(*test_info);
+
+ bool ignore_failure = false;
+
+ // -1 exit code means a crash or hang. Never ignore those failures,
+ // they are serious and should always be visible.
+ if (exit_code != -1)
+ ignore_failure = base::TestSuite::ShouldIgnoreFailure(*test_info);
+
printer.OnTestEnd(test_info->name(), test_case->name(), true, true,
ignore_failure,
(base::Time::Now() - start_time).InMillisecondsF());
if (ignore_failure)
++ignored_failure_count;
- } else {
- printer.OnTestEnd(test_info->name(), test_case->name(), true, false,
- false,
- (base::Time::Now() - start_time).InMillisecondsF());
}
}
}