| 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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 .toList(); | 430 .toList(); |
| 431 }); | 431 }); |
| 432 } | 432 } |
| 433 | 433 |
| 434 Future<Map> discoverPackagesInRepository() { | 434 Future<Map> discoverPackagesInRepository() { |
| 435 /* | 435 /* |
| 436 * Layout of packages inside the dart repository: | 436 * Layout of packages inside the dart repository: |
| 437 * dart/ | 437 * dart/ |
| 438 * pkg/PACKAGE_NAME | 438 * pkg/PACKAGE_NAME |
| 439 * third_party/pkg/PACKAGE_NAME | 439 * third_party/pkg/PACKAGE_NAME |
| 440 * third_party/pkg_tested/PACKAGE_NAME | |
| 441 * runtime/observatory/PACKAGE_NAME | 440 * runtime/observatory/PACKAGE_NAME |
| 442 * sdk/lib/_internal/PACKAGE_NAME | 441 * sdk/lib/_internal/PACKAGE_NAME |
| 443 */ | 442 */ |
| 444 | 443 |
| 445 // Directories containing "-" are not valid pub packages and we therefore | 444 // Directories containing "-" are not valid pub packages and we therefore |
| 446 // do not include them in the list of packages. | 445 // do not include them in the list of packages. |
| 447 isValid(packageName) => | 446 isValid(packageName) => |
| 448 packageName != 'third_party' && !packageName.contains('-'); | 447 packageName != 'third_party' && !packageName.contains('-'); |
| 449 | 448 |
| 450 var dartDir = TestUtils.dartDir; | 449 var dartDir = TestUtils.dartDir; |
| 451 var futures = [ | 450 var futures = [ |
| 452 listDir(dartDir.append('pkg'), isValid), | 451 listDir(dartDir.append('pkg'), isValid), |
| 453 listDir(dartDir.append('third_party').append('pkg'), isValid), | 452 listDir(dartDir.append('third_party').append('pkg'), isValid), |
| 454 listDir(dartDir.append('third_party').append('pkg_tested'), isValid), | |
| 455 listDir(dartDir.append('runtime').append('observatory'), isValid), | 453 listDir(dartDir.append('runtime').append('observatory'), isValid), |
| 456 listDir(dartDir.append('sdk').append('lib').append('_internal'), isValid), | 454 listDir(dartDir.append('sdk').append('lib').append('_internal'), isValid), |
| 457 ]; | 455 ]; |
| 458 return Future.wait(futures).then((results) { | 456 return Future.wait(futures).then((results) { |
| 459 var packageDirectories = {}; | 457 var packageDirectories = {}; |
| 460 for (var result in results) { | 458 for (var result in results) { |
| 461 for (var packageTuple in result) { | 459 for (var packageTuple in result) { |
| 462 String packageName = packageTuple[0]; | 460 String packageName = packageTuple[0]; |
| 463 String fullPath = packageTuple[1]; | 461 String fullPath = packageTuple[1]; |
| 464 String yamlFile = | 462 String yamlFile = |
| (...skipping 1991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2456 for (var key in PATH_REPLACEMENTS.keys) { | 2454 for (var key in PATH_REPLACEMENTS.keys) { |
| 2457 if (path.startsWith(key)) { | 2455 if (path.startsWith(key)) { |
| 2458 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); | 2456 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); |
| 2459 break; | 2457 break; |
| 2460 } | 2458 } |
| 2461 } | 2459 } |
| 2462 } | 2460 } |
| 2463 return path; | 2461 return path; |
| 2464 } | 2462 } |
| 2465 } | 2463 } |
| OLD | NEW |