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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 enqueueTestCase(testCaseTimeout); | 78 enqueueTestCase(testCaseTimeout); |
79 enqueueTestCase(testCaseFailUnexpected); | 79 enqueueTestCase(testCaseFailUnexpected); |
80 | 80 |
81 if (onDone != null) { | 81 if (onDone != null) { |
82 onDone(); | 82 onDone(); |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
86 TestCase _makeNormalTestCase(name, expectations) { | 86 TestCase _makeNormalTestCase(name, expectations) { |
87 var command = CommandBuilder.instance.getProcessCommand( | 87 var command = CommandBuilder.instance.getProcessCommand( |
88 'custom', Platform.executable, [Platform.script.toFilePath(), name], | 88 'custom', Platform.executable, |
| 89 ['--package-root=${Platform.packageRoot}', Platform.script.toFilePath(),
name], |
89 {}); | 90 {}); |
90 return _makeTestCase(name, DEFAULT_TIMEOUT, command, expectations); | 91 return _makeTestCase(name, DEFAULT_TIMEOUT, command, expectations); |
91 } | 92 } |
92 | 93 |
93 _makeCrashTestCase(name, expectations) { | 94 _makeCrashTestCase(name, expectations) { |
94 var crashCommand = CommandBuilder.instance.getProcessCommand( | 95 var crashCommand = CommandBuilder.instance.getProcessCommand( |
95 'custom_crash', getProcessTestFileName(), ["0", "0", "1", "1"], | 96 'custom_crash', getProcessTestFileName(), ["0", "0", "1", "1"], |
96 {}); | 97 {}); |
97 // The crash test sometimes times out. Run it with a large timeout | 98 // The crash test sometimes times out. Run it with a large timeout |
98 // to help diagnose the delay. | 99 // to help diagnose the delay. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 break; | 144 break; |
144 case 'timeout': | 145 case 'timeout': |
145 // This process should be killed by the test after DEFAULT_TIMEOUT | 146 // This process should be killed by the test after DEFAULT_TIMEOUT |
146 new Timer(new Duration(hours: 42), (){ }); | 147 new Timer(new Duration(hours: 42), (){ }); |
147 break; | 148 break; |
148 default: | 149 default: |
149 throw "Unknown option ${arguments[0]} passed to test_runner_test"; | 150 throw "Unknown option ${arguments[0]} passed to test_runner_test"; |
150 } | 151 } |
151 } | 152 } |
152 } | 153 } |
OLD | NEW |