Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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("test_runner.dart"); | 7 #import("test_runner.dart"); |
| 8 #import("test_suite.dart"); | 8 #import("test_suite.dart"); |
| 9 | 9 |
| 10 class ProgressIndicator { | 10 class ProgressIndicator { |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 CompactIndicator(Date startTime, bool printTiming) | 160 CompactIndicator(Date startTime, bool printTiming) |
| 161 : super(startTime, printTiming); | 161 : super(startTime, printTiming); |
| 162 | 162 |
| 163 void allDone() { | 163 void allDone() { |
| 164 stdout.write('\n'.charCodes()); | 164 stdout.write('\n'.charCodes()); |
| 165 _printTimingInformation(); | 165 _printTimingInformation(); |
| 166 stdout.close(); | 166 stdout.close(); |
| 167 exit(_failedTests > 0 ? 1 : 0); | 167 exit(_failedTests > 0 ? 1 : 0); |
| 168 } | 168 } |
| 169 | 169 |
| 170 void allTestsKnown() { | |
|
Bill Hesse
2012/01/12 12:53:36
Put a comment that this is a function override?
| |
| 171 if (!_allTestsKnown) { | |
| 172 // Clear progress indicator before printing summary report. | |
| 173 stdout.write( | |
| 174 '\r \r'.charCodes()); | |
|
Anders Johnsen
2012/01/12 14:25:25
Are we sure this number of spaces are sufficient?
| |
| 175 SummaryReport.printReport(); | |
| 176 } | |
| 177 _allTestsKnown = true; | |
| 178 } | |
| 179 | |
| 170 void _printStartProgress(TestCase test) => _printProgress(); | 180 void _printStartProgress(TestCase test) => _printProgress(); |
| 171 void _printDoneProgress(TestCase test) => _printProgress(); | 181 void _printDoneProgress(TestCase test) => _printProgress(); |
| 172 | 182 |
| 173 abstract void _printProgress(); | 183 abstract void _printProgress(); |
| 174 } | 184 } |
| 175 | 185 |
| 176 | 186 |
| 177 class CompactProgressIndicator extends CompactIndicator { | 187 class CompactProgressIndicator extends CompactIndicator { |
| 178 CompactProgressIndicator(Date startTime, bool printTiming) | 188 CompactProgressIndicator(Date startTime, bool printTiming) |
| 179 : super(startTime, printTiming); | 189 : super(startTime, printTiming); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 284 var status = 'pass'; | 294 var status = 'pass'; |
| 285 if (test.output.unexpectedOutput) { | 295 if (test.output.unexpectedOutput) { |
| 286 status = 'fail'; | 296 status = 'fail'; |
| 287 } | 297 } |
| 288 var percent = ((_completedTests() / _foundTests) * 100).toInt().toString(); | 298 var percent = ((_completedTests() / _foundTests) * 100).toInt().toString(); |
| 289 print('Done ${test.displayName}: $status'); | 299 print('Done ${test.displayName}: $status'); |
| 290 print('@@@STEP_CLEAR@@@'); | 300 print('@@@STEP_CLEAR@@@'); |
| 291 print('@@@STEP_TEXT@ $percent% +$_passedTests -$_failedTests @@@'); | 301 print('@@@STEP_TEXT@ $percent% +$_passedTests -$_failedTests @@@'); |
| 292 } | 302 } |
| 293 } | 303 } |
| OLD | NEW |