| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "dart:io" as io; |
| 9 import "http_server.dart" as http_server; | 9 import "http_server.dart" as http_server; |
| 10 import "status_file_parser.dart"; | 10 import "status_file_parser.dart"; |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 onDone: () { | 336 onDone: () { |
| 337 if (count > MIN_NUMBER_OF_TEMP_DIRS) { | 337 if (count > MIN_NUMBER_OF_TEMP_DIRS) { |
| 338 DebugLogger.warning("There are ${count} directories " | 338 DebugLogger.warning("There are ${count} directories " |
| 339 "in the system tempdir ('$systemTempDir')! " | 339 "in the system tempdir ('$systemTempDir')! " |
| 340 "Maybe left over directories?\n"); | 340 "Maybe left over directories?\n"); |
| 341 } | 341 } |
| 342 }); | 342 }); |
| 343 } | 343 } |
| 344 } | 344 } |
| 345 | 345 |
| 346 class LineProgressIndicator extends EventListener implements ProgressIndicator { | 346 class LineProgressIndicator extends EventListener { |
| 347 void done(TestCase test) { | 347 void done(TestCase test) { |
| 348 var status = 'pass'; | 348 var status = 'pass'; |
| 349 if (test.lastCommandOutput.unexpectedOutput) { | 349 if (test.lastCommandOutput.unexpectedOutput) { |
| 350 status = 'fail'; | 350 status = 'fail'; |
| 351 } | 351 } |
| 352 print('Done ${test.configurationString} ${test.displayName}: $status'); | 352 print('Done ${test.configurationString} ${test.displayName}: $status'); |
| 353 } | 353 } |
| 354 } | 354 } |
| 355 | 355 |
| 356 class TestFailurePrinter extends EventListener { | 356 class TestFailurePrinter extends EventListener { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 388 |
| 389 print(_buildSummaryEnd(_failedTests)); | 389 print(_buildSummaryEnd(_failedTests)); |
| 390 } | 390 } |
| 391 } | 391 } |
| 392 } | 392 } |
| 393 } | 393 } |
| 394 | 394 |
| 395 class ProgressIndicator extends EventListener { | 395 class ProgressIndicator extends EventListener { |
| 396 ProgressIndicator(this._startTime); | 396 ProgressIndicator(this._startTime); |
| 397 | 397 |
| 398 factory ProgressIndicator.fromName(String name, | |
| 399 DateTime startTime, | |
| 400 Formatter formatter) { | |
| 401 switch (name) { | |
| 402 case 'compact': | |
| 403 return new CompactProgressIndicator(startTime, formatter); | |
| 404 case 'line': | |
| 405 return new LineProgressIndicator(); | |
| 406 case 'verbose': | |
| 407 return new VerboseProgressIndicator(startTime); | |
| 408 case 'status': | |
| 409 return new ProgressIndicator(startTime); | |
| 410 case 'buildbot': | |
| 411 return new BuildbotProgressIndicator(startTime); | |
| 412 default: | |
| 413 assert(false); | |
| 414 break; | |
| 415 } | |
| 416 } | |
| 417 | 398 |
| 418 void testAdded() { _foundTests++; } | 399 void testAdded() { _foundTests++; } |
| 419 | 400 |
| 420 void start(TestCase test) { | 401 void start(TestCase test) { |
| 421 _printStartProgress(test); | 402 _printStartProgress(test); |
| 422 } | 403 } |
| 423 | 404 |
| 424 void done(TestCase test) { | 405 void done(TestCase test) { |
| 425 if (test.lastCommandOutput.unexpectedOutput) { | 406 if (test.lastCommandOutput.unexpectedOutput) { |
| 426 _failedTests++; | 407 _failedTests++; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 print('@@@BUILD_STEP $stepName failures@@@'); | 516 print('@@@BUILD_STEP $stepName failures@@@'); |
| 536 } | 517 } |
| 537 for (String line in _failureSummary) { | 518 for (String line in _failureSummary) { |
| 538 print(line); | 519 print(line); |
| 539 } | 520 } |
| 540 print(''); | 521 print(''); |
| 541 } | 522 } |
| 542 print(_buildSummaryEnd(_failedTests)); | 523 print(_buildSummaryEnd(_failedTests)); |
| 543 } | 524 } |
| 544 } | 525 } |
| 526 |
| 527 |
| 528 EventListener progressIndicatorFromName(String name, |
| 529 DateTime startTime, |
| 530 Formatter formatter) { |
| 531 switch (name) { |
| 532 case 'compact': |
| 533 return new CompactProgressIndicator(startTime, formatter); |
| 534 case 'line': |
| 535 return new LineProgressIndicator(); |
| 536 case 'verbose': |
| 537 return new VerboseProgressIndicator(startTime); |
| 538 case 'status': |
| 539 return new ProgressIndicator(startTime); |
| 540 case 'buildbot': |
| 541 return new BuildbotProgressIndicator(startTime); |
| 542 default: |
| 543 assert(false); |
| 544 break; |
| 545 } |
| 546 } |
| OLD | NEW |