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 import "dart:io"; | 5 import "dart:io"; |
6 import "dart:isolate"; | 6 import "dart:isolate"; |
7 import "dart:async"; | 7 import "dart:async"; |
8 import "../../../tools/testing/dart/test_runner.dart"; | 8 import "../../../tools/testing/dart/test_runner.dart"; |
9 import "../../../tools/testing/dart/test_suite.dart"; | 9 import "../../../tools/testing/dart/test_suite.dart"; |
10 import "../../../tools/testing/dart/test_progress.dart" as progress; | 10 import "../../../tools/testing/dart/test_progress.dart" as progress; |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 [new EventListener()], TestController.finished); | 134 [new EventListener()], TestController.finished); |
135 } | 135 } |
136 | 136 |
137 class EventListener extends progress.EventListener{ | 137 class EventListener extends progress.EventListener{ |
138 void done(TestCase test) { | 138 void done(TestCase test) { |
139 TestController.processCompletedTest(test); | 139 TestController.processCompletedTest(test); |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 void main(List<String> arguments) { | 143 void main(List<String> arguments) { |
| 144 // This script is in [sdk]/tests/standalone/io. |
| 145 TestUtils.setDartDirUri(Platform.script.resolve('../../..')); |
144 // Run the test_runner_test if there are no command-line options. | 146 // Run the test_runner_test if there are no command-line options. |
145 // Otherwise, run one of the component tests that always pass, | 147 // Otherwise, run one of the component tests that always pass, |
146 // fail, or timeout. | 148 // fail, or timeout. |
147 if (arguments.isEmpty) { | 149 if (arguments.isEmpty) { |
148 testProcessQueue(); | 150 testProcessQueue(); |
149 } else { | 151 } else { |
150 switch (arguments[0]) { | 152 switch (arguments[0]) { |
151 case 'pass': | 153 case 'pass': |
152 return; | 154 return; |
153 case 'fail-unexpected': | 155 case 'fail-unexpected': |
154 case 'fail': | 156 case 'fail': |
155 throw "This test always fails, to test the test scripts."; | 157 throw "This test always fails, to test the test scripts."; |
156 break; | 158 break; |
157 case 'timeout': | 159 case 'timeout': |
158 // This process should be killed by the test after DEFAULT_TIMEOUT | 160 // This process should be killed by the test after DEFAULT_TIMEOUT |
159 new Timer(new Duration(hours: 42), (){ }); | 161 new Timer(new Duration(hours: 42), (){ }); |
160 break; | 162 break; |
161 default: | 163 default: |
162 throw "Unknown option ${arguments[0]} passed to test_runner_test"; | 164 throw "Unknown option ${arguments[0]} passed to test_runner_test"; |
163 } | 165 } |
164 } | 166 } |
165 } | 167 } |
OLD | NEW |