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

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

Issue 11066065: Add back in full exit code information. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 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("test_runner.dart"); 8 #import("test_runner.dart");
9 #import("test_suite.dart"); 9 #import("test_suite.dart");
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 } 80 }
81 } 81 }
82 82
83 void allDone() { 83 void allDone() {
84 _printFailureSummary(); 84 _printFailureSummary();
85 _printStatus(); 85 _printStatus();
86 _printTimingInformation(); 86 _printTimingInformation();
87 stdout.close(); 87 stdout.close();
88 stderr.close(); 88 stderr.close();
89 if (_failedTests > 0) exit(1); 89 exit(_failedTests > 0 ? 1 : 0);
90 } 90 }
91 91
92 void _printStartProgress(TestCase test) {} 92 void _printStartProgress(TestCase test) {}
93 void _printDoneProgress(TestCase test) {} 93 void _printDoneProgress(TestCase test) {}
94 94
95 String _pad(String s, int length) { 95 String _pad(String s, int length) {
96 StringBuffer buffer = new StringBuffer(); 96 StringBuffer buffer = new StringBuffer();
97 for (int i = s.length; i < length; i++) { 97 for (int i = s.length; i < length; i++) {
98 buffer.add(' '); 98 buffer.add(' ');
99 } 99 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 213
214 class SilentProgressIndicator extends ProgressIndicator { 214 class SilentProgressIndicator extends ProgressIndicator {
215 SilentProgressIndicator(Date startTime, bool printTiming) 215 SilentProgressIndicator(Date startTime, bool printTiming)
216 : super(startTime, printTiming); 216 : super(startTime, printTiming);
217 void testAdded() { } 217 void testAdded() { }
218 void start(TestCase test) { } 218 void start(TestCase test) { }
219 void done(TestCase test) { } 219 void done(TestCase test) { }
220 void _printStartProgress(TestCase test) { } 220 void _printStartProgress(TestCase test) { }
221 void _printDoneProgress(TestCase test) { } 221 void _printDoneProgress(TestCase test) { }
222 void allTestsKnown() { } 222 void allTestsKnown() { }
223 void allDone() { } 223 void allDone() {
224 exit(0);
225 }
224 } 226 }
225 227
226 abstract class CompactIndicator extends ProgressIndicator { 228 abstract class CompactIndicator extends ProgressIndicator {
227 CompactIndicator(Date startTime, bool printTiming) 229 CompactIndicator(Date startTime, bool printTiming)
228 : super(startTime, printTiming); 230 : super(startTime, printTiming);
229 231
230 void allDone() { 232 void allDone() {
231 stdout.write('\n'.charCodes()); 233 stdout.write('\n'.charCodes());
232 _printFailureSummary(); 234 _printFailureSummary();
233 _printTimingInformation(); 235 _printTimingInformation();
234 if (_failedTests > 0) { 236 if (_failedTests > 0) {
235 // We may have printed many failure logs, so reprint the summary data. 237 // We may have printed many failure logs, so reprint the summary data.
236 _printProgress(); 238 _printProgress();
237 print(''); 239 print('');
238 } 240 }
239 stdout.close(); 241 stdout.close();
240 stderr.close(); 242 stderr.close();
241 if (_failedTests > 0) exit(1); 243 exit(_failedTests > 0 ? 1 : 0);
242 } 244 }
243 245
244 void allTestsKnown() { 246 void allTestsKnown() {
245 if (!_allTestsKnown && SummaryReport.total > 0) { 247 if (!_allTestsKnown && SummaryReport.total > 0) {
246 // Clear progress indicator before printing summary report. 248 // Clear progress indicator before printing summary report.
247 stdout.write( 249 stdout.write(
248 '\r \r'.charCodes()); 250 '\r \r'.charCodes());
249 SummaryReport.printReport(); 251 SummaryReport.printReport();
250 } 252 }
251 _allTestsKnown = true; 253 _allTestsKnown = true;
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 print(''); 413 print('');
412 print('$key:'); 414 print('$key:');
413 lines.sort((a, b) => a.compareTo(b)); 415 lines.sort((a, b) => a.compareTo(b));
414 for (String line in lines) { 416 for (String line in lines) {
415 print(' $line'); 417 print(' $line');
416 } 418 }
417 }); 419 });
418 _printStatus(); 420 _printStatus();
419 } 421 }
420 } 422 }
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