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 24 matching lines...) Expand all Loading... |
35 | 35 |
36 main(List<String> args) { | 36 main(List<String> args) { |
37 asyncTest(() async { | 37 asyncTest(() async { |
38 Arguments arguments = new Arguments.from(args); | 38 Arguments arguments = new Arguments.from(args); |
39 String serializedData = await serializeDartCore(arguments: arguments); | 39 String serializedData = await serializeDartCore(arguments: arguments); |
40 if (arguments.filename != null) { | 40 if (arguments.filename != null) { |
41 Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename)); | 41 Uri entryPoint = Uri.base.resolve(nativeToUriPath(arguments.filename)); |
42 await checkModels(serializedData, entryPoint); | 42 await checkModels(serializedData, entryPoint); |
43 } else { | 43 } else { |
44 Uri entryPoint = Uri.parse('memory:main.dart'); | 44 Uri entryPoint = Uri.parse('memory:main.dart'); |
45 for (Test test in TESTS) { | 45 arguments.forEachTest(TESTS, (int index, Test test) async { |
46 print('=============================================================='); | 46 print('=============================================================='); |
47 print(test.sourceFiles); | 47 print(test.sourceFiles); |
48 await checkModels( | 48 await checkModels( |
49 serializedData, | 49 serializedData, |
50 entryPoint, | 50 entryPoint, |
51 sourceFiles: test.sourceFiles, | 51 sourceFiles: test.sourceFiles, |
52 verbose: arguments.verbose); | 52 verbose: arguments.verbose); |
53 } | 53 }); |
54 } | 54 } |
55 }); | 55 }); |
56 } | 56 } |
57 | 57 |
58 Future checkModels( | 58 Future checkModels( |
59 String serializedData, | 59 String serializedData, |
60 Uri entryPoint, | 60 Uri entryPoint, |
61 {Map<String, String> sourceFiles: const <String, String>{}, | 61 {Map<String, String> sourceFiles: const <String, String>{}, |
62 bool verbose: false}) async { | 62 bool verbose: false}) async { |
63 | 63 |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 return true; | 401 return true; |
402 } | 402 } |
403 | 403 |
404 String nodeToString(Node node) { | 404 String nodeToString(Node node) { |
405 String text = '$node'; | 405 String text = '$node'; |
406 if (text.length > 40) { | 406 if (text.length > 40) { |
407 return '(${node.runtimeType}) ${text.substring(0, 37)}...'; | 407 return '(${node.runtimeType}) ${text.substring(0, 37)}...'; |
408 } | 408 } |
409 return '(${node.runtimeType}) $text'; | 409 return '(${node.runtimeType}) $text'; |
410 } | 410 } |
OLD | NEW |