Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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) exit(1); | 89 if (_failedTests > 0) exit(1); |
|
Mads Ager (google)
2012/10/06 06:16:36
Oh my. :(
Ivan Posva
2012/10/11 04:40:39
Shouldn't this have failed in checked mode? Maybe
| |
| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 stderr.close(); | 237 stderr.close(); |
| 238 if (_failedTests) exit(1); | 238 if (_failedTests > 0) exit(1); |
| 239 } | 239 } |
| 240 | 240 |
| 241 void allTestsKnown() { | 241 void allTestsKnown() { |
| 242 if (!_allTestsKnown && SummaryReport.total > 0) { | 242 if (!_allTestsKnown && SummaryReport.total > 0) { |
| 243 // Clear progress indicator before printing summary report. | 243 // Clear progress indicator before printing summary report. |
| 244 stdout.write( | 244 stdout.write( |
| 245 '\r \r'.charCodes()); | 245 '\r \r'.charCodes()); |
| 246 SummaryReport.printReport(); | 246 SummaryReport.printReport(); |
| 247 } | 247 } |
| 248 _allTestsKnown = true; | 248 _allTestsKnown = true; |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 401 print(''); | 401 print(''); |
| 402 print('$key:'); | 402 print('$key:'); |
| 403 lines.sort((a, b) => a.compareTo(b)); | 403 lines.sort((a, b) => a.compareTo(b)); |
| 404 for (String line in lines) { | 404 for (String line in lines) { |
| 405 print(' $line'); | 405 print(' $line'); |
| 406 } | 406 } |
| 407 }); | 407 }); |
| 408 _printStatus(); | 408 _printStatus(); |
| 409 } | 409 } |
| 410 } | 410 } |
| OLD | NEW |