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

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

Issue 10155028: Fix error in test.dart where a process will be closed twice. (Closed) Base URL: https://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 | « no previous file | 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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 testCase.completed(); 544 testCase.completed();
545 } 545 }
546 } 546 }
547 547
548 /** 548 /**
549 * Process exit handler called at the end of every command. It internally 549 * Process exit handler called at the end of every command. It internally
550 * treats all but the last command as compilation steps. The last command is 550 * treats all but the last command as compilation steps. The last command is
551 * the actual test and its output is analyzed in [testComplete]. 551 * the actual test and its output is analyzed in [testComplete].
552 */ 552 */
553 void stepExitHandler(int exitCode) { 553 void stepExitHandler(int exitCode) {
554 process.close(); 554 try {
555 process.close();
556 } catch (ProcessException e) {
557 // If the process is already closed, continue.
558 }
555 int totalSteps = testCase.commands.length; 559 int totalSteps = testCase.commands.length;
556 String suffix =' (step $currentStep of $totalSteps)'; 560 String suffix =' (step $currentStep of $totalSteps)';
557 if (currentStep == totalSteps) { // done with test command 561 if (currentStep == totalSteps) { // done with test command
558 testComplete(exitCode); 562 testComplete(exitCode);
559 } else if (exitCode != 0) { 563 } else if (exitCode != 0) {
560 stderr.add('test.dart: Compilation failed$suffix, exit code $exitCode\n'); 564 stderr.add('test.dart: Compilation failed$suffix, exit code $exitCode\n');
561 testComplete(exitCode); 565 testComplete(exitCode);
562 } else { 566 } else {
563 stderr.add('test.dart: Compilation finished $suffix\n'); 567 stderr.add('test.dart: Compilation finished $suffix\n');
564 stdout.add('test.dart: Compilation finished $suffix\n'); 568 stdout.add('test.dart: Compilation finished $suffix\n');
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 // the developer doesn't waste his or her time trying to fix a bunch of 1143 // the developer doesn't waste his or her time trying to fix a bunch of
1140 // tests that appear to be broken but were actually just flakes that 1144 // tests that appear to be broken but were actually just flakes that
1141 // didn't get retried because there had already been one failure. 1145 // didn't get retried because there had already been one failure.
1142 bool allowRetry = _MAX_FAILED_NO_RETRY > _progress.numFailedTests; 1146 bool allowRetry = _MAX_FAILED_NO_RETRY > _progress.numFailedTests;
1143 new RunningProcess(test, allowRetry, this).start(); 1147 new RunningProcess(test, allowRetry, this).start();
1144 } 1148 }
1145 _numProcesses++; 1149 _numProcesses++;
1146 } 1150 }
1147 } 1151 }
1148 } 1152 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698