OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 dart2js.kernel.impact_test; | 5 library dart2js.kernel.impact_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
9 import 'package:compiler/src/common.dart'; | 9 import 'package:compiler/src/common.dart'; |
10 import 'package:compiler/src/commandline_options.dart'; | 10 import 'package:compiler/src/commandline_options.dart'; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 ''' | 77 ''' |
78 }; | 78 }; |
79 | 79 |
80 main(List<String> args) { | 80 main(List<String> args) { |
81 asyncTest(() async { | 81 asyncTest(() async { |
82 enableDebugMode(); | 82 enableDebugMode(); |
83 Uri entryPoint = Uri.parse('memory:main.dart'); | 83 Uri entryPoint = Uri.parse('memory:main.dart'); |
84 Compiler compiler = compilerFor( | 84 Compiler compiler = compilerFor( |
85 entryPoint: entryPoint, | 85 entryPoint: entryPoint, |
86 memorySourceFiles: SOURCE, | 86 memorySourceFiles: SOURCE, |
87 options: [Flags.analyzeOnly]); | 87 options: [Flags.analyzeOnly, Flags.useKernel]); |
88 compiler.resolution.retainCachesForTesting = true; | 88 compiler.resolution.retainCachesForTesting = true; |
89 await compiler.run(entryPoint); | 89 await compiler.run(entryPoint); |
90 compiler.mainApp.forEachLocalMember( | 90 compiler.mainApp |
91 (element) => checkElement(compiler, element)); | 91 .forEachLocalMember((element) => checkElement(compiler, element)); |
92 }); | 92 }); |
93 } | 93 } |
94 | 94 |
95 void checkElement(Compiler compiler, AstElement element) { | 95 void checkElement(Compiler compiler, AstElement element) { |
96 ResolutionImpact astImpact = | 96 ResolutionImpact astImpact = compiler.resolution.getResolutionImpact(element); |
97 compiler.resolution.getResolutionImpact(element); | |
98 ResolutionImpact kernelImpact = build(compiler, element.resolvedAst); | 97 ResolutionImpact kernelImpact = build(compiler, element.resolvedAst); |
99 testResolutionImpactEquivalence(astImpact, kernelImpact, | 98 testResolutionImpactEquivalence( |
100 const CheckStrategy()); | 99 astImpact, kernelImpact, const CheckStrategy()); |
101 } | 100 } |
OLD | NEW |