| Index: pkg/analysis_server/test/reflective_tests.dart
|
| diff --git a/pkg/analysis_server/test/reflective_tests.dart b/pkg/analysis_server/test/reflective_tests.dart
|
| index 107812e75f805b10f13c56627cf6e52f4b0cbb19..9be27ed1104e46f3c731e7b15d3336eb0857802c 100644
|
| --- a/pkg/analysis_server/test/reflective_tests.dart
|
| +++ b/pkg/analysis_server/test/reflective_tests.dart
|
| @@ -44,27 +44,39 @@ void runReflectiveTests(Type type) {
|
| if (memberMirror is! MethodMirror || !memberMirror.isRegularMethod) {
|
| return;
|
| }
|
| - // check name
|
| String memberName = MirrorSystem.getName(symbol);
|
| + // test_
|
| if (memberName.startsWith('test_')) {
|
| String testName = memberName.substring('test_'.length);
|
| test(testName, () {
|
| - InstanceMirror instanceMirror = classMirror.newInstance(new Symbol(''), []);
|
| - _invokeSymbolIfExists(instanceMirror, #setUp);
|
| - var testReturn = instanceMirror.invoke(symbol, []).reflectee;
|
| - if (testReturn is Future) {
|
| - return testReturn.whenComplete(() {
|
| - _invokeSymbolIfExists(instanceMirror, #tearDown);
|
| - });
|
| - } else {
|
| - _invokeSymbolIfExists(instanceMirror, #tearDown);
|
| - return testReturn;
|
| - }
|
| + _runTest(classMirror, symbol);
|
| + });
|
| + return;
|
| + }
|
| + // solo_test_
|
| + if (memberName.startsWith('solo_test_')) {
|
| + String testName = memberName.substring('solo_test_'.length);
|
| + solo_test(testName, () {
|
| + _runTest(classMirror, symbol);
|
| });
|
| }
|
| });
|
| }
|
|
|
| +void _runTest(ClassMirror classMirror, Symbol symbol) {
|
| + InstanceMirror instanceMirror = classMirror.newInstance(new Symbol(''), []);
|
| + _invokeSymbolIfExists(instanceMirror, #setUp);
|
| + var testReturn = instanceMirror.invoke(symbol, []).reflectee;
|
| + if (testReturn is Future) {
|
| + return testReturn.whenComplete(() {
|
| + _invokeSymbolIfExists(instanceMirror, #tearDown);
|
| + });
|
| + } else {
|
| + _invokeSymbolIfExists(instanceMirror, #tearDown);
|
| + return testReturn;
|
| + }
|
| +}
|
| +
|
|
|
| void _invokeSymbolIfExists(InstanceMirror instanceMirror, Symbol symbol) {
|
| try {
|
|
|