Index: tools/testing/dart/test_suite.dart |
diff --git a/tools/testing/dart/test_suite.dart b/tools/testing/dart/test_suite.dart |
index 45438f21352a167176cb992ec008730f194b6b23..8b863a390fc34d49c056a9359c6ac9185542f6c7 100644 |
--- a/tools/testing/dart/test_suite.dart |
+++ b/tools/testing/dart/test_suite.dart |
@@ -438,75 +438,6 @@ abstract class TestSuite { |
.toList(); |
}); |
} |
- |
- Future<Map> discoverPackagesInRepository() { |
- /* |
- * Layout of packages inside the dart repository: |
- * dart/ |
- * pkg/PACKAGE_NAME |
- * third_party/pkg/PACKAGE_NAME |
- * third_party/pkg_tested/PACKAGE_NAME |
- * runtime/observatory/PACKAGE_NAME |
- * sdk/lib/_internal/PACKAGE_NAME |
- */ |
- |
- // Directories containing "-" are not valid pub packages and we therefore |
- // do not include them in the list of packages. |
- isValid(packageName) => |
- packageName != 'third_party' && !packageName.contains('-'); |
- |
- var dartDir = TestUtils.dartDir; |
- var futures = [ |
- listDir(dartDir.append('pkg'), isValid), |
- listDir(dartDir.append('third_party').append('pkg'), isValid), |
- listDir(dartDir.append('third_party').append('pkg_tested'), isValid), |
- listDir(dartDir.append('runtime').append('observatory'), isValid), |
- listDir(dartDir.append('sdk').append('lib').append('_internal'), isValid), |
- ]; |
- return Future.wait(futures).then((results) { |
- var packageDirectories = {}; |
- for (var result in results) { |
- for (var packageTuple in result) { |
- String packageName = packageTuple[0]; |
- String fullPath = packageTuple[1]; |
- String yamlFile = |
- new Path(fullPath).append('pubspec.yaml').toNativePath(); |
- if (new File(yamlFile).existsSync()) { |
- packageDirectories[packageName] = fullPath; |
- } |
- } |
- } |
- return packageDirectories; |
- }); |
- } |
- |
- Future<Map> discoverSamplesInRepository() { |
- /* |
- * Layout of samples inside the dart repository: |
- * dart/ |
- * samples/SAMPLE_NAME |
- * samples/third_party/SAMPLE_NAME |
- */ |
- |
- isValid(packageName) => packageName != 'third_party'; |
- |
- var dartDir = TestUtils.dartDir; |
- var futures = [ |
- listDir(dartDir.append('samples'), isValid), |
- listDir(dartDir.append('samples').append('third_party'), isValid), |
- ]; |
- return Future.wait(futures).then((results) { |
- var packageDirectories = {}; |
- for (var result in results) { |
- for (var packageTuple in result) { |
- String packageName = packageTuple[0]; |
- String fullPath = packageTuple[1]; |
- packageDirectories[packageName] = fullPath; |
- } |
- } |
- return packageDirectories; |
- }); |
- } |
} |
Future<Iterable<String>> ccTestLister(String runnerPath) { |
@@ -1878,109 +1809,6 @@ class AnalyzeLibraryTestSuite extends DartcCompilationTestSuite { |
bool get listRecursively => true; |
} |
-class PkgBuildTestSuite extends TestSuite { |
- final String statusFilePath; |
- |
- PkgBuildTestSuite(Map configuration, String suiteName, this.statusFilePath) |
- : super(configuration, suiteName) { |
- assert(configuration['use_sdk']); |
- ; |
- } |
- |
- void forEachTest(void onTest(TestCase testCase), _, [void onDone()]) { |
- bool fileExists(Path path) => new File(path.toNativePath()).existsSync(); |
- |
- bool dirExists(Path path) => |
- new Directory(path.toNativePath()).existsSync(); |
- |
- enqueueTestCases( |
- Map<String, String> localPackageDirectories, |
- Map<String, String> localSampleDirectories, |
- TestExpectations testExpectations) { |
- enqueueTestCase(String packageName, String directory) { |
- var absoluteDirectoryPath = new Path(directory); |
- |
- // Early return if this package is not using pub. |
- if (!fileExists(absoluteDirectoryPath.append('pubspec.yaml'))) { |
- return; |
- } |
- |
- var directoryPath = absoluteDirectoryPath.relativeTo(TestUtils.dartDir); |
- var testName = "$directoryPath"; |
- var displayName = '$suiteName/$testName'; |
- |
- var checkoutDir = |
- createPubPackageBuildsDirectory(absoluteDirectoryPath); |
- var cacheDir = new Path(checkoutDir).append("pub-cache").toNativePath(); |
- |
- // Build all commands |
- // In order to debug timeouts on the buildbots, We run `pub get` with |
- // "--verbose". See https://github.com/dart-lang/sdk/issues/28734. |
- var commands = [ |
- CommandBuilder.instance.getCopyCommand(directory, checkoutDir), |
- CommandBuilder.instance.getPubCommand( |
- "get", pubPath, checkoutDir, cacheDir, |
- arguments: ['--verbose']) |
- ]; |
- |
- bool containsWebDirectory = dirExists(directoryPath.append('web')); |
- bool containsBuildDartFile = |
- fileExists(directoryPath.append('build.dart')); |
- if (containsBuildDartFile) { |
- var dartBinary = new File(dartVmBinaryFileName).absolute.path; |
- |
- commands.add(CommandBuilder.instance.getProcessCommand( |
- "custom_build", |
- dartBinary, |
- ['build.dart'], |
- {'PUB_CACHE': cacheDir}, |
- checkoutDir)); |
- |
- // We only try to deploy the application if it's a webapp. |
- if (containsWebDirectory) { |
- commands.add(CommandBuilder.instance.getProcessCommand( |
- "custom_deploy", |
- dartBinary, |
- ['build.dart', '--deploy'], |
- {'PUB_CACHE': cacheDir}, |
- checkoutDir)); |
- } |
- } else if (containsWebDirectory) { |
- commands.add(CommandBuilder.instance |
- .getPubCommand("build", pubPath, checkoutDir, cacheDir)); |
- } |
- |
- // Enqueue TestCase |
- var testCase = new TestCase(displayName, commands, configuration, |
- testExpectations.expectations(testName)); |
- enqueueNewTestCase(testCase); |
- } |
- |
- localPackageDirectories.forEach(enqueueTestCase); |
- localSampleDirectories.forEach(enqueueTestCase); |
- |
- doTest = null; |
- // Notify we're done |
- if (onDone != null) onDone(); |
- } |
- |
- doTest = onTest; |
- List<String> statusFiles = [ |
- TestUtils.dartDir.join(new Path(statusFilePath)).toNativePath() |
- ]; |
- ReadTestExpectations(statusFiles, configuration).then((expectations) { |
- Future.wait([ |
- discoverPackagesInRepository(), |
- discoverSamplesInRepository() |
- ]).then((List results) { |
- Map packageDirectories = results[0]; |
- Map sampleDirectories = results[1]; |
- enqueueTestCases(packageDirectories, sampleDirectories, expectations); |
- }); |
- }); |
- } |
-} |
- |
class LastModifiedCache { |
Map<String, DateTime> _cache = <String, DateTime>{}; |