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

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

Issue 2723113002: Consolidate analyzer dependencies. (Closed)
Patch Set: Remove new dependency on AsyncMarker. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/front_end/lib/src/fasta/target.dart ('k') | pkg/front_end/lib/src/fasta/util/link_implementation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « pkg/front_end/lib/src/fasta/target.dart ('k') | pkg/front_end/lib/src/fasta/util/link_implementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698