Chromium Code Reviews| 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 'dart:async'; | 9 import 'dart:async'; |
| 10 import 'package:compiler/src/compiler.dart' show Compiler; | 10 import 'package:compiler/src/compiler.dart' show Compiler; |
| 11 import 'package:compiler/src/js_backend/backend.dart' show JavaScriptBackend; | 11 import 'package:compiler/src/js_backend/backend.dart' show JavaScriptBackend; |
| 12 import 'package:compiler/src/commandline_options.dart' show Flags; | 12 import 'package:compiler/src/commandline_options.dart' show Flags; |
| 13 import 'package:kernel/ast.dart'; | 13 import 'package:kernel/ast.dart'; |
| 14 import 'package:kernel/class_hierarchy.dart'; | 14 import 'package:kernel/class_hierarchy.dart'; |
| 15 import 'package:kernel/core_types.dart'; | 15 import 'package:kernel/core_types.dart'; |
| 16 import 'package:kernel/text/ast_to_text.dart'; | 16 import 'package:kernel/text/ast_to_text.dart'; |
| 17 import 'package:kernel/transformations/mixin_full_resolution.dart'; | 17 import 'package:kernel/transformations/mixin_full_resolution.dart'; |
| 18 import 'package:kernel/target/targets.dart'; | 18 import 'package:kernel/target/targets.dart'; |
| 19 import 'package:test/test.dart'; | 19 import 'package:test/test.dart'; |
| 20 | 20 |
| 21 import '../memory_compiler.dart'; | 21 import '../memory_compiler.dart'; |
| 22 | 22 |
| 23 const String TESTCASE_DIR = 'pkg/front_end/testcases/'; | 23 const String TESTCASE_DIR = 'pkg/front_end/testcases/'; |
| 24 | 24 |
| 25 const List<String> TESTS = const <String>[ | 25 const List<String> TESTS = const <String>[ |
| 26 'DeltaBlue', | 26 // 'DeltaBlue', Issue 29853: default constructor _not expected |
| 27 'argument', | 27 'argument', |
| 28 'arithmetic', | 28 'arithmetic', |
| 29 'async_function', | 29 'async_function', |
| 30 'bad_store', | 30 'bad_store', |
| 31 'call', | 31 'call', |
| 32 'closure', | 32 'closure', |
| 33 // 'covariant_generic', Issue 29853: typedefs | 33 // 'covariant_generic', Issue 29853: typedefs |
| 34 'escape', | 34 'escape', |
| 35 'fallthrough', | 35 'fallthrough', |
| 36 'micro', | 36 // 'micro', Issue 29853: Unexpected change in external methods |
| 37 'named_parameters', | 37 // 'named_parameters', Issue 29853: default constructor _not expected |
|
ahe
2017/07/14 09:47:59
Why do you put underscores before not?
Johnni Winther
2017/07/14 10:15:04
I meant to write _not_
| |
| 38 'null_aware', | 38 'null_aware', |
| 39 // 'optional', Issue 29853: abstract members | 39 // 'optional', Issue 29853: abstract members |
| 40 'override', | 40 'override', |
| 41 'prefer_baseclass', | 41 'prefer_baseclass', |
| 42 // 'redirecting_factory', Issue 29853: redirecting factories | 42 // 'redirecting_factory', Issue 29853: redirecting factories |
| 43 'static_setter', | 43 'static_setter', |
| 44 'store_load', | 44 'store_load', |
| 45 'stringliteral', | 45 'stringliteral', |
| 46 'uninitialized_fields', | 46 // 'uninitialized_fields', Issue 29853: default constructor _not expected |
| 47 'unused_methods', | 47 'unused_methods', |
| 48 'void-methods', | 48 // 'void-methods', Issue 29853: unexpected change in []= encoding |
| 49 ]; | 49 ]; |
| 50 | 50 |
| 51 main(List<String> arguments) { | 51 main(List<String> arguments) { |
| 52 if (arguments.isEmpty) { | 52 if (arguments.isEmpty) { |
| 53 for (String testName in TESTS) { | 53 for (String testName in TESTS) { |
| 54 scheduleTest(testName, selected: false); | 54 scheduleTest(testName, selected: false); |
| 55 } | 55 } |
| 56 } else { | 56 } else { |
| 57 for (String testName in arguments) { | 57 for (String testName in arguments) { |
| 58 scheduleTest(testName, selected: true); | 58 scheduleTest(testName, selected: true); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 // find dart.core::Iterator. | 104 // find dart.core::Iterator. |
| 105 var loadedLibraries = | 105 var loadedLibraries = |
| 106 await compiler.libraryLoader.loadLibrary(Uri.parse('dart:core')); | 106 await compiler.libraryLoader.loadLibrary(Uri.parse('dart:core')); |
| 107 compiler.processLoadedLibraries(loadedLibraries); | 107 compiler.processLoadedLibraries(loadedLibraries); |
| 108 dynamic core = loadedLibraries.rootLibrary; | 108 dynamic core = loadedLibraries.rootLibrary; |
| 109 compiler.startResolution(); | 109 compiler.startResolution(); |
| 110 var cls = core.implementation.localLookup('Iterator'); | 110 var cls = core.implementation.localLookup('Iterator'); |
| 111 cls.ensureResolved(compiler.resolution); | 111 cls.ensureResolved(compiler.resolution); |
| 112 return compiler; | 112 return compiler; |
| 113 } | 113 } |
| OLD | NEW |