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

Side by Side Diff: tools/testing/dart/test_runner.dart

Issue 9949001: Improve help output and Windows VM hack. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/testing/dart/test_options.dart ('k') | no next file » | 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 Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * Classes and methods for executing tests. 6 * Classes and methods for executing tests.
7 * 7 *
8 * This module includes: 8 * This module includes:
9 * - Managing parallel execution of tests, including timeout checks. 9 * - Managing parallel execution of tests, including timeout checks.
10 * - Evaluating the output of each test as pass/fail/crash/timeout. 10 * - Evaluating the output of each test as pass/fail/crash/timeout.
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 class TestOutputImpl implements TestOutput { 201 class TestOutputImpl implements TestOutput {
202 TestCase testCase; 202 TestCase testCase;
203 int exitCode; 203 int exitCode;
204 bool timedOut; 204 bool timedOut;
205 bool failed = false; 205 bool failed = false;
206 List<String> stdout; 206 List<String> stdout;
207 List<String> stderr; 207 List<String> stderr;
208 Duration time; 208 Duration time;
209 List<String> diagnostics; 209 List<String> diagnostics;
210 210
211 /* A flag to indicate we have already printed a warning about ignoring the VM
Siggi Cherem (dart-lang) 2012/03/30 01:01:24 nit: use the style from all other comments /** *
212 * crash, to limit the amount of output produced per test.
213 */
214 bool alreadyPrintedWarning = false;
215
211 /** 216 /**
212 * Set to true if we encounter a condition in the output that indicates we 217 * Set to true if we encounter a condition in the output that indicates we
213 * need to rerun this test. 218 * need to rerun this test.
214 */ 219 */
215 bool requestRetry = false; 220 bool requestRetry = false;
216 221
217 // Don't call this constructor, call TestOutput.fromCase() to 222 // Don't call this constructor, call TestOutput.fromCase() to
218 // get anew TestOutput instance. 223 // get anew TestOutput instance.
219 TestOutputImpl(TestCase this.testCase, 224 TestOutputImpl(TestCase this.testCase,
220 int this.exitCode, 225 int this.exitCode,
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 return (exitCode != 0 && !hasCrashed); 269 return (exitCode != 0 && !hasCrashed);
265 } 270 }
266 271
267 // Reverse result of a negative test. 272 // Reverse result of a negative test.
268 bool get hasFailed() { 273 bool get hasFailed() {
269 // TODO(efortuna): This is a total hack to keep our buildbots (more) green 274 // TODO(efortuna): This is a total hack to keep our buildbots (more) green
270 // while the VM team solves Issue 2124. Remove when issue is fixed. 275 // while the VM team solves Issue 2124. Remove when issue is fixed.
271 if (new Platform().operatingSystem() == 'windows' && exitCode == 253) { 276 if (new Platform().operatingSystem() == 'windows' && exitCode == 253) {
272 for (String line in testCase.output.stdout) { 277 for (String line in testCase.output.stdout) {
273 if (line.startsWith('VM exited with signal 1073741819')) { 278 if (line.startsWith('VM exited with signal 1073741819')) {
274 print("WARNING: VM crashed on this test with signal 1073741819. " + 279 if (!alreadyPrintedWarning) {
275 "This is a fake pass!!"); 280 print("WARNING: VM crashed on this test with signal 1073741819. " +
276 if (testCase.expectedOutcomes.iterator().hasNext()) { 281 "This is a fake pass!!");
277 return testCase.expectedOutcomes.iterator().next() == FAIL ? false : 282 alreadyPrintedWarning = true;
278 true;
279 } 283 }
284 return false;
Siggi Cherem (dart-lang) 2012/03/30 01:01:24 should we use: return !testCase.isNegative;
280 } 285 }
281 } 286 }
282 } 287 }
283 return (testCase.isNegative ? !didFail : didFail); 288 return (testCase.isNegative ? !didFail : didFail);
284 } 289 }
285 290
286 } 291 }
287 292
288 class BrowserTestOutputImpl extends TestOutputImpl { 293 class BrowserTestOutputImpl extends TestOutputImpl {
289 BrowserTestOutputImpl(testCase, exitCode, timedOut, stdout, stderr, time) : 294 BrowserTestOutputImpl(testCase, exitCode, timedOut, stdout, stderr, time) :
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 // the developer doesn't waste his or her time trying to fix a bunch of 1133 // the developer doesn't waste his or her time trying to fix a bunch of
1129 // tests that appear to be broken but were actually just flakes that 1134 // tests that appear to be broken but were actually just flakes that
1130 // didn't get retried because there had already been one failure. 1135 // didn't get retried because there had already been one failure.
1131 bool allowRetry = _MAX_FAILED_NO_RETRY > _progress.numFailedTests; 1136 bool allowRetry = _MAX_FAILED_NO_RETRY > _progress.numFailedTests;
1132 new RunningProcess(test, allowRetry, this).start(); 1137 new RunningProcess(test, allowRetry, this).start();
1133 } 1138 }
1134 _numProcesses++; 1139 _numProcesses++;
1135 } 1140 }
1136 } 1141 }
1137 } 1142 }
OLDNEW
« no previous file with comments | « tools/testing/dart/test_options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698