| 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 /// A test library for testing test libraries? We must go deeper. | 5 /// A test library for testing test libraries? We must go deeper. |
| 6 /// | 6 /// |
| 7 /// Since unit testing code tends to use a lot of global state, it can be tough | 7 /// Since unit testing code tends to use a lot of global state, it can be tough |
| 8 /// to test. This library manages it by running each test case in a child | 8 /// to test. This library manages it by running each test case in a child |
| 9 /// isolate, then reporting the results back to the parent isolate. | 9 /// isolate, then reporting the results back to the parent isolate. |
| 10 library metatest; | 10 library metatest; |
| 11 | 11 |
| 12 import 'dart:async'; | 12 import 'dart:async'; |
| 13 import 'dart:isolate'; | 13 import 'dart:isolate'; |
| 14 | 14 |
| 15 import 'package:pathos/path.dart' as path; | 15 import '../../../pkg/pathos/lib/path.dart' as path; |
| 16 import 'package:unittest/unittest.dart'; | 16 import '../../../pkg/unittest/lib/unittest.dart'; |
| 17 | 17 |
| 18 import 'utils.dart'; | 18 import 'utils.dart'; |
| 19 | 19 |
| 20 // TODO(nweiz): get rid of this once issue 8863 is fixed. | 20 // TODO(nweiz): get rid of this once issue 8863 is fixed. |
| 21 /// The path to the Dart executable. This is only set in a child isolate. | 21 /// The path to the Dart executable. This is only set in a child isolate. |
| 22 String get dartExecutable => _executable; | 22 String get dartExecutable => _executable; |
| 23 String _executable; | 23 String _executable; |
| 24 | 24 |
| 25 /// Declares a test with the given [description] and [body]. [body] corresponds | 25 /// Declares a test with the given [description] and [body]. [body] corresponds |
| 26 /// to the `main` method of a test file, and will be run in an isolate. By | 26 /// to the `main` method of a test file, and will be run in an isolate. By |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 "message": testCase.message, | 205 "message": testCase.message, |
| 206 "result": testCase.result, | 206 "result": testCase.result, |
| 207 "stackTrace": testCase.stackTrace | 207 "stackTrace": testCase.stackTrace |
| 208 }).toList() | 208 }).toList() |
| 209 }); | 209 }); |
| 210 } | 210 } |
| 211 | 211 |
| 212 void onInit() {} | 212 void onInit() {} |
| 213 void onDone(bool success) {} | 213 void onDone(bool success) {} |
| 214 } | 214 } |
| OLD | NEW |