| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 /// Test that the dart2js copy of [KernelVisitor] generates the expected IR as | 5 /// Test that the dart2js copy of [KernelVisitor] generates the expected IR as |
| 6 /// defined by kernel spec-mode test files. | 6 /// defined by kernel spec-mode test files. |
| 7 | 7 |
| 8 import 'dart:io'; | 8 import 'dart:io'; |
| 9 import 'package:compiler/src/compiler.dart' show Compiler; | 9 import 'package:compiler/src/compiler.dart' show Compiler; |
| 10 import 'package:compiler/src/js_backend/backend.dart' show JavaScriptBackend; | 10 import 'package:compiler/src/js_backend/backend.dart' show JavaScriptBackend; |
| 11 import 'package:compiler/src/commandline_options.dart' show Flags; | 11 import 'package:compiler/src/commandline_options.dart' show Flags; |
| 12 import 'package:kernel/text/ast_to_text.dart'; | 12 import 'package:kernel/text/ast_to_text.dart'; |
| 13 import 'package:path/path.dart' as pathlib; | 13 import 'package:path/path.dart' as pathlib; |
| 14 import 'package:test/test.dart'; | 14 import 'package:test/test.dart'; |
| 15 | 15 |
| 16 import '../memory_compiler.dart'; | 16 import '../memory_compiler.dart'; |
| 17 | 17 |
| 18 const String TESTCASE_DIR = 'third_party/pkg/kernel/testcases/'; | 18 const String TESTCASE_DIR = 'third_party/pkg/kernel/testcases/'; |
| 19 | 19 |
| 20 const List<String> SKIP_TESTS = const <String>[ | 20 const List<String> SKIP_TESTS = const <String>[ |
| 21 'DeltaBlue', // Super calls encoded as `super.{...` and not `this.{...`. | 21 'DeltaBlue', // Super calls encoded as `super.{...` and not `this.{...`. |
| 22 'external', // 'dart:_isolate_helper' is imported instead of 'dart:isolate'. | |
| 23 ]; | 22 ]; |
| 24 | 23 |
| 25 main(List<String> arguments) { | 24 main(List<String> arguments) { |
| 26 Directory directory = new Directory('${TESTCASE_DIR}/input'); | 25 Directory directory = new Directory('${TESTCASE_DIR}/input'); |
| 27 for (FileSystemEntity file in directory.listSync()) { | 26 for (FileSystemEntity file in directory.listSync()) { |
| 28 if (file is File && file.path.endsWith('.dart')) { | 27 if (file is File && file.path.endsWith('.dart')) { |
| 29 String name = pathlib.basenameWithoutExtension(file.path); | 28 String name = pathlib.basenameWithoutExtension(file.path); |
| 30 bool selected = arguments.contains(name); | 29 bool selected = arguments.contains(name); |
| 31 if (!selected) { | 30 if (!selected) { |
| 32 if (arguments.isNotEmpty) continue; | 31 if (arguments.isNotEmpty) continue; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 56 print('--expected--------------------------------------------------'); | 55 print('--expected--------------------------------------------------'); |
| 57 print(expected); | 56 print(expected); |
| 58 print('--actual----------------------------------------------------'); | 57 print('--actual----------------------------------------------------'); |
| 59 print(actual); | 58 print(actual); |
| 60 } | 59 } |
| 61 expect(actual, equals(expected)); | 60 expect(actual, equals(expected)); |
| 62 }); | 61 }); |
| 63 } | 62 } |
| 64 } | 63 } |
| 65 } | 64 } |
| OLD | NEW |