OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 // Partial test that the closed world computed from [WorldImpact]s derived from | 5 // Partial test that the closed world computed from [WorldImpact]s derived from |
6 // kernel is equivalent to the original computed from resolution. | 6 // kernel is equivalent to the original computed from resolution. |
7 library dart2js.kernel.compile_from_dill_test; | 7 library dart2js.kernel.compile_from_dill_test; |
8 | 8 |
9 import 'dart:async'; | 9 import 'dart:async'; |
10 import 'dart:io'; | 10 import 'dart:io'; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 print('--- checking codegen enqueuers--------------------------------------'); | 168 print('--- checking codegen enqueuers--------------------------------------'); |
169 checkCodegenEnqueuers(compiler1.enqueuer.codegenEnqueuerForTesting, | 169 checkCodegenEnqueuers(compiler1.enqueuer.codegenEnqueuerForTesting, |
170 compiler2.enqueuer.codegenEnqueuerForTesting, | 170 compiler2.enqueuer.codegenEnqueuerForTesting, |
171 elementEquivalence: (a, b) => equivalence.entityEquivalence(a, b), | 171 elementEquivalence: (a, b) => equivalence.entityEquivalence(a, b), |
172 typeEquivalence: (DartType a, DartType b) { | 172 typeEquivalence: (DartType a, DartType b) { |
173 return equivalence.typeEquivalence(unalias(a), b); | 173 return equivalence.typeEquivalence(unalias(a), b); |
174 }, | 174 }, |
175 elementFilter: elementFilter, | 175 elementFilter: elementFilter, |
176 verbose: arguments.verbose); | 176 verbose: arguments.verbose); |
177 | 177 |
| 178 checkEmitters(compiler1.backend.emitter, compiler2.backend.emitter, |
| 179 elementEquivalence: (a, b) => equivalence.entityEquivalence(a, b), |
| 180 typeEquivalence: (DartType a, DartType b) { |
| 181 return equivalence.typeEquivalence(unalias(a), b); |
| 182 }, |
| 183 verbose: arguments.verbose); |
| 184 |
178 print('--- checking output------- -----------------------------------------'); | 185 print('--- checking output------- -----------------------------------------'); |
179 collector1.outputMap | 186 collector1.outputMap |
180 .forEach((OutputType outputType, Map<String, BufferedOutputSink> map1) { | 187 .forEach((OutputType outputType, Map<String, BufferedOutputSink> map1) { |
181 if (outputType == OutputType.sourceMap) { | 188 if (outputType == OutputType.sourceMap) { |
182 // TODO(johnniwinther): Support source map from .dill. | 189 // TODO(johnniwinther): Support source map from .dill. |
183 return; | 190 return; |
184 } | 191 } |
185 Map<String, BufferedOutputSink> map2 = collector2.outputMap[outputType]; | 192 Map<String, BufferedOutputSink> map2 = collector2.outputMap[outputType]; |
186 checkSets(map1.keys, map2.keys, 'output', equality); | 193 checkSets(map1.keys, map2.keys, 'output', equality); |
187 map1.forEach((String name, BufferedOutputSink output1) { | 194 map1.forEach((String name, BufferedOutputSink output1) { |
188 BufferedOutputSink output2 = map2[name]; | 195 BufferedOutputSink output2 = map2[name]; |
189 Expect.stringEquals(output1.text, output2.text); | 196 Expect.stringEquals(output1.text, output2.text); |
190 }); | 197 }); |
191 }); | 198 }); |
192 return ResultKind.success; | 199 return ResultKind.success; |
193 } | 200 } |
OLD | NEW |