Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: tests/compiler/dart2js/kernel/visitor_test.dart

Issue 2392863002: Roll kernel to latest (Closed)
Patch Set: Reinsert code Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/compiler/dart2js/kernel/impact_test.dart ('k') | tools/deps/dartium.deps/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/kernel/visitor_test.dart
diff --git a/tests/compiler/dart2js/kernel/visitor_test.dart b/tests/compiler/dart2js/kernel/visitor_test.dart
index 1edd591c601755a4b55e244e8da929c2f94a24c9..1c7c20e0d190b2705a1a4db9265b18c79e1366b6 100644
--- a/tests/compiler/dart2js/kernel/visitor_test.dart
+++ b/tests/compiler/dart2js/kernel/visitor_test.dart
@@ -7,6 +7,7 @@
import 'dart:io';
import 'package:compiler/src/compiler.dart' show Compiler;
+import 'package:compiler/src/elements/elements.dart';
import 'package:compiler/src/js_backend/backend.dart' show JavaScriptBackend;
import 'package:compiler/src/commandline_options.dart' show Flags;
import 'package:kernel/ast.dart';
@@ -22,6 +23,8 @@ const String TESTCASE_DIR = 'third_party/pkg/kernel/testcases/';
const List<String> SKIP_TESTS = const <String>[];
main(List<String> arguments) {
+ Compiler compiler = compilerFor(
+ options: [Flags.analyzeOnly, Flags.analyzeMain, Flags.useKernel]);
Directory directory = new Directory('${TESTCASE_DIR}/input');
for (FileSystemEntity file in directory.listSync()) {
if (file is File && file.path.endsWith('.dart')) {
@@ -33,16 +36,13 @@ main(List<String> arguments) {
}
test(name, () async {
- var result = await runCompiler(
- entryPoint: file.absolute.uri,
- options: [Flags.analyzeOnly, Flags.useKernel]);
- Compiler compiler = result.compiler;
+ LibraryElement library = await compiler.analyzeUri(file.absolute.uri);
JavaScriptBackend backend = compiler.backend;
StringBuffer buffer = new StringBuffer();
- Program program = backend.kernelTask.program;
+ Program program = backend.kernelTask.buildProgram(library);
new MixinFullResolution().transform(program);
new Printer(buffer).writeLibraryFile(
- backend.kernelTask.program.mainMethod.enclosingLibrary);
+ program.mainMethod.enclosingLibrary);
String actual = buffer.toString();
String expected =
new File('${TESTCASE_DIR}/spec-mode/$name.baseline.txt')
« no previous file with comments | « tests/compiler/dart2js/kernel/impact_test.dart ('k') | tools/deps/dartium.deps/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698