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

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

Issue 1746743002: Use checked-in .package file for building and testing (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Stop creating [build_dir]/packages Created 4 years, 3 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: tools/testing/dart/test_suite.dart
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart
index 183be62c326edfe62c34c80344dc51d57bc08f4b..d9415ccf7b53251ce067b948b10153b0951d5204 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -956,6 +956,7 @@ class StandardTestSuite extends TestSuite {
// pubspec.yaml file and if so, create a custom package root for it.
List<Command> baseCommands = <Command>[];
Path packageRoot;
+ Path packages;
if (configuration['use_repository_packages'] ||
configuration['use_public_packages']) {
Path pubspecYamlFile = _findPubspecYamlFile(filePath);
@@ -995,11 +996,11 @@ class StandardTestSuite extends TestSuite {
multiHtmlTestExpectations[fullTestName] =
testExpectations.expectations(fullTestName);
}
- enqueueBrowserTest(baseCommands, packageRoot, info, testName,
+ enqueueBrowserTest(baseCommands, packageRoot, packages, info, testName,
multiHtmlTestExpectations);
} else {
enqueueBrowserTest(
- baseCommands, packageRoot, info, testName, expectations);
+ baseCommands, packageRoot, packages, info, testName, expectations);
}
} else {
enqueueStandardTest(baseCommands, info, testName, expectations);
@@ -1200,7 +1201,7 @@ class StandardTestSuite extends TestSuite {
* compilation and many browser runs).
*/
void enqueueBrowserTest(List<Command> baseCommands, Path packageRoot,
- TestInformation info, String testName, expectations) {
+ Path packages, TestInformation info, String testName, expectations) {
RegExp badChars = new RegExp('[-=/]');
List VmOptionsList = getVmOptions(info.optionsFromFile);
bool multipleOptions = VmOptionsList.length > 1;
@@ -1208,14 +1209,15 @@ class StandardTestSuite extends TestSuite {
String optionsName =
multipleOptions ? vmOptions.join('-').replaceAll(badChars, '') : '';
String tempDir = createOutputDirectory(info.filePath, optionsName);
- enqueueBrowserTestWithOptions(baseCommands, packageRoot, info, testName,
- expectations, vmOptions, tempDir);
+ enqueueBrowserTestWithOptions(baseCommands, packageRoot, packages,
+ info, testName, expectations, vmOptions, tempDir);
}
}
void enqueueBrowserTestWithOptions(
List<Command> baseCommands,
Path packageRoot,
+ Path packages,
TestInformation info,
String testName,
expectations,
@@ -1585,12 +1587,11 @@ class StandardTestSuite extends TestSuite {
String packagesFromFile) {
if (packagesFromFile != null) {
return "--packages=$packagesFromFile";
+ } else if (packageRootFromFile != null) {
+ return "--package-root=$packageRootFromFile";
+ } else {
+ return null;
Bob Nystrom 2016/09/14 23:56:09 Nit: Indent.
}
- if (packageRootFromFile == "none") {
- return null;
- }
- packageRootFromFile ??= "$buildDir/packages/";
- return "--package-root=$packageRootFromFile";
}
/**
@@ -1843,7 +1844,7 @@ class PKGTestSuite extends StandardTestSuite {
recursive: true);
void enqueueBrowserTest(List<Command> baseCommands, Path packageRoot,
- TestInformation info, String testName, expectations) {
+ packages, TestInformation info, String testName, expectations) {
String runtime = configuration['runtime'];
Path filePath = info.filePath;
Path dir = filePath.directoryPath;
@@ -1852,7 +1853,7 @@ class PKGTestSuite extends StandardTestSuite {
File customHtml = new File(customHtmlPath.toNativePath());
if (!customHtml.existsSync()) {
super.enqueueBrowserTest(
- baseCommands, packageRoot, info, testName, expectations);
+ baseCommands, packageRoot, packages, info, testName, expectations);
} else {
Path relativeHtml = customHtmlPath.relativeTo(TestUtils.dartDir);
List<Command> commands = []..addAll(baseCommands);

Powered by Google App Engine
This is Rietveld 408576698