| 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"; | |
| 7 import "dart:async"; | 6 import "dart:async"; |
| 7 import "../../../tools/testing/dart/configuration.dart"; |
| 8 import "../../../tools/testing/dart/expectation.dart"; | 8 import "../../../tools/testing/dart/expectation.dart"; |
| 9 import "../../../tools/testing/dart/options.dart"; | 9 import "../../../tools/testing/dart/options.dart"; |
| 10 import "../../../tools/testing/dart/status_file.dart"; | |
| 11 import "../../../tools/testing/dart/test_runner.dart"; | 10 import "../../../tools/testing/dart/test_runner.dart"; |
| 12 import "../../../tools/testing/dart/test_suite.dart"; | 11 import "../../../tools/testing/dart/test_suite.dart"; |
| 13 import "../../../tools/testing/dart/test_progress.dart" as progress; | 12 import "../../../tools/testing/dart/test_progress.dart" as progress; |
| 14 import "process_test_util.dart"; | 13 import "process_test_util.dart"; |
| 15 | 14 |
| 16 final DEFAULT_TIMEOUT = 20; | 15 final DEFAULT_TIMEOUT = 20; |
| 17 final LONG_TIMEOUT = 30; | 16 final LONG_TIMEOUT = 30; |
| 18 | 17 |
| 19 List<String> packageOptions() { | 18 List<String> packageOptions() { |
| 20 if (Platform.packageRoot != null) { | 19 if (Platform.packageRoot != null) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 59 |
| 61 static void finished() { | 60 static void finished() { |
| 62 if (numTests != numCompletedTests) { | 61 if (numTests != numCompletedTests) { |
| 63 throw "bad completion count. " | 62 throw "bad completion count. " |
| 64 "expected: $numTests, actual: $numCompletedTests"; | 63 "expected: $numTests, actual: $numCompletedTests"; |
| 65 } | 64 } |
| 66 } | 65 } |
| 67 } | 66 } |
| 68 | 67 |
| 69 class CustomTestSuite extends TestSuite { | 68 class CustomTestSuite extends TestSuite { |
| 70 CustomTestSuite(Map configuration) : super(configuration, "CustomTestSuite"); | 69 CustomTestSuite(Configuration configuration) |
| 70 : super(configuration, "CustomTestSuite"); |
| 71 | 71 |
| 72 Future forEachTest(TestCaseEvent onTest, Map testCache, [onDone]) { | 72 Future forEachTest(TestCaseEvent onTest, Map testCache, [onDone]) { |
| 73 void enqueueTestCase(testCase) { | 73 void enqueueTestCase(testCase) { |
| 74 TestController.numTests++; | 74 TestController.numTests++; |
| 75 onTest(testCase); | 75 onTest(testCase); |
| 76 } | 76 } |
| 77 | 77 |
| 78 var testCaseCrash = _makeCrashTestCase("crash", [Expectation.crash]); | 78 var testCaseCrash = _makeCrashTestCase("crash", [Expectation.crash]); |
| 79 var testCasePass = _makeNormalTestCase("pass", [Expectation.pass]); | 79 var testCasePass = _makeNormalTestCase("pass", [Expectation.pass]); |
| 80 var testCaseFail = _makeNormalTestCase("fail", [Expectation.fail]); | 80 var testCaseFail = _makeNormalTestCase("fail", [Expectation.fail]); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 break; | 159 break; |
| 160 case 'timeout': | 160 case 'timeout': |
| 161 // This process should be killed by the test after DEFAULT_TIMEOUT | 161 // This process should be killed by the test after DEFAULT_TIMEOUT |
| 162 new Timer(new Duration(hours: 42), () {}); | 162 new Timer(new Duration(hours: 42), () {}); |
| 163 break; | 163 break; |
| 164 default: | 164 default: |
| 165 throw "Unknown option ${arguments[0]} passed to test_runner_test"; | 165 throw "Unknown option ${arguments[0]} passed to test_runner_test"; |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 } | 168 } |
| OLD | NEW |