| 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 24 matching lines...) Expand all Loading... |
| 35 import "testing/dart/test_progress.dart"; | 35 import "testing/dart/test_progress.dart"; |
| 36 import "testing/dart/test_suite.dart"; | 36 import "testing/dart/test_suite.dart"; |
| 37 import "testing/dart/utils.dart"; | 37 import "testing/dart/utils.dart"; |
| 38 | 38 |
| 39 Future _deleteTemporaryDartDirectories() { | 39 Future _deleteTemporaryDartDirectories() { |
| 40 var completer = new Completer(); | 40 var completer = new Completer(); |
| 41 var environment = Platform.environment; | 41 var environment = Platform.environment; |
| 42 if (environment['DART_TESTING_DELETE_TEMPORARY_DIRECTORIES'] == '1') { | 42 if (environment['DART_TESTING_DELETE_TEMPORARY_DIRECTORIES'] == '1') { |
| 43 LeftOverTempDirPrinter.getLeftOverTemporaryDirectories().listen( | 43 LeftOverTempDirPrinter.getLeftOverTemporaryDirectories().listen( |
| 44 (FileSystemEntity tempEntity) { | 44 (FileSystemEntity tempEntity) { |
| 45 Directory tempDirectory = tempEntity as Directory; | 45 Directory tempDirectory = tempEntity as Directory; |
| 46 try { | 46 try { |
| 47 tempDirectory.deleteSync(recursive: true); | 47 tempDirectory.deleteSync(recursive: true); |
| 48 } catch (error) { | 48 } catch (error) { |
| 49 DebugLogger.error(error); | 49 DebugLogger.error(error); |
| 50 } | 50 } |
| 51 }, onDone: completer.complete); | 51 }, onDone: completer.complete); |
| 52 } else { | 52 } else { |
| 53 completer.complete(); | 53 completer.complete(); |
| 54 } | 54 } |
| 55 return completer.future; | 55 return completer.future; |
| 56 } | 56 } |
| 57 | 57 |
| 58 void main(List<String> arguments) { | 58 void main(List<String> arguments) { |
| 59 // This script is in [sdk]/tools. | 59 // This script is in [sdk]/tools. |
| 60 TestUtils.setDartDirUri(Platform.script.resolve('..')); | 60 TestUtils.setDartDirUri(Platform.script.resolve('..')); |
| 61 _deleteTemporaryDartDirectories().then((_) { | 61 _deleteTemporaryDartDirectories().then((_) { |
| 62 var optionsParser = new TestOptionsParser(); | 62 var optionsParser = new TestOptionsParser(); |
| 63 var configurations = optionsParser.parse(arguments); | 63 var configurations = optionsParser.parse(arguments); |
| 64 if (configurations != null && configurations.length > 0) { | 64 if (configurations != null && configurations.length > 0) { |
| 65 // All the testing is carried out asynchronously in tasks created by this | 65 // All the testing is carried out asynchronously in tasks created by this |
| 66 // call. | 66 // call. |
| 67 // TODO(26372): Ensure that all tasks complete before the returned future. | 67 // TODO(26372): Ensure that all tasks complete before the returned future. |
| 68 testConfigurations(configurations); | 68 testConfigurations(configurations); |
| 69 } | 69 } |
| 70 }); | 70 }); |
| 71 } | 71 } |
| OLD | NEW |