| 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 e058f665ee081fa0b1e496e7694373b8ac357e23..67569099d34288ba7b6e020135069c5463f58078 100644
|
| --- a/pkg/front_end/test/fasta/testing/suite.dart
|
| +++ b/pkg/front_end/test/fasta/testing/suite.dart
|
| @@ -12,6 +12,8 @@ import 'dart:convert' show JSON;
|
|
|
| import 'package:front_end/physical_file_system.dart' show PhysicalFileSystem;
|
|
|
| +import 'package:front_end/src/fasta/compiler_command_line.dart';
|
| +
|
| import 'package:front_end/src/fasta/testing/validating_instrumentation.dart'
|
| show ValidatingInstrumentation;
|
|
|
| @@ -222,54 +224,56 @@ class Outline extends Step<TestDescription, Program, FastaContext> {
|
|
|
| Future<Result<Program>> run(
|
| TestDescription description, FastaContext context) async {
|
| - // Disable colors to ensure that expectation files are the same across
|
| - // platforms and independent of stdin/stderr.
|
| - CompilerContext.current.disableColors();
|
| - Program platformOutline = await context.loadPlatformOutline();
|
| - Ticker ticker = new Ticker();
|
| - DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator,
|
| - new TestVmFastaTarget(new TargetFlags(strongMode: strongMode)));
|
| - platformOutline.unbindCanonicalNames();
|
| - dillTarget.loader.appendLibraries(platformOutline);
|
| - // We create a new URI translator to avoid reading platform libraries from
|
| - // file system.
|
| - UriTranslatorImpl uriTranslator = new UriTranslatorImpl(
|
| - const <String, Uri>{},
|
| - const <String, List<Uri>>{},
|
| - context.uriTranslator.packages);
|
| - KernelTarget sourceTarget = astKind == AstKind.Analyzer
|
| - ? new AnalyzerTarget(dillTarget, uriTranslator, strongMode)
|
| - : new KernelTarget(
|
| - PhysicalFileSystem.instance, false, dillTarget, uriTranslator);
|
| -
|
| - Program p;
|
| - try {
|
| - sourceTarget.read(description.uri);
|
| - await dillTarget.buildOutlines();
|
| - ValidatingInstrumentation instrumentation;
|
| - if (strongMode) {
|
| - instrumentation = new ValidatingInstrumentation();
|
| - await instrumentation.loadExpectations(description.uri);
|
| - sourceTarget.loader.instrumentation = instrumentation;
|
| - }
|
| - p = await sourceTarget.buildOutlines();
|
| - if (fullCompile) {
|
| - p = await sourceTarget.buildProgram();
|
| - instrumentation?.finish();
|
| - if (instrumentation != null && instrumentation.hasProblems) {
|
| - if (updateComments) {
|
| - await instrumentation.fixSource(description.uri, false);
|
| - } else {
|
| - return fail(null, instrumentation.problemsAsString);
|
| + return await CompilerCommandLine.withGlobalOptions("", [""], (_) async {
|
| + // Disable colors to ensure that expectation files are the same across
|
| + // platforms and independent of stdin/stderr.
|
| + CompilerContext.current.disableColors();
|
| + Program platformOutline = await context.loadPlatformOutline();
|
| + Ticker ticker = new Ticker();
|
| + DillTarget dillTarget = new DillTarget(ticker, context.uriTranslator,
|
| + new TestVmFastaTarget(new TargetFlags(strongMode: strongMode)));
|
| + platformOutline.unbindCanonicalNames();
|
| + dillTarget.loader.appendLibraries(platformOutline);
|
| + // We create a new URI translator to avoid reading platform libraries from
|
| + // file system.
|
| + UriTranslatorImpl uriTranslator = new UriTranslatorImpl(
|
| + const <String, Uri>{},
|
| + const <String, List<Uri>>{},
|
| + context.uriTranslator.packages);
|
| + KernelTarget sourceTarget = astKind == AstKind.Analyzer
|
| + ? new AnalyzerTarget(dillTarget, uriTranslator, strongMode)
|
| + : new KernelTarget(
|
| + PhysicalFileSystem.instance, false, dillTarget, uriTranslator);
|
| +
|
| + Program p;
|
| + try {
|
| + sourceTarget.read(description.uri);
|
| + await dillTarget.buildOutlines();
|
| + ValidatingInstrumentation instrumentation;
|
| + if (strongMode) {
|
| + instrumentation = new ValidatingInstrumentation();
|
| + await instrumentation.loadExpectations(description.uri);
|
| + sourceTarget.loader.instrumentation = instrumentation;
|
| + }
|
| + p = await sourceTarget.buildOutlines();
|
| + if (fullCompile) {
|
| + p = await sourceTarget.buildProgram();
|
| + instrumentation?.finish();
|
| + if (instrumentation != null && instrumentation.hasProblems) {
|
| + if (updateComments) {
|
| + await instrumentation.fixSource(description.uri, false);
|
| + } else {
|
| + return fail(null, instrumentation.problemsAsString);
|
| + }
|
| }
|
| }
|
| + } on deprecated_InputError catch (e, s) {
|
| + return fail(null, e.error, s);
|
| }
|
| - } on deprecated_InputError catch (e, s) {
|
| - return fail(null, e.error, s);
|
| - }
|
| - context.programToTarget.clear();
|
| - context.programToTarget[p] = sourceTarget;
|
| - return pass(p);
|
| + context.programToTarget.clear();
|
| + context.programToTarget[p] = sourceTarget;
|
| + return pass(p);
|
| + });
|
| }
|
| }
|
|
|
|
|