| 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'; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 }); | 38 }); |
| 39 } | 39 } |
| 40 | 40 |
| 41 Future checkModels( | 41 Future checkModels( |
| 42 Uri entryPoint, | 42 Uri entryPoint, |
| 43 {Map<String, String> sourceFiles: const <String, String>{}, | 43 {Map<String, String> sourceFiles: const <String, String>{}, |
| 44 List<Uri> resolutionInputs, | 44 List<Uri> resolutionInputs, |
| 45 int index, | 45 int index, |
| 46 Test test, | 46 Test test, |
| 47 bool verbose: false}) async { | 47 bool verbose: false}) async { |
| 48 if (test != null && test.name == 'Disable tree shaking through reflection') { |
| 49 // TODO(johnniwinther): Support serialization of metadata. |
| 50 return; |
| 51 } |
| 48 | 52 |
| 49 String testDescription = test != null ? test.name : '${entryPoint}'; | 53 String testDescription = test != null ? test.name : '${entryPoint}'; |
| 50 String id = index != null ? '$index: ' : ''; | 54 String id = index != null ? '$index: ' : ''; |
| 51 print('------------------------------------------------------------------'); | 55 print('------------------------------------------------------------------'); |
| 52 print('compile normal ${id}${testDescription}'); | 56 print('compile normal ${id}${testDescription}'); |
| 53 print('------------------------------------------------------------------'); | 57 print('------------------------------------------------------------------'); |
| 54 Compiler compilerNormal = compilerFor( | 58 Compiler compilerNormal = compilerFor( |
| 55 memorySourceFiles: sourceFiles, | 59 memorySourceFiles: sourceFiles, |
| 56 options: [Flags.analyzeOnly]); | 60 options: [Flags.analyzeOnly]); |
| 57 compilerNormal.resolution.retainCachesForTesting = true; | 61 compilerNormal.resolution.retainCachesForTesting = true; |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 return true; | 403 return true; |
| 400 } | 404 } |
| 401 | 405 |
| 402 String nodeToString(Node node) { | 406 String nodeToString(Node node) { |
| 403 String text = '$node'; | 407 String text = '$node'; |
| 404 if (text.length > 40) { | 408 if (text.length > 40) { |
| 405 return '(${node.runtimeType}) ${text.substring(0, 37)}...'; | 409 return '(${node.runtimeType}) ${text.substring(0, 37)}...'; |
| 406 } | 410 } |
| 407 return '(${node.runtimeType}) $text'; | 411 return '(${node.runtimeType}) $text'; |
| 408 } | 412 } |
| OLD | NEW |