| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.serialization_model_test; | 5 library dart2js.serialization_model_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 import 'package:async_helper/async_helper.dart'; | 9 import 'package:async_helper/async_helper.dart'; |
| 10 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
| 11 import 'package:compiler/src/commandline_options.dart'; | 11 import 'package:compiler/src/commandline_options.dart'; |
| 12 import 'package:compiler/src/common/backend_api.dart'; | 12 import 'package:compiler/src/common/backend_api.dart'; |
| 13 import 'package:compiler/src/common/names.dart'; | 13 import 'package:compiler/src/common/names.dart'; |
| 14 import 'package:compiler/src/common/resolution.dart'; | 14 import 'package:compiler/src/common/resolution.dart'; |
| 15 import 'package:compiler/src/compiler.dart'; | 15 import 'package:compiler/src/compiler.dart'; |
| 16 import 'package:compiler/src/dart_types.dart'; | 16 import 'package:compiler/src/dart_types.dart'; |
| 17 import 'package:compiler/src/elements/elements.dart'; | 17 import 'package:compiler/src/elements/elements.dart'; |
| 18 import 'package:compiler/src/filenames.dart'; | 18 import 'package:compiler/src/filenames.dart'; |
| 19 import 'package:compiler/src/serialization/element_serialization.dart'; | 19 import 'package:compiler/src/serialization/element_serialization.dart'; |
| 20 import 'package:compiler/src/serialization/impact_serialization.dart'; | 20 import 'package:compiler/src/serialization/impact_serialization.dart'; |
| 21 import 'package:compiler/src/serialization/json_serializer.dart'; | 21 import 'package:compiler/src/serialization/json_serializer.dart'; |
| 22 import 'package:compiler/src/serialization/serialization.dart'; | 22 import 'package:compiler/src/serialization/serialization.dart'; |
| 23 import 'package:compiler/src/serialization/equivalence.dart'; | 23 import 'package:compiler/src/serialization/equivalence.dart'; |
| 24 import 'package:compiler/src/serialization/task.dart'; | 24 import 'package:compiler/src/serialization/task.dart'; |
| 25 import 'package:compiler/src/universe/world_impact.dart'; | 25 import 'package:compiler/src/universe/world_impact.dart'; |
| 26 import 'package:compiler/src/universe/class_set.dart'; | 26 import 'package:compiler/src/universe/class_set.dart'; |
| 27 import 'package:compiler/src/universe/use.dart'; | 27 import 'package:compiler/src/universe/use.dart'; |
| 28 import 'memory_compiler.dart'; | 28 import 'memory_compiler.dart'; |
| 29 import 'serialization_helper.dart'; | 29 import 'serialization_helper.dart'; |
| 30 import 'serialization_analysis_test.dart'; | 30 import 'serialization_test_data.dart'; |
| 31 import 'serialization_impact_test.dart'; | 31 import 'serialization_test_helper.dart'; |
| 32 import 'serialization_test.dart'; | |
| 33 | 32 |
| 34 main(List<String> arguments) { | 33 main(List<String> arguments) { |
| 35 String filename; | 34 String filename; |
| 36 for (String arg in arguments) { | 35 for (String arg in arguments) { |
| 37 if (!arg.startsWith('-')) { | 36 if (!arg.startsWith('-')) { |
| 38 filename = arg; | 37 filename = arg; |
| 39 } | 38 } |
| 40 } | 39 } |
| 41 bool verbose = arguments.contains('-v'); | 40 bool verbose = arguments.contains('-v'); |
| 42 | 41 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 print('compile deserialized'); | 101 print('compile deserialized'); |
| 103 print('------------------------------------------------------------------'); | 102 print('------------------------------------------------------------------'); |
| 104 Compiler compilerDeserialized = compilerFor( | 103 Compiler compilerDeserialized = compilerFor( |
| 105 memorySourceFiles: sourceFiles, | 104 memorySourceFiles: sourceFiles, |
| 106 options: [Flags.analyzeOnly]); | 105 options: [Flags.analyzeOnly]); |
| 107 compilerDeserialized.resolution.retainCachesForTesting = true; | 106 compilerDeserialized.resolution.retainCachesForTesting = true; |
| 108 deserialize(compilerDeserialized, serializedData); | 107 deserialize(compilerDeserialized, serializedData); |
| 109 await compilerDeserialized.run(entryPoint); | 108 await compilerDeserialized.run(entryPoint); |
| 110 compilerDeserialized.world.populate(); | 109 compilerDeserialized.world.populate(); |
| 111 | 110 |
| 112 checkResolutionImpacts( | 111 checkAllImpacts( |
| 113 compilerNormal, compilerDeserialized, | 112 compilerNormal, compilerDeserialized, |
| 114 verbose: verbose); | 113 verbose: verbose); |
| 115 | 114 |
| 116 checkSets( | 115 checkSets( |
| 117 compilerNormal.resolverWorld.directlyInstantiatedClasses, | 116 compilerNormal.resolverWorld.directlyInstantiatedClasses, |
| 118 compilerDeserialized.resolverWorld.directlyInstantiatedClasses, | 117 compilerDeserialized.resolverWorld.directlyInstantiatedClasses, |
| 119 "Directly instantiated classes mismatch", | 118 "Directly instantiated classes mismatch", |
| 120 areElementsEquivalent, | 119 areElementsEquivalent, |
| 121 verbose: verbose); | 120 verbose: verbose); |
| 122 | 121 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 214 |
| 216 if (failOnUnfound || remaining.isNotEmpty) { | 215 if (failOnUnfound || remaining.isNotEmpty) { |
| 217 Expect.fail(message); | 216 Expect.fail(message); |
| 218 } else { | 217 } else { |
| 219 print(message); | 218 print(message); |
| 220 } | 219 } |
| 221 } else if (verbose) { | 220 } else if (verbose) { |
| 222 print(message); | 221 print(message); |
| 223 } | 222 } |
| 224 } | 223 } |
| OLD | NEW |