Index: pkg/front_end/lib/src/fasta/testing/suite.dart |
diff --git a/pkg/front_end/lib/src/fasta/testing/suite.dart b/pkg/front_end/lib/src/fasta/testing/suite.dart |
index b8883e28e7bdebc5d0fba357da076b7708ac968b..88864606eab65347aae4b9a383cf140134be8770 100644 |
--- a/pkg/front_end/lib/src/fasta/testing/suite.dart |
+++ b/pkg/front_end/lib/src/fasta/testing/suite.dart |
@@ -28,18 +28,16 @@ import '../ticker.dart' show Ticker; |
import '../translate_uri.dart' show TranslateUri; |
+import '../analyzer/analyzer_target.dart' show AnalyzerTarget; |
+ |
import '../kernel/kernel_target.dart' show KernelTarget; |
import '../dill/dill_target.dart' show DillTarget; |
-import '../ast_kind.dart' show AstKind; |
- |
export 'kernel_chain.dart' show TestContext; |
export 'package:testing/testing.dart' show Chain, runMe; |
-export '../ast_kind.dart' show AstKind; |
- |
const String ENABLE_FULL_COMPILE = " full compile "; |
const String AST_KIND_INDEX = " AST kind index "; |
@@ -63,6 +61,11 @@ String shortenAstKindName(AstKind astKind) { |
throw "Unknown AST kind: $astKind"; |
} |
+enum AstKind { |
+ Analyzer, |
+ Kernel, |
+} |
+ |
class FastaContext extends TestContext { |
final TranslateUri uriTranslator; |
@@ -159,7 +162,7 @@ class Outline extends Step<TestDescription, Program, FastaContext> { |
const Outline(this.fullCompile, this.astKind); |
String get name { |
- return fullCompile ? "${shortenAstKindName(astKind)} compile" : "outline"; |
+ return fullCompile ? "${astKind} compile" : "outline"; |
} |
bool get isCompiler => fullCompile; |
@@ -172,15 +175,17 @@ class Outline extends Step<TestDescription, Program, FastaContext> { |
dillTarget.loader |
..input = Uri.parse("org.dartlang:platform") // Make up a name. |
..setProgram(platform); |
- KernelTarget sourceTarget = |
- new KernelTarget(dillTarget, context.uriTranslator); |
+ KernelTarget sourceTarget = astKind == AstKind.Analyzer |
+ ? new AnalyzerTarget(dillTarget, context.uriTranslator) |
+ : new KernelTarget(dillTarget, context.uriTranslator); |
+ |
Program p; |
try { |
sourceTarget.read(description.uri); |
await dillTarget.writeOutline(null); |
p = await sourceTarget.writeOutline(null); |
if (fullCompile) { |
- p = await sourceTarget.writeProgram(null, astKind); |
+ p = await sourceTarget.writeProgram(null); |
} |
} on InputError catch (e, s) { |
return fail(null, e.error, s); |