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

Side by Side Diff: pkg/front_end/lib/src/fasta/testing/suite.dart

Issue 2675683002: Update fasta tests to use the new transformation API (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « pkg/front_end/lib/src/fasta/testing/kernel_chain.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 library fasta.testing.suite; 5 library fasta.testing.suite;
6 6
7 import 'dart:async' show 7 import 'dart:async' show
8 Future; 8 Future;
9 9
10 import 'dart:convert' show 10 import 'dart:convert' show
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 } 120 }
121 121
122 Future<Program> createPlatform() { 122 Future<Program> createPlatform() {
123 return platform ??= new Future<Program>(() async { 123 return platform ??= new Future<Program>(() async {
124 DartLoader loader = await createLoader(); 124 DartLoader loader = await createLoader();
125 Target target = getTarget( 125 Target target = getTarget(
126 "vm", new TargetFlags(strongMode: options.strongMode)); 126 "vm", new TargetFlags(strongMode: options.strongMode));
127 Program program = loader.loadProgram( 127 Program program = loader.loadProgram(
128 Uri.base.resolve("pkg/fasta/test/platform.dart"), target: target); 128 Uri.base.resolve("pkg/fasta/test/platform.dart"), target: target);
129 target.transformProgram(program); 129 target.performModularTransformations(program);
130 target.performGlobalTransformations(program);
130 if (loader.errors.isNotEmpty) { 131 if (loader.errors.isNotEmpty) {
131 throw loader.errors.join("\n"); 132 throw loader.errors.join("\n");
132 } 133 }
133 Library mainLibrary = program.mainMethod.enclosingLibrary; 134 Library mainLibrary = program.mainMethod.enclosingLibrary;
134 program.uriToSource.remove(mainLibrary.fileUri); 135 program.uriToSource.remove(mainLibrary.fileUri);
135 return new Program( 136 return new Program(
136 program.libraries.where((Library l) => l != mainLibrary).toList(), 137 program.libraries.where((Library l) => l != mainLibrary).toList(),
137 program.uriToSource); 138 program.uriToSource);
138 }); 139 });
139 } 140 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 p = await sourceTarget.writeOutline(null); 182 p = await sourceTarget.writeOutline(null);
182 if (fullCompile) { 183 if (fullCompile) {
183 p = await sourceTarget.writeProgram(null, astKind); 184 p = await sourceTarget.writeProgram(null, astKind);
184 } 185 }
185 } on InputError catch (e, s) { 186 } on InputError catch (e, s) {
186 return fail(null, e.error, s); 187 return fail(null, e.error, s);
187 } 188 }
188 return pass(p); 189 return pass(p);
189 } 190 }
190 } 191 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/testing/kernel_chain.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698