| 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 "dart:utf"; | 8 import "dart:utf"; |
| 9 import "../../../tools/testing/dart/test_runner.dart"; | 9 import "../../../tools/testing/dart/test_runner.dart"; |
| 10 import "../../../tools/testing/dart/test_suite.dart"; | 10 import "../../../tools/testing/dart/test_suite.dart"; |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 void done(TestCase test) { | 111 void done(TestCase test) { |
| 112 TestController.processCompletedTest(test); | 112 TestController.processCompletedTest(test); |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 | 115 |
| 116 void main() { | 116 void main() { |
| 117 // Run the test_runner_test if there are no command-line options. | 117 // Run the test_runner_test if there are no command-line options. |
| 118 // Otherwise, run one of the component tests that always pass, | 118 // Otherwise, run one of the component tests that always pass, |
| 119 // fail, or timeout. | 119 // fail, or timeout. |
| 120 var arguments = new Options().arguments; | 120 var arguments = new Options().arguments; |
| 121 arguments.remove('--no-fancy-stacks'); // The test runner can add this. |
| 121 if (arguments.isEmpty) { | 122 if (arguments.isEmpty) { |
| 122 testProcessQueue(); | 123 testProcessQueue(); |
| 123 } else { | 124 } else { |
| 124 switch (arguments[0]) { | 125 switch (arguments[0]) { |
| 125 case 'pass': | 126 case 'pass': |
| 126 return; | 127 return; |
| 127 case 'fail-unexpected': | 128 case 'fail-unexpected': |
| 128 case 'fail': | 129 case 'fail': |
| 129 throw "This test always fails, to test the test scripts."; | 130 throw "This test always fails, to test the test scripts."; |
| 130 break; | 131 break; |
| 131 case 'timeout': | 132 case 'timeout': |
| 132 // Run for 10 seconds, then exit. This tests a 2 second timeout. | 133 // Run for 10 seconds, then exit. This tests a 2 second timeout. |
| 133 new Timer(new Duration(seconds: 10), (){ }); | 134 new Timer(new Duration(seconds: 10), (){ }); |
| 134 break; | 135 break; |
| 135 default: | 136 default: |
| 136 throw "Unknown option ${arguments[0]} passed to test_runner_test"; | 137 throw "Unknown option ${arguments[0]} passed to test_runner_test"; |
| 137 } | 138 } |
| 138 } | 139 } |
| 139 } | 140 } |
| OLD | NEW |