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

Unified Diff: pkg/front_end/test/fasta/testing/suite.dart

Issue 2881603003: Generate outline without transformations in patched_sdk, use it for unit tests (Closed)
Patch Set: really use the outline, really Created 3 years, 7 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 | « pkg/front_end/test/fasta/strong.status ('k') | tools/patch_sdk.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/test/fasta/testing/suite.dart
diff --git a/pkg/front_end/test/fasta/testing/suite.dart b/pkg/front_end/test/fasta/testing/suite.dart
index f08f6cded4ebb3aca14f163ddcfd4558a486eded..e4e320c090e41e215e8d742570fe54e24802dc3f 100644
--- a/pkg/front_end/test/fasta/testing/suite.dart
+++ b/pkg/front_end/test/fasta/testing/suite.dart
@@ -82,11 +82,14 @@ class FastaContext extends ChainContext {
final TranslateUri uriTranslator;
final List<Step> steps;
final Uri vm;
+ Uri sdk;
+ Uri platformUri;
+ Uri outlineUri;
final ExpectationSet expectationSet =
new ExpectationSet.fromJsonList(JSON.decode(EXPECTATIONS));
- Future<Program> platform;
+ Future<Program> outline;
FastaContext(
this.vm,
@@ -114,10 +117,18 @@ class FastaContext extends ChainContext {
}
}
- Future<Program> loadPlatform() {
- return platform ??= new Future<Program>(() async {
- Uri sdk = await computePatchedSdk();
- return loadProgramFromBinary(sdk.resolve('platform.dill').toFilePath());
+ Future ensurePlatformUris() async {
+ if (sdk == null) {
+ sdk = await computePatchedSdk();
+ platformUri = sdk.resolve('platform.dill');
+ outlineUri = sdk.resolve('outline.dill');
+ }
+ }
+
+ Future<Program> loadPlatformOutline() {
+ return outline ??= new Future<Program>(() async {
+ await ensurePlatformUris();
+ return loadProgramFromBinary(outlineUri.toFilePath());
});
}
@@ -160,8 +171,10 @@ class Run extends Step<Uri, int, FastaContext> {
File generated = new File.fromUri(uri);
StdioProcess process;
try {
- process = await StdioProcess
- .run(context.vm.toFilePath(), [generated.path, "Hello, World!"]);
+ await context.ensurePlatformUris();
ahe 2017/05/31 14:04:40 You can't do this here because this step is "async
Siggi Cherem (dart-lang) 2017/05/31 15:44:04 Should this just assert that context.patformUri is
ahe 2017/05/31 16:40:18 I wasn't able to provide you a general solution fo
+ var platformDill = context.platformUri.toFilePath();
+ var args = ['--platform=$platformDill', generated.path, "Hello, World!"];
+ process = await StdioProcess.run(context.vm.toFilePath(), args);
print(process.output);
} finally {
generated.parent.delete(recursive: true);
@@ -190,10 +203,10 @@ class Outline extends Step<TestDescription, Program, FastaContext> {
Future<Result<Program>> run(
TestDescription description, FastaContext context) async {
- Program platform = await context.loadPlatform();
+ Program platformOutline = await context.loadPlatformOutline();
Ticker ticker = new Ticker();
DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator);
- dillTarget.loader.appendLibraries(platform);
+ dillTarget.loader.appendLibraries(platformOutline);
KernelTarget sourceTarget = astKind == AstKind.Analyzer
? new AnalyzerTarget(dillTarget, context.uriTranslator, strongMode)
: new KernelTarget(PhysicalFileSystem.instance, dillTarget,
« no previous file with comments | « pkg/front_end/test/fasta/strong.status ('k') | tools/patch_sdk.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698