| OLD | NEW |
| 1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
| 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
| 4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 /** | 6 /** |
| 7 * This file is the entrypoint of the dart test suite. This suite is used | 7 * This file is the entrypoint of the dart test suite. This suite is used |
| 8 * to test: | 8 * to test: |
| 9 * | 9 * |
| 10 * 1. the dart vm | 10 * 1. the dart vm |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 } | 225 } |
| 226 | 226 |
| 227 // Start all the HTTP servers required before starting the process queue. | 227 // Start all the HTTP servers required before starting the process queue. |
| 228 if (serverFutures.isEmpty) { | 228 if (serverFutures.isEmpty) { |
| 229 startProcessQueue(); | 229 startProcessQueue(); |
| 230 } else { | 230 } else { |
| 231 Future.wait(serverFutures).then((_) => startProcessQueue()); | 231 Future.wait(serverFutures).then((_) => startProcessQueue()); |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| 235 void main() { | 235 Future deleteTemporaryDartDirectories() { |
| 236 var optionsParser = new TestOptionsParser(); | 236 var completer = new Completer(); |
| 237 var configurations = optionsParser.parse(new Options().arguments); | 237 var environment = Platform.environment; |
| 238 if (configurations != null && configurations.length > 0) { | 238 if (environment['DART_TESTING_DELETE_TEMPORARY_DIRECTORIES'] == '1') { |
| 239 testConfigurations(configurations); | 239 Directory getTempDir() { |
| 240 // dir will be located in the system temporary directory. |
| 241 var dir = new Directory('').createTempSync(); |
| 242 var path = new Path(dir.path).directoryPath; |
| 243 dir.deleteSync(); |
| 244 return new Directory.fromPath(path); |
| 245 } |
| 246 |
| 247 // These are the patterns of temporary directory names created by |
| 248 // 'Directory.createTempSync()' on linux/macos and windows. |
| 249 var regExp; |
| 250 if (['macos', 'linux'].contains(Platform.operatingSystem)) { |
| 251 regExp = new RegExp(r'^temp_dir1_......$'); |
| 252 } else { |
| 253 regExp = new RegExp(r'tempdir-........-....-....-....-............$'); |
| 254 } |
| 255 |
| 256 getTempDir().list().listen((directoryEntry) { |
| 257 if (directoryEntry is Directory) { |
| 258 if (regExp.hasMatch(new Path(directoryEntry.path).filename)) { |
| 259 try { |
| 260 directoryEntry.deleteSync(recursive: true); |
| 261 } catch (error) { |
| 262 DebugLogger.error(error); |
| 263 } |
| 264 } |
| 265 } |
| 266 }, onDone: completer.complete()); |
| 267 } else { |
| 268 completer.complete(); |
| 240 } | 269 } |
| 270 return completer.future; |
| 241 } | 271 } |
| 242 | 272 |
| 273 void main() { |
| 274 deleteTemporaryDartDirectories().then((_) { |
| 275 var optionsParser = new TestOptionsParser(); |
| 276 var configurations = optionsParser.parse(new Options().arguments); |
| 277 if (configurations != null && configurations.length > 0) { |
| 278 testConfigurations(configurations); |
| 279 } |
| 280 }); |
| 281 } |
| 282 |
| OLD | NEW |