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

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

Issue 2912353002: Don't read platform files during testing, and avoid trimming broken programs. (Closed)
Patch Set: 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
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 70764cd81b9ffc83902ca996f7bb081c2c47300c..49ab8d3481d5aabc99f084861a360536b10d6b32 100644
--- a/pkg/front_end/test/fasta/testing/suite.dart
+++ b/pkg/front_end/test/fasta/testing/suite.dart
@@ -30,6 +30,8 @@ import 'package:testing/testing.dart'
TestDescription,
StdioProcess;
+import 'package:front_end/src/fasta/compiler_context.dart' show CompilerContext;
+
import 'package:front_end/src/fasta/errors.dart' show InputError;
import 'package:front_end/src/fasta/testing/kernel_chain.dart'
@@ -209,15 +211,24 @@ 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, "vm");
platformOutline.unbindCanonicalNames();
dillTarget.loader.appendLibraries(platformOutline);
+ // We create a new URI translator to avoid reading plaform libraries from
+ // file system.
+ TranslateUri uriTranslator = new TranslateUri(
+ context.uriTranslator.packages,
+ const <String, Uri>{},
+ const <String, List<Uri>>{});
KernelTarget sourceTarget = astKind == AstKind.Analyzer
- ? new AnalyzerTarget(dillTarget, context.uriTranslator, strongMode)
- : new KernelTarget(PhysicalFileSystem.instance, dillTarget,
- context.uriTranslator, strongMode);
+ ? new AnalyzerTarget(dillTarget, uriTranslator, strongMode)
+ : new KernelTarget(
+ PhysicalFileSystem.instance, dillTarget, uriTranslator, strongMode);
Program p;
try {
« no previous file with comments | « pkg/front_end/test/fasta/kompile.status ('k') | pkg/front_end/testcases/rasta/unsupported_platform_library.dart.dartk.expect » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698