Index: tests/utils/source_mirrors_test.dart |
diff --git a/tests/utils/source_mirrors_test.dart b/tests/utils/source_mirrors_test.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f5875601771dc1739b3b4dcef1e47b7407f6af35 |
--- /dev/null |
+++ b/tests/utils/source_mirrors_test.dart |
@@ -0,0 +1,36 @@ |
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+// VMOptions= |
+// VMOptions=--print-object-histogram |
+ |
+// Smoke test of the dart2js compiler API. |
+library source_mirrors_test; |
+ |
+import 'dart:async'; |
+import "package:async_helper/async_helper.dart"; |
+ |
+import '../../sdk/lib/_internal/compiler/implementation/mirrors/analyze.dart'; |
+import 'dummy_compiler_test.dart'; |
+ |
+main() { |
+ asyncStart(); |
+ Future result = |
+ analyze([new Uri(scheme: 'main')], |
+ new Uri(scheme: 'lib', path: '/'), |
+ new Uri(scheme: 'package', path: '/'), |
+ provider, handler); |
+ result.then((mirrorSystem) { |
+ if (mirrorSystem == null) { |
+ throw 'Analysis failed'; |
+ } |
+ mirrorSystem.libraries.forEach((uri, library) { |
+ print(library); |
+ library.declarations.forEach((name, declaration) { |
+ print(' $name:$declaration'); |
+ }); |
+ }); |
+ }, onError: (e) { |
+ throw 'Analysis failed'; |
+ }).then(asyncSuccess); |
+} |