Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(586)

Unified Diff: pkg/analysis_server/test/reflective_tests.dart

Issue 314413004: A simple B+Tree implementation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: tweaks Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/test/index/btree_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « pkg/analysis_server/test/index/btree_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698