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

Unified Diff: tools/testing/dart/test_runner.dart

Issue 26162007: Remove unittest-based wrapping from our testing scripts (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months 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
« no previous file with comments | « tools/testing/dart/browser_test.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_runner.dart
diff --git a/tools/testing/dart/test_runner.dart b/tools/testing/dart/test_runner.dart
index 6578e99182e6dae37d0951d6088affe520b494bc..e84b051b62a455c3b14002dde42cf35d920d1e3c 100644
--- a/tools/testing/dart/test_runner.dart
+++ b/tools/testing/dart/test_runner.dart
@@ -272,6 +272,7 @@ class ContentShellCommand extends Command {
if (needDartFlags) {
env = new Map<String, String>();
env['DART_FLAGS'] = dartFlags.join(" ");
+ env['DART_FORWARDING_PRINT'] = '1';
}
return env;
@@ -801,7 +802,6 @@ class BrowserCommandOutputImpl extends CommandOutputImpl {
return Expectation.MISSING_RUNTIME_ERROR;
}
}
-
if (testCase.isNegative) {
if (outcome.canBeOutcomeOf(Expectation.FAIL)) return Expectation.PASS;
return Expectation.FAIL;
@@ -914,23 +914,48 @@ class BrowserCommandOutputImpl extends CommandOutputImpl {
bool get _browserTestFailure {
// Browser tests fail unless stdout contains
// 'Content-Type: text/plain' followed by 'PASS'.
- bool has_content_type = false;
+ bool hasContentType = false;
var stdoutLines = decodeUtf8(super.stdout).split("\n");
+ var containsFail = false;
+ var containsPass = false;
for (String line in stdoutLines) {
switch (line) {
case 'Content-Type: text/plain':
- has_content_type = true;
+ hasContentType = true;
+ break;
+ case 'FAIL':
+ if (hasContentType) {
+ containsFail = true;
+ }
break;
case 'PASS':
- if (has_content_type) {
- if (exitCode != 0) {
- print("Warning: All tests passed, but exitCode != 0 ($this)");
- }
- return (exitCode != 0 && !hasCrashed);
+ if (hasContentType) {
+ containsPass = true;
}
break;
}
}
+ if (hasContentType) {
+ if (containsFail && containsPass) {
+ DebugLogger.warning("Test had 'FAIL' and 'PASS' in stdout. ($command)");
+ }
+ if (!containsFail && !containsPass) {
+ DebugLogger.warning("Test had neither 'FAIL' nor 'PASS' in stdout. "
+ "($command)");
+ return true;
+ }
+ if (containsFail) {
+ return true;
+ }
+ assert(containsPass);
+ if (exitCode != 0) {
+ DebugLogger.warning("All tests passed, but exitCode != 0. "
+ "($command)");
+ }
+ return (exitCode != 0 && !hasCrashed);
+ }
+ DebugLogger.warning("Couldn't find 'Content-Type: text/plain' in output. "
+ "($command).");
return true;
}
}
« no previous file with comments | « tools/testing/dart/browser_test.dart ('k') | tools/testing/dart/test_suite.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698