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

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

Issue 2673133002: Get rid of --use-repository-packages and --use-public-packages. (Closed)
Patch Set: Remove unused import. Created 3 years, 10 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_runner.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 c306bb8199cd9bbf4b44ed94764fbb9e3ccc18b8..0a86703abb6918ce8010b9cc07322bd022cb93fa 100644
--- a/tools/testing/dart/test_suite.dart
+++ b/tools/testing/dart/test_suite.dart
@@ -386,10 +386,8 @@ abstract class TestSuite {
var strong = configuration['strong'] ? '-strong' : '';
var minified = configuration['minified'] ? '-minified' : '';
var sdk = configuration['use_sdk'] ? '-sdk' : '';
- var packages =
- configuration['use_public_packages'] ? '-public_packages' : '';
var dirName = "${configuration['compiler']}-${configuration['runtime']}"
- "$checked$strong$minified$packages$sdk";
+ "$checked$strong$minified$sdk";
return createGeneratedTestDirectoryHelper(
"tests", dirName, testPath, optionsName);
}
@@ -400,29 +398,21 @@ abstract class TestSuite {
var minified = configuration['minified'] ? '-minified' : '';
var csp = configuration['csp'] ? '-csp' : '';
var sdk = configuration['use_sdk'] ? '-sdk' : '';
- var packages =
- configuration['use_public_packages'] ? '-public_packages' : '';
var dirName = "${configuration['compiler']}"
- "$checked$strong$minified$csp$packages$sdk";
+ "$checked$strong$minified$csp$sdk";
return createGeneratedTestDirectoryHelper(
"compilations", dirName, testPath, "");
}
String createPubspecCheckoutDirectory(Path directoryOfPubspecYaml) {
- var sdk = configuration['use_sdk'] ? '-sdk' : '';
- var pkg = configuration['use_public_packages']
- ? 'public_packages'
- : 'repo_packages';
+ var sdk = configuration['use_sdk'] ? 'sdk' : '';
return createGeneratedTestDirectoryHelper(
- "pubspec_checkouts", '$pkg$sdk', directoryOfPubspecYaml, "");
+ "pubspec_checkouts", sdk, directoryOfPubspecYaml, "");
}
String createPubPackageBuildsDirectory(Path directoryOfPubspecYaml) {
- var pkg = configuration['use_public_packages']
- ? 'public_packages'
- : 'repo_packages';
return createGeneratedTestDirectoryHelper(
- "pub_package_builds", pkg, directoryOfPubspecYaml, "");
+ "pub_package_builds", 'public_packages', directoryOfPubspecYaml, "");
}
/**
@@ -516,17 +506,6 @@ abstract class TestSuite {
return packageDirectories;
});
}
-
- /**
- * Helper function for building dependency_overrides for pubspec.yaml files.
- */
- Map buildPubspecDependencyOverrides(Map packageDirectories) {
- Map overrides = {};
- packageDirectories.forEach((String packageName, String fullPath) {
- overrides[packageName] = {'path': fullPath};
- });
- return overrides;
- }
}
Future<Iterable<String>> ccTestLister(String runnerPath) {
@@ -896,87 +875,14 @@ class StandardTestSuite extends TestSuite {
enqueueHtmlTest(info, testName, expectations);
return;
}
- var filePath = info.filePath;
var optionsFromFile = info.optionsFromFile;
- Map buildSpecialPackageRoot(Path pubspecYamlFile) {
- var commands = <Command>[];
- var packageDir = pubspecYamlFile.directoryPath;
- var packageName = packageDir.filename;
-
- var checkoutDirectory = createPubspecCheckoutDirectory(packageDir);
- var modifiedYamlFile = new Path(checkoutDirectory).append("pubspec.yaml");
- var pubCacheDirectory = new Path(checkoutDirectory).append("pub-cache");
- var newPackageRoot = new Path(checkoutDirectory).append("packages");
-
- // Remove the old packages directory, so we can do a clean 'pub get'.
- var newPackagesDirectory = new Directory(newPackageRoot.toNativePath());
- if (newPackagesDirectory.existsSync()) {
- newPackagesDirectory.deleteSync(recursive: true);
- }
-
- // NOTE: We make a link in the package-root to [packageName], since
- // 'pub get' doesn't create the link to the package containing
- // pubspec.yaml if there is no lib directory.
- var packageLink = newPackageRoot.append(packageName);
- var packageLinkTarget = packageDir.append('lib');
-
- // NOTE: We make a link in the package-root to pkg/expect, since
- // 'package:expect' is not available on pub.dartlang.org!
- var expectLink = newPackageRoot.append('expect');
- var expectLinkTarget =
- TestUtils.dartDir.append('pkg').append('expect').append('lib');
-
- // Generate dependency overrides if we use repository packages.
- var packageDirectories = {};
- if (configuration['use_repository_packages']) {
- packageDirectories = new Map.from(localPackageDirectories);
-
- // Don't create a dependency override for pub, since it's an application
- // package and it has a dependency on compiler_unsupported which isn't
- // in the repo.
- packageDirectories.remove('pub');
-
- // Do not create an dependency override for the package itself.
- if (packageDirectories.containsKey(packageName)) {
- packageDirectories.remove(packageName);
- }
- }
- var overrides = buildPubspecDependencyOverrides(packageDirectories);
-
- commands.add(CommandBuilder.instance.getModifyPubspecCommand(
- pubspecYamlFile.toNativePath(), overrides,
- destinationFile: modifiedYamlFile.toNativePath()));
- commands.add(CommandBuilder.instance.getPubCommand(
- "get", pubPath, checkoutDirectory, pubCacheDirectory.toNativePath()));
- if (new Directory(packageLinkTarget.toNativePath()).existsSync()) {
- commands.add(CommandBuilder.instance.getMakeSymlinkCommand(
- packageLink.toNativePath(), packageLinkTarget.toNativePath()));
- }
- commands.add(CommandBuilder.instance.getMakeSymlinkCommand(
- expectLink.toNativePath(), expectLinkTarget.toNativePath()));
-
- return {'commands': commands, 'package-root': newPackageRoot,};
- }
-
// If this test is inside a package, we will check if there is a
// 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);
- if (pubspecYamlFile != null) {
- var result = buildSpecialPackageRoot(pubspecYamlFile);
- baseCommands.addAll(result['commands']);
- packageRoot = result['package-root'];
- if (optionsFromFile['packageRoot'] == null ||
- optionsFromFile['packageRoot'] == "") {
- optionsFromFile['packageRoot'] = packageRoot.toNativePath();
- }
- }
- }
+
if (optionsFromFile['packageRoot'] == null &&
optionsFromFile['packages'] == null) {
if (configuration['package_root'] != null) {
@@ -2017,39 +1923,17 @@ class PkgBuildTestSuite extends TestSuite {
var directoryPath = absoluteDirectoryPath.relativeTo(TestUtils.dartDir);
var testName = "$directoryPath";
var displayName = '$suiteName/$testName';
- var packageName = directoryPath.filename;
- // Collect necessary paths for pubspec.yaml overrides, pub-cache, ...
var checkoutDir =
createPubPackageBuildsDirectory(absoluteDirectoryPath);
var cacheDir = new Path(checkoutDir).append("pub-cache").toNativePath();
- var pubspecYamlFile =
- new Path(checkoutDir).append('pubspec.yaml').toNativePath();
-
- var packageDirectories = {};
- if (!configuration['use_public_packages']) {
- packageDirectories = new Map.from(localPackageDirectories);
-
- // Don't create a dependency override for pub, since it's an
- // application package and it has a dependency on compiler_unsupported
- // which isn't in the repo.
- packageDirectories.remove('pub');
-
- if (packageDirectories.containsKey(packageName)) {
- packageDirectories.remove(packageName);
- }
- }
- var dependencyOverrides =
- buildPubspecDependencyOverrides(packageDirectories);
// Build all commands
- var commands = new List<Command>();
- commands.add(
- CommandBuilder.instance.getCopyCommand(directory, checkoutDir));
- commands.add(CommandBuilder.instance
- .getModifyPubspecCommand(pubspecYamlFile, dependencyOverrides));
- commands.add(CommandBuilder.instance
- .getPubCommand("get", pubPath, checkoutDir, cacheDir));
+ var commands = [
+ CommandBuilder.instance.getCopyCommand(directory, checkoutDir),
+ CommandBuilder.instance.getPubCommand(
+ "get", pubPath, checkoutDir, cacheDir)
+ ];
bool containsWebDirectory = dirExists(directoryPath.append('web'));
bool containsBuildDartFile =
@@ -2261,10 +2145,8 @@ class TestUtils {
var minified = configuration['minified'] ? '-minified' : '';
var csp = configuration['csp'] ? '-csp' : '';
var sdk = configuration['use_sdk'] ? '-sdk' : '';
- var packages =
- configuration['use_public_packages'] ? '-public_packages' : '';
var dirName = "${configuration['compiler']}"
- "$checked$strong$minified$csp$packages$sdk";
+ "$checked$strong$minified$csp$sdk";
String generatedPath = "${TestUtils.buildDir(configuration)}"
"/generated_compilations/$dirName";
TestUtils.deleteDirectory(generatedPath);
« no previous file with comments | « tools/testing/dart/test_runner.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698