OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // Smoke test of the dart2js compiler API. | 5 // Smoke test of the dart2js compiler API. |
6 library analyze_only; | 6 library analyze_only; |
7 | 7 |
8 import "package:expect/expect.dart"; | 8 import "package:expect/expect.dart"; |
9 import 'dart:async'; | 9 import 'dart:async'; |
10 import "package:async_helper/async_helper.dart"; | 10 import "package:async_helper/async_helper.dart"; |
11 | 11 |
12 import '../../utils/dummy_compiler_test.dart' as dummy; | 12 import '../../utils/dummy_compiler_test.dart' as dummy; |
13 import 'package:compiler/compiler.dart'; | 13 import 'package:compiler/compiler.dart'; |
14 | 14 |
15 import 'package:compiler/src/messages.dart' show | 15 import 'package:compiler/src/diagnostics/messages.dart' show |
16 MessageKind, MessageTemplate; | 16 MessageKind, MessageTemplate; |
17 | 17 |
18 import 'output_collector.dart'; | 18 import 'output_collector.dart'; |
19 | 19 |
20 runCompiler(String main, List<String> options, | 20 runCompiler(String main, List<String> options, |
21 onValue(String code, List errors, List warnings)) { | 21 onValue(String code, List errors, List warnings)) { |
22 List errors = new List(); | 22 List errors = new List(); |
23 List warnings = new List(); | 23 List warnings = new List(); |
24 | 24 |
25 Future<String> localProvider(Uri uri) { | 25 Future<String> localProvider(Uri uri) { |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 // --analyze-signatures-only implies --analyze-only | 177 // --analyze-signatures-only implies --analyze-only |
178 runCompiler( | 178 runCompiler( |
179 "", | 179 "", |
180 ['--analyze-signatures-only', '--analyze-all'], | 180 ['--analyze-signatures-only', '--analyze-all'], |
181 (String code, List errors, List warnings) { | 181 (String code, List errors, List warnings) { |
182 Expect.isNull(code); | 182 Expect.isNull(code); |
183 Expect.isTrue(errors.isEmpty); | 183 Expect.isTrue(errors.isEmpty); |
184 Expect.isTrue(warnings.isEmpty); | 184 Expect.isTrue(warnings.isEmpty); |
185 }); | 185 }); |
186 } | 186 } |
OLD | NEW |