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

Unified Diff: pkg/kernel/test/baseline_tester.dart

Issue 2532053005: Store library paths relative to a given application root folder. (Closed)
Patch Set: Revert changes to testcase baseline Created 4 years, 1 month 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/kernel/lib/repository.dart ('k') | pkg/kernel/test/frontend_bench.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/test/baseline_tester.dart
diff --git a/pkg/kernel/test/baseline_tester.dart b/pkg/kernel/test/baseline_tester.dart
index c2c47e584d58befdd8d80824f04ab120ca55ade8..b954e20197a40f31e39d252b4a42b04a599d87b6 100644
--- a/pkg/kernel/test/baseline_tester.dart
+++ b/pkg/kernel/test/baseline_tester.dart
@@ -4,6 +4,7 @@
import 'dart:io';
import 'package:kernel/analyzer/loader.dart';
+import 'package:kernel/application_root.dart';
import 'package:kernel/kernel.dart';
import 'package:kernel/target/targets.dart';
import 'package:kernel/text/ast_to_text.dart';
@@ -30,11 +31,13 @@ void runBaselineTests(String folderName, TestTarget target) {
String outputDirectory = '$testcaseDirectory/$folderName';
var batch = new DartLoaderBatch();
Directory directory = new Directory(inputDirectory);
+ var applicationRoot = new ApplicationRoot(directory.absolute.path);
for (FileSystemEntity file in directory.listSync()) {
if (file is File && file.path.endsWith('.dart')) {
String name = pathlib.basename(file.path);
test(name, () async {
- String dartPath = file.path;
+ Uri dartPath =
+ new Uri(scheme: 'file', path: pathlib.absolute(file.path));
String shortName = pathlib.withoutExtension(name);
String filenameOfBaseline = '$outputDirectory/$shortName.baseline.txt';
String filenameOfCurrent = '$outputDirectory/$shortName.current.txt';
@@ -45,7 +48,8 @@ void runBaselineTests(String folderName, TestTarget target) {
new DartOptions(
strongMode: target.strongMode,
sdk: sdkDirectory,
- declaredVariables: target.extraDeclaredVariables));
+ declaredVariables: target.extraDeclaredVariables,
+ applicationRoot: applicationRoot));
var program = loader.loadProgram(dartPath, target: target);
verifyProgram(program);
var errors = target.transformProgram(program);
« no previous file with comments | « pkg/kernel/lib/repository.dart ('k') | pkg/kernel/test/frontend_bench.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698