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

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

Issue 11032047: Fix issues with test.dart that appeared on Mac. (Closed) Base URL: https://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
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 var configuration = _tests[i].configurationString; 77 var configuration = _tests[i].configurationString;
78 print('${duration} - $configuration $name'); 78 print('${duration} - $configuration $name');
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 exit(_failedTests > 0 ? 1 : 0); 87 stdout.close();
88 stderr.close();
89 if (_failedTests) exit(1);
Emily Fortuna 2012/10/06 00:11:55 if(3) is equivalent to if(false). I fixed this in
Mads Ager (google) 2012/10/06 06:24:09 Thanks for the fix!
88 } 90 }
89 91
90 void _printStartProgress(TestCase test) {} 92 void _printStartProgress(TestCase test) {}
91 void _printDoneProgress(TestCase test) {} 93 void _printDoneProgress(TestCase test) {}
92 94
93 String _pad(String s, int length) { 95 String _pad(String s, int length) {
94 StringBuffer buffer = new StringBuffer(); 96 StringBuffer buffer = new StringBuffer();
95 for (int i = s.length; i < length; i++) { 97 for (int i = s.length; i < length; i++) {
96 buffer.add(' '); 98 buffer.add(' ');
97 } 99 }
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 210
209 class SilentProgressIndicator extends ProgressIndicator { 211 class SilentProgressIndicator extends ProgressIndicator {
210 SilentProgressIndicator(Date startTime, bool printTiming) 212 SilentProgressIndicator(Date startTime, bool printTiming)
211 : super(startTime, printTiming); 213 : super(startTime, printTiming);
212 void testAdded() { } 214 void testAdded() { }
213 void start(TestCase test) { } 215 void start(TestCase test) { }
214 void done(TestCase test) { } 216 void done(TestCase test) { }
215 void _printStartProgress(TestCase test) { } 217 void _printStartProgress(TestCase test) { }
216 void _printDoneProgress(TestCase test) { } 218 void _printDoneProgress(TestCase test) { }
217 void allTestsKnown() { } 219 void allTestsKnown() { }
218 void allDone() { 220 void allDone() { }
219 exit(0);
220 }
221 } 221 }
222 222
223 abstract class CompactIndicator extends ProgressIndicator { 223 abstract class CompactIndicator extends ProgressIndicator {
224 CompactIndicator(Date startTime, bool printTiming) 224 CompactIndicator(Date startTime, bool printTiming)
225 : super(startTime, printTiming); 225 : super(startTime, printTiming);
226 226
227 void allDone() { 227 void allDone() {
228 stdout.write('\n'.charCodes()); 228 stdout.write('\n'.charCodes());
229 _printFailureSummary(); 229 _printFailureSummary();
230 _printTimingInformation(); 230 _printTimingInformation();
231 if (_failedTests > 0) { 231 if (_failedTests > 0) {
232 // We may have printed many failure logs, so reprint the summary data. 232 // We may have printed many failure logs, so reprint the summary data.
233 _printProgress(); 233 _printProgress();
234 print(''); 234 print('');
235 } 235 }
236 stdout.close(); 236 stdout.close();
237 exit(_failedTests > 0 ? 1 : 0); 237 stderr.close();
238 if (_failedTests) exit(1);
238 } 239 }
239 240
240 void allTestsKnown() { 241 void allTestsKnown() {
241 if (!_allTestsKnown && SummaryReport.total > 0) { 242 if (!_allTestsKnown && SummaryReport.total > 0) {
242 // Clear progress indicator before printing summary report. 243 // Clear progress indicator before printing summary report.
243 stdout.write( 244 stdout.write(
244 '\r \r'.charCodes()); 245 '\r \r'.charCodes());
245 SummaryReport.printReport(); 246 SummaryReport.printReport();
246 } 247 }
247 _allTestsKnown = true; 248 _allTestsKnown = true;
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 print(''); 401 print('');
401 print('$key:'); 402 print('$key:');
402 lines.sort((a, b) => a.compareTo(b)); 403 lines.sort((a, b) => a.compareTo(b));
403 for (String line in lines) { 404 for (String line in lines) {
404 print(' $line'); 405 print(' $line');
405 } 406 }
406 }); 407 });
407 _printStatus(); 408 _printStatus();
408 } 409 }
409 } 410 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698