Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * Classes and methods for enumerating and preparing tests. | 6 * Classes and methods for enumerating and preparing tests. |
| 7 * | 7 * |
| 8 * This library includes: | 8 * This library includes: |
| 9 * | 9 * |
| 10 * - Creating tests by listing all the Dart files in certain directories, | 10 * - Creating tests by listing all the Dart files in certain directories, |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 371 var pkg = configuration['use_public_packages'] | 371 var pkg = configuration['use_public_packages'] |
| 372 ? 'public_packages' : 'repo_packages'; | 372 ? 'public_packages' : 'repo_packages'; |
| 373 return createGeneratedTestDirectoryHelper( | 373 return createGeneratedTestDirectoryHelper( |
| 374 "pub_package_builds", pkg, directoryOfPubspecYaml, ""); | 374 "pub_package_builds", pkg, directoryOfPubspecYaml, ""); |
| 375 } | 375 } |
| 376 | 376 |
| 377 /** | 377 /** |
| 378 * Helper function for discovering the packages in the dart repository. | 378 * Helper function for discovering the packages in the dart repository. |
| 379 */ | 379 */ |
| 380 Future<List> listDir(Path path, Function isValid) { | 380 Future<List> listDir(Path path, Function isValid) { |
| 381 return new Directory(path.toNativePath()) | 381 var dir = new Directory(path.toNativePath()); |
| 382 .list(recursive: false) | 382 return dir.exists().then((var exist) { |
| 383 .where((fse) => fse is Directory) | 383 if (!exist) return []; |
| 384 .map((Directory directory) { | 384 return dir.list(recursive: false) |
| 385 var fullPath = directory.absolute.path; | 385 .where((fse) => fse is Directory) |
| 386 var packageName = new Path(fullPath).filename; | 386 .map((Directory directory) { |
| 387 if (isValid(packageName)) { | 387 var fullPath = directory.absolute.path; |
| 388 return [packageName, path.append(packageName).toNativePath()]; | 388 var packageName = new Path(fullPath).filename; |
| 389 } | 389 if (isValid(packageName)) { |
| 390 return null; | 390 return [packageName, path.append(packageName).toNativePath()]; |
| 391 }) | 391 } |
| 392 .where((name) => name != null) | 392 return null; |
| 393 .toList(); | 393 }) |
| 394 .where((name) => name != null) | |
| 395 .toList(); | |
| 396 }); | |
|
Siggi Cherem (dart-lang)
2014/11/06 17:10:34
nit: unindent 2
| |
| 394 } | 397 } |
| 395 | 398 |
| 396 Future<Map> discoverPackagesInRepository() { | 399 Future<Map> discoverPackagesInRepository() { |
| 397 /* | 400 /* |
| 398 * Layout of packages inside the dart repository: | 401 * Layout of packages inside the dart repository: |
| 399 * dart/ | 402 * dart/ |
| 400 * pkg/PACKAGE_NAME | 403 * pkg/PACKAGE_NAME |
| 401 * pkg/third_party/PACKAGE_NAME | 404 * pkg/third_party/PACKAGE_NAME |
| 402 * third_party/pkg/PACKAGE_NAME | 405 * third_party/pkg/PACKAGE_NAME |
| 403 * runtime/bin/vmservice/PACKAGE_NAME | 406 * runtime/bin/vmservice/PACKAGE_NAME |
| (...skipping 1933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2337 * $pass tests are expected to pass | 2340 * $pass tests are expected to pass |
| 2338 * $failOk tests are expected to fail that we won't fix | 2341 * $failOk tests are expected to fail that we won't fix |
| 2339 * $fail tests are expected to fail that we should fix | 2342 * $fail tests are expected to fail that we should fix |
| 2340 * $crash tests are expected to crash that we should fix | 2343 * $crash tests are expected to crash that we should fix |
| 2341 * $timeout tests are allowed to timeout | 2344 * $timeout tests are allowed to timeout |
| 2342 * $compileErrorSkip tests are skipped on browsers due to compile-time error | 2345 * $compileErrorSkip tests are skipped on browsers due to compile-time error |
| 2343 """; | 2346 """; |
| 2344 print(report); | 2347 print(report); |
| 2345 } | 2348 } |
| 2346 } | 2349 } |
| OLD | NEW |