| Index: tools/test.dart
|
| diff --git a/tools/test.dart b/tools/test.dart
|
| index 24da3d250377561477c650942e96857bd4be333e..43821872f34f65a13b8fbe2e28178f6819197072 100755
|
| --- a/tools/test.dart
|
| +++ b/tools/test.dart
|
| @@ -262,34 +262,14 @@ Future deleteTemporaryDartDirectories() {
|
| var completer = new Completer();
|
| var environment = Platform.environment;
|
| if (environment['DART_TESTING_DELETE_TEMPORARY_DIRECTORIES'] == '1') {
|
| - Directory getTempDir() {
|
| - // dir will be located in the system temporary directory.
|
| - var dir = new Directory('').createTempSync();
|
| - var path = new Path(dir.path).directoryPath;
|
| - dir.deleteSync();
|
| - return new Directory(path.toNativePath());
|
| - }
|
| -
|
| - // These are the patterns of temporary directory names created by
|
| - // 'Directory.createTempSync()' on linux/macos and windows.
|
| - var regExp;
|
| - if (['macos', 'linux'].contains(Platform.operatingSystem)) {
|
| - regExp = new RegExp(r'^temp_dir1_......$');
|
| - } else {
|
| - regExp = new RegExp(r'tempdir-........-....-....-....-............$');
|
| - }
|
| -
|
| - getTempDir().list().listen((directoryEntry) {
|
| - if (directoryEntry is Directory) {
|
| - if (regExp.hasMatch(new Path(directoryEntry.path).filename)) {
|
| + LeftOverTempDirPrinter.getLeftOverTemporaryDirectories().listen(
|
| + (Directory tempDirectory) {
|
| try {
|
| - directoryEntry.deleteSync(recursive: true);
|
| + tempDirectory.deleteSync(recursive: true);
|
| } catch (error) {
|
| DebugLogger.error(error);
|
| }
|
| - }
|
| - }
|
| - }, onDone: completer.complete);
|
| + }, onDone: completer.complete);
|
| } else {
|
| completer.complete();
|
| }
|
|
|