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

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

Issue 705093002: Allow testing script to run without the package directories being present (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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 | « no previous file | 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
===================================================================
--- tools/testing/dart/test_suite.dart (revision 41485)
+++ tools/testing/dart/test_suite.dart (working copy)
@@ -378,19 +378,22 @@
* Helper function for discovering the packages in the dart repository.
*/
Future<List> listDir(Path path, Function isValid) {
- return new Directory(path.toNativePath())
- .list(recursive: false)
- .where((fse) => fse is Directory)
- .map((Directory directory) {
- var fullPath = directory.absolute.path;
- var packageName = new Path(fullPath).filename;
- if (isValid(packageName)) {
- return [packageName, path.append(packageName).toNativePath()];
- }
- return null;
- })
- .where((name) => name != null)
- .toList();
+ var dir = new Directory(path.toNativePath());
+ return dir.exists().then((var exist) {
+ if (!exist) return [];
+ return dir.list(recursive: false)
+ .where((fse) => fse is Directory)
+ .map((Directory directory) {
+ var fullPath = directory.absolute.path;
+ var packageName = new Path(fullPath).filename;
+ if (isValid(packageName)) {
+ return [packageName, path.append(packageName).toNativePath()];
+ }
+ return null;
+ })
+ .where((name) => name != null)
+ .toList();
+ });
Siggi Cherem (dart-lang) 2014/11/06 17:10:34 nit: unindent 2
}
Future<Map> discoverPackagesInRepository() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698