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

Unified Diff: tools/testing/dart/test_suite.dart

Issue 2240193002: Add --packages flag to test.py, to specify a package spec file. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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 | « tools/testing/dart/test_options.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/dart/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index abdde588e2a48902742eac7225923b43561d75b8..fd8270da32beb21a7ecd5a6b0d14beb5fee80779 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -973,6 +973,10 @@ class StandardTestSuite extends TestSuite {
packageRoot = new Path(configuration['package_root']);
optionsFromFile['packageRoot'] = packageRoot.toNativePath();
}
+ if (configuration['packages'] != null) {
+ Path packages = new Path(configuration['packages']);
+ optionsFromFile['packages'] = packages.toNativePath();
+ }
if (new CompilerConfiguration(configuration).hasCompiler &&
expectCompileError(info)) {
@@ -1471,9 +1475,8 @@ class StandardTestSuite extends TestSuite {
args = [];
}
args.addAll(TestUtils.standardOptions(configuration));
- String packageRoot = packageRootArgument(optionsFromFile['packageRoot']);
- if (packageRoot != null) args.add(packageRoot);
- String packages = packagesArgument(optionsFromFile['packages']);
+ String packages = packagesArgument(optionsFromFile['packageRoot'],
+ optionsFromFile['packages']);
if (packages != null) args.add(packages);
args.add('--out=$outputFile');
args.add(inputFile);
@@ -1493,9 +1496,8 @@ class StandardTestSuite extends TestSuite {
Command _polymerDeployCommand(
String inputFile, String outputDir, optionsFromFile) {
List<String> args = [];
- String packageRoot = packageRootArgument(optionsFromFile['packageRoot']);
- if (packageRoot != null) args.add(packageRoot);
- String packages = packagesArgument(optionsFromFile['packages']);
+ String packages = packagesArgument(optionsFromFile['packageRoot'],
+ optionsFromFile['packages']);
if (packages != null) args.add(packages);
args
..add('package:polymer/deploy.dart')
@@ -1550,11 +1552,8 @@ class StandardTestSuite extends TestSuite {
List<String> commonArgumentsFromFile(Path filePath, Map optionsFromFile) {
List args = TestUtils.standardOptions(configuration);
- String packageRoot = packageRootArgument(optionsFromFile['packageRoot']);
- if (packageRoot != null) {
- args.add(packageRoot);
- }
- String packages = packagesArgument(optionsFromFile['packages']);
+ String packages = packagesArgument(optionsFromFile['packageRoot'],
+ optionsFromFile['packages']);
if (packages != null) {
args.add(packages);
}
@@ -1582,30 +1581,16 @@ class StandardTestSuite extends TestSuite {
return args;
}
- String packageRoot(String packageRootFromFile) {
- if (packageRootFromFile == "none") {
- return null;
- }
- String packageRoot = packageRootFromFile;
- if (packageRootFromFile == null) {
- packageRoot = "$buildDir/packages/";
- }
- return packageRoot;
- }
-
- String packageRootArgument(String packageRootFromFile) {
- var packageRootPath = packageRoot(packageRootFromFile);
- if (packageRootPath == null) {
- return null;
+ String packagesArgument(String packageRootFromFile,
+ String packagesFromFile) {
Søren Gjesse 2016/08/15 06:12:58 Indentation.
+ if (packagesFromFile != null) {
+ return "--packages=$packagesFromFile";
}
- return "--package-root=$packageRootPath";
- }
-
- String packagesArgument(String packagesFromFile) {
- if (packagesFromFile == null || packagesFromFile == "none") {
+ if (packageRootFromFile == "none") {
return null;
}
- return "--packages=$packagesFromFile";
+ packageRootFromFile ??= "$buildDir/packages/";
+ return "--package-root=$packageRootFromFile";
}
/**
« no previous file with comments | « tools/testing/dart/test_options.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698