| 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:async"; | |
| 8 import "dart:io"; | 7 import "dart:io"; |
| 9 import "dart:io" as io; | 8 import "dart:io" as io; |
| 10 import "dart:convert" show JSON; | 9 import "dart:convert" show JSON; |
| 11 import "path.dart"; | 10 import "path.dart"; |
| 12 import "status_file_parser.dart"; | 11 import "status_file_parser.dart"; |
| 13 import "summary_report.dart"; | 12 import "summary_report.dart"; |
| 14 import "test_runner.dart"; | 13 import "test_runner.dart"; |
| 15 import "test_suite.dart"; | 14 import "test_suite.dart"; |
| 16 import "utils.dart"; | 15 import "utils.dart"; |
| 17 | 16 |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 } | 494 } |
| 496 | 495 |
| 497 void allDone() { | 496 void allDone() { |
| 498 if (_skippedCompilations > 0) { | 497 if (_skippedCompilations > 0) { |
| 499 print('\n$_skippedCompilations compilations were skipped because ' | 498 print('\n$_skippedCompilations compilations were skipped because ' |
| 500 'the previous output was already up to date\n'); | 499 'the previous output was already up to date\n'); |
| 501 } | 500 } |
| 502 } | 501 } |
| 503 } | 502 } |
| 504 | 503 |
| 505 class LeftOverTempDirPrinter extends EventListener { | |
| 506 final MIN_NUMBER_OF_TEMP_DIRS = 50; | |
| 507 | |
| 508 static RegExp _getTemporaryDirectoryRegexp() { | |
| 509 // These are the patterns of temporary directory names created by | |
| 510 // 'Directory.systemTemp.createTemp()' on linux/macos and windows. | |
| 511 if (['macos', 'linux'].contains(Platform.operatingSystem)) { | |
| 512 return new RegExp(r'^temp_dir1_......$'); | |
| 513 } else { | |
| 514 return new RegExp(r'tempdir-........-....-....-....-............$'); | |
| 515 } | |
| 516 } | |
| 517 | |
| 518 static Stream<FileSystemEntity> getLeftOverTemporaryDirectories() { | |
| 519 var regExp = _getTemporaryDirectoryRegexp(); | |
| 520 return Directory.systemTemp.list().where((FileSystemEntity fse) { | |
| 521 if (fse is Directory) { | |
| 522 if (regExp.hasMatch(new Path(fse.path).filename)) { | |
| 523 return true; | |
| 524 } | |
| 525 } | |
| 526 return false; | |
| 527 }); | |
| 528 } | |
| 529 | |
| 530 void allDone() { | |
| 531 getLeftOverTemporaryDirectories().length.then((int count) { | |
| 532 if (count > MIN_NUMBER_OF_TEMP_DIRS) { | |
| 533 DebugLogger.warning("There are ${count} directories " | |
| 534 "in the system tempdir " | |
| 535 "('${Directory.systemTemp.path}')! " | |
| 536 "Maybe left over directories?\n"); | |
| 537 } | |
| 538 }).catchError((error) { | |
| 539 DebugLogger.warning("Could not list temp directories, got: $error"); | |
| 540 }); | |
| 541 } | |
| 542 } | |
| 543 | |
| 544 class LineProgressIndicator extends EventListener { | 504 class LineProgressIndicator extends EventListener { |
| 545 void done(TestCase test) { | 505 void done(TestCase test) { |
| 546 var status = 'pass'; | 506 var status = 'pass'; |
| 547 if (test.unexpectedOutput) { | 507 if (test.unexpectedOutput) { |
| 548 status = 'fail'; | 508 status = 'fail'; |
| 549 } | 509 } |
| 550 print('Done ${test.configurationString} ${test.displayName}: $status'); | 510 print('Done ${test.configurationString} ${test.displayName}: $status'); |
| 551 } | 511 } |
| 552 } | 512 } |
| 553 | 513 |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 return new VerboseProgressIndicator(startTime); | 677 return new VerboseProgressIndicator(startTime); |
| 718 case 'status': | 678 case 'status': |
| 719 return new ProgressIndicator(startTime); | 679 return new ProgressIndicator(startTime); |
| 720 case 'buildbot': | 680 case 'buildbot': |
| 721 return new BuildbotProgressIndicator(startTime); | 681 return new BuildbotProgressIndicator(startTime); |
| 722 default: | 682 default: |
| 723 assert(false); | 683 assert(false); |
| 724 return null; | 684 return null; |
| 725 } | 685 } |
| 726 } | 686 } |
| OLD | NEW |