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 import 'dart:io' hide Link; | 5 import 'dart:io' hide Link; |
6 import 'package:async_helper/async_helper.dart'; | 6 import 'package:async_helper/async_helper.dart'; |
7 import 'package:compiler/src/closure.dart'; | 7 import 'package:compiler/src/closure.dart'; |
8 import 'package:compiler/src/common.dart'; | 8 import 'package:compiler/src/common.dart'; |
9 import 'package:compiler/src/compiler.dart'; | 9 import 'package:compiler/src/compiler.dart'; |
10 import 'package:compiler/src/diagnostics/diagnostic_listener.dart'; | 10 import 'package:compiler/src/diagnostics/diagnostic_listener.dart'; |
11 import 'package:compiler/src/elements/elements.dart'; | 11 import 'package:compiler/src/elements/elements.dart'; |
12 import 'package:compiler/src/elements/entities.dart'; | 12 import 'package:compiler/src/elements/entities.dart'; |
13 import 'package:compiler/src/kernel/element_map.dart'; | 13 import 'package:compiler/src/kernel/element_map.dart'; |
14 import 'package:compiler/src/kernel/kernel_backend_strategy.dart'; | 14 import 'package:compiler/src/kernel/kernel_backend_strategy.dart'; |
15 import 'package:compiler/src/js_model/locals.dart'; | 15 import 'package:compiler/src/js_model/locals.dart'; |
16 import 'package:compiler/src/tree/nodes.dart' as ast; | 16 import 'package:compiler/src/tree/nodes.dart' as ast; |
17 import 'package:compiler/src/util/util.dart'; | 17 import 'package:compiler/src/util/util.dart'; |
18 import 'package:expect/expect.dart'; | 18 import 'package:expect/expect.dart'; |
19 import '../equivalence/id_equivalence.dart'; | 19 import '../equivalence/id_equivalence.dart'; |
20 import '../equivalence/id_equivalence_helper.dart'; | 20 import '../equivalence/id_equivalence_helper.dart'; |
21 import 'package:kernel/ast.dart' as ir; | 21 import 'package:kernel/ast.dart' as ir; |
22 | 22 |
| 23 // TODO(johnnniwinther,efortuna): Enable the these tests for .dill. |
| 24 const List<String> whiteList = const <String>[ |
| 25 'nested_closures.dart', |
| 26 'mixed.dart', |
| 27 ]; |
| 28 |
23 main(List<String> args) { | 29 main(List<String> args) { |
24 bool verbose = args.contains('-v'); | 30 bool verbose = args.contains('-v'); |
25 asyncTest(() async { | 31 asyncTest(() async { |
26 Directory dataDir = new Directory.fromUri(Platform.script.resolve('data')); | 32 Directory dataDir = new Directory.fromUri(Platform.script.resolve('data')); |
27 await for (FileSystemEntity entity in dataDir.list()) { | 33 await for (FileSystemEntity entity in dataDir.list()) { |
28 print('----------------------------------------------------------------'); | 34 print('----------------------------------------------------------------'); |
29 print('Checking ${entity.uri}'); | 35 print('Checking ${entity.uri}'); |
30 print('----------------------------------------------------------------'); | 36 print('----------------------------------------------------------------'); |
31 String annotatedCode = await new File.fromUri(entity.uri).readAsString(); | 37 String annotatedCode = await new File.fromUri(entity.uri).readAsString(); |
32 print('--from source---------------------------------------------------'); | 38 print('--from source---------------------------------------------------'); |
33 await checkCode(annotatedCode, computeClosureData, compileFromSource, | 39 await checkCode(annotatedCode, computeClosureData, compileFromSource, |
34 verbose: verbose); | 40 verbose: verbose); |
35 // TODO(johnnniwinther,efortuna): Enable the these tests for .dill. | 41 if (whiteList.contains(entity.uri.pathSegments.last)) { |
36 if (['nested_closures.dart'].contains(entity.uri.pathSegments.last)) { | |
37 print('--skipped for dill--------------------------------------------'); | 42 print('--skipped for dill--------------------------------------------'); |
38 continue; | 43 continue; |
39 } | 44 } |
40 print('--from dill-----------------------------------------------------'); | 45 print('--from dill-----------------------------------------------------'); |
41 await checkCode(annotatedCode, computeKernelClosureData, compileFromDill, | 46 await checkCode(annotatedCode, computeKernelClosureData, compileFromDill, |
42 verbose: verbose); | 47 verbose: verbose); |
43 } | 48 } |
44 }); | 49 }); |
45 } | 50 } |
46 | 51 |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 if (value != '') { | 328 if (value != '') { |
324 sb.write('='); | 329 sb.write('='); |
325 sb.write(value); | 330 sb.write(value); |
326 } | 331 } |
327 needsComma = true; | 332 needsComma = true; |
328 } | 333 } |
329 } | 334 } |
330 return sb.toString(); | 335 return sb.toString(); |
331 } | 336 } |
332 } | 337 } |
OLD | NEW |