| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library analyzer.test.reflective_tests; | 5 library analyzer.test.reflective_tests; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 @MirrorsUsed(metaTargets: 'ReflectiveTest') | 8 @MirrorsUsed(metaTargets: 'ReflectiveTest') |
| 9 import 'dart:mirrors'; | 9 import 'dart:mirrors'; |
| 10 | 10 |
| 11 import 'package:unittest/unittest.dart'; | 11 import 'package:unittest/unittest.dart'; |
| 12 | 12 |
| 13 /** | 13 /** |
| 14 * A marker annotation used to instruct dart2js to keep reflection information |
| 15 * for the annotated classes. |
| 16 */ |
| 17 const ReflectiveTest reflectiveTest = const ReflectiveTest(); |
| 18 |
| 19 /** |
| 14 * Runs test methods existing in the given [type]. | 20 * Runs test methods existing in the given [type]. |
| 15 * | 21 * |
| 16 * Methods with names starting with `test` are run using [test] function. | 22 * Methods with names starting with `test` are run using [test] function. |
| 17 * Methods with names starting with `solo_test` are run using [solo_test] functi
on. | 23 * Methods with names starting with `solo_test` are run using [solo_test] functi
on. |
| 18 * | 24 * |
| 19 * Each method is run with a new instance of [type]. | 25 * Each method is run with a new instance of [type]. |
| 20 * So, [type] should have a default constructor. | 26 * So, [type] should have a default constructor. |
| 21 * | 27 * |
| 22 * If [type] declares method `setUp`, it methods will be invoked before any test | 28 * If [type] declares method `setUp`, it methods will be invoked before any test |
| 23 * method invocation. | 29 * method invocation. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 .whenComplete(() => _invokeSymbolIfExists(instanceMirror, #tearDown)); | 113 .whenComplete(() => _invokeSymbolIfExists(instanceMirror, #tearDown)); |
| 108 } | 114 } |
| 109 | 115 |
| 110 /** | 116 /** |
| 111 * A marker annotation used to instruct dart2js to keep reflection information | 117 * A marker annotation used to instruct dart2js to keep reflection information |
| 112 * for the annotated classes. | 118 * for the annotated classes. |
| 113 */ | 119 */ |
| 114 class ReflectiveTest { | 120 class ReflectiveTest { |
| 115 const ReflectiveTest(); | 121 const ReflectiveTest(); |
| 116 } | 122 } |
| 117 | |
| 118 /** | |
| 119 * A marker annotation used to instruct dart2js to keep reflection information | |
| 120 * for the annotated classes. | |
| 121 */ | |
| 122 const ReflectiveTest reflectiveTest = const ReflectiveTest(); | |
| OLD | NEW |