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

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

Issue 12026013: Don't exit() in test_progress but rather set io.exitCode (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 library test_progress; 5 library test_progress;
6 6
7 import "dart:io"; 7 import "dart:io";
8 import "dart:io" as io;
8 import "http_server.dart" as http_server; 9 import "http_server.dart" as http_server;
9 import "status_file_parser.dart"; 10 import "status_file_parser.dart";
10 import "test_runner.dart"; 11 import "test_runner.dart";
11 import "test_suite.dart"; 12 import "test_suite.dart";
12 import "utils.dart"; 13 import "utils.dart";
13 14
14 class ProgressIndicator { 15 class ProgressIndicator {
15 ProgressIndicator(this._startTime, this._printTiming) 16 ProgressIndicator(this._startTime, this._printTiming)
16 : _tests = [], _failureSummary = []; 17 : _tests = [], _failureSummary = [];
17 18
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 104 }
104 } 105 }
105 106
106 void allDone() { 107 void allDone() {
107 _printFailureSummary(); 108 _printFailureSummary();
108 _printStatus(); 109 _printStatus();
109 _printSkippedCompilationInfo(); 110 _printSkippedCompilationInfo();
110 _printTimingInformation(); 111 _printTimingInformation();
111 stdout.close(); 112 stdout.close();
112 stderr.close(); 113 stderr.close();
113 if (_failedTests > 0) exit(1); 114 if (_failedTests > 0) {
115 io.exitCode = 1;
116 }
114 } 117 }
115 118
116 void _printStartProgress(TestCase test) {} 119 void _printStartProgress(TestCase test) {}
117 void _printDoneProgress(TestCase test) {} 120 void _printDoneProgress(TestCase test) {}
118 121
119 String _pad(String s, int length) { 122 String _pad(String s, int length) {
120 StringBuffer buffer = new StringBuffer(); 123 StringBuffer buffer = new StringBuffer();
121 for (int i = s.length; i < length; i++) { 124 for (int i = s.length; i < length; i++) {
122 buffer.add(' '); 125 buffer.add(' ');
123 } 126 }
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 _printFailureSummary(); 283 _printFailureSummary();
281 _printSkippedCompilationInfo(); 284 _printSkippedCompilationInfo();
282 _printTimingInformation(); 285 _printTimingInformation();
283 if (_failedTests > 0) { 286 if (_failedTests > 0) {
284 // We may have printed many failure logs, so reprint the summary data. 287 // We may have printed many failure logs, so reprint the summary data.
285 _printProgress(); 288 _printProgress();
286 print(''); 289 print('');
287 } 290 }
288 stdout.close(); 291 stdout.close();
289 stderr.close(); 292 stderr.close();
290 if (_failedTests > 0) exit(1); 293 if (_failedTests > 0) {
294 io.exitCode = 1;
295 }
291 } 296 }
292 297
293 void allTestsKnown() { 298 void allTestsKnown() {
294 if (!_allTestsKnown && SummaryReport.total > 0) { 299 if (!_allTestsKnown && SummaryReport.total > 0) {
295 // Clear progress indicator before printing summary report. 300 // Clear progress indicator before printing summary report.
296 stdout.write( 301 stdout.write(
297 '\r \r'.charCodes); 302 '\r \r'.charCodes);
298 SummaryReport.printReport(); 303 SummaryReport.printReport();
299 } 304 }
300 _allTestsKnown = true; 305 _allTestsKnown = true;
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 print(''); 495 print('');
491 print('$config:'); 496 print('$config:');
492 statuses.sort((a, b) => a.compareTo(b)); 497 statuses.sort((a, b) => a.compareTo(b));
493 for (String status in statuses) { 498 for (String status in statuses) {
494 print(' $status'); 499 print(' $status');
495 } 500 }
496 }); 501 });
497 _printStatus(); 502 _printStatus();
498 } 503 }
499 } 504 }
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