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

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

Issue 2340813004: Revert "Use checked-in .package file for building and testing" (Closed)
Patch Set: Fix more test and build failures 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
« no previous file with comments | « tools/make_links.py ('k') | utils/analysis_server/analysis_server.gyp » ('j') | 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 183be62c326edfe62c34c80344dc51d57bc08f4b..f5707b8d7df2f7036e296f289025f9ad99d52c39 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,
@@ -1584,13 +1586,12 @@ class StandardTestSuite extends TestSuite {
String packagesArgument(String packageRootFromFile,
String packagesFromFile) {
if (packagesFromFile != null) {
- return "--packages=$packagesFromFile";
- }
- if (packageRootFromFile == "none") {
- return null;
+ return '--packages=$packagesFromFile';
+ } else if (packageRootFromFile != null && packageRootFromFile != 'none') {
+ return '--package-root=$packageRootFromFile';
+ } else {
+ 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);
« no previous file with comments | « tools/make_links.py ('k') | utils/analysis_server/analysis_server.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698