| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** Path to DRT executable. */ |
| 6 String drt; |
| 7 |
| 5 /** Whether to include elapsed time. */ | 8 /** Whether to include elapsed time. */ |
| 6 bool includeTime; | 9 bool includeTime; |
| 7 | 10 |
| 8 /** Whether to regenerate layout test files. */ | 11 /** Whether to regenerate layout test files. */ |
| 9 bool regenerate; | 12 bool regenerate; |
| 10 | 13 |
| 11 /** Whether to output test summary. */ | 14 /** Whether to output test summary. */ |
| 12 bool summarize; | 15 bool summarize; |
| 13 | 16 |
| 14 /** Whether to print results immediately as they come in. */ | 17 /** Whether to print results immediately as they come in. */ |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 187 |
| 185 void onDone(int passed, int failed, int errors, | 188 void onDone(int passed, int failed, int errors, |
| 186 List<unittest.TestCase> results, String uncaughtError) { | 189 List<unittest.TestCase> results, String uncaughtError) { |
| 187 unittest.TestCase test = results[0]; | 190 unittest.TestCase test = results[0]; |
| 188 parentPort.send([test.result, test.runningTime.inMilliseconds, | 191 parentPort.send([test.result, test.runningTime.inMilliseconds, |
| 189 test.message, test.stackTrace]); | 192 test.message, test.stackTrace]); |
| 190 } | 193 } |
| 191 } | 194 } |
| 192 | 195 |
| 193 var parentPort; | 196 var parentPort; |
| 194 var childTestMain; | |
| 195 runChildTest() { | 197 runChildTest() { |
| 196 port.receive((testName, sendport) { | 198 port.receive((testName, sendport) { |
| 197 parentPort = sendport; | 199 parentPort = sendport; |
| 198 unittest.configure(new TestRunnerChildConfiguration()); | 200 unittest.configure(new TestRunnerChildConfiguration()); |
| 199 unittest.groupSep = '###'; | 201 unittest.groupSep = '###'; |
| 200 unittest.group('', childTestMain); | 202 unittest.group('', test.main); |
| 201 unittest.filterTests(testName); | 203 unittest.filterTests(testName); |
| 202 unittest.runTests(); | 204 unittest.runTests(); |
| 203 }); | 205 }); |
| 204 } | 206 } |
| 205 | 207 |
| 206 var testNum; | 208 var testNum; |
| 207 var failed; | 209 var failed; |
| 208 var errors; | 210 var errors; |
| 209 var passed; | 211 var passed; |
| 210 | 212 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 } else if (excludeFilters.length > 0) { | 258 } else if (excludeFilters.length > 0) { |
| 257 for (var f in excludeFilters) { | 259 for (var f in excludeFilters) { |
| 258 if (name.indexOf(f) >= 0) return false; | 260 if (name.indexOf(f) >= 0) return false; |
| 259 } | 261 } |
| 260 return true; | 262 return true; |
| 261 } else { | 263 } else { |
| 262 return true; | 264 return true; |
| 263 } | 265 } |
| 264 } | 266 } |
| 265 | 267 |
| 266 runTests(testMain) { | 268 process(testMain, action) { |
| 267 childTestMain = testMain; | |
| 268 unittest.groupSep = '###'; | 269 unittest.groupSep = '###'; |
| 269 unittest.configure(new TestRunnerConfiguration()); | 270 unittest.configure(new TestRunnerConfiguration()); |
| 270 unittest.group('', testMain); | 271 unittest.group('', testMain); |
| 271 // Do any user-specified test filtering. | 272 // Do any user-specified test filtering. |
| 272 unittest.filterTests(filterTest); | 273 unittest.filterTests(filterTest); |
| 273 if (action == null) { | 274 action(); |
| 274 unittest.runTests(); | |
| 275 } else { | |
| 276 action(); | |
| 277 } | |
| 278 } | 275 } |
| OLD | NEW |