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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 .where((name) => name != null) | 403 .where((name) => name != null) |
404 .toList(); | 404 .toList(); |
405 }); | 405 }); |
406 } | 406 } |
407 | 407 |
408 Future<Map> discoverPackagesInRepository() { | 408 Future<Map> discoverPackagesInRepository() { |
409 /* | 409 /* |
410 * Layout of packages inside the dart repository: | 410 * Layout of packages inside the dart repository: |
411 * dart/ | 411 * dart/ |
412 * pkg/PACKAGE_NAME | 412 * pkg/PACKAGE_NAME |
413 * pkg/third_party/PACKAGE_NAME | |
414 * third_party/pkg/PACKAGE_NAME | 413 * third_party/pkg/PACKAGE_NAME |
415 * runtime/observatory/PACKAGE_NAME | 414 * runtime/observatory/PACKAGE_NAME |
| 415 * sdk/lib/_internal/PACKAGE_NAME |
416 */ | 416 */ |
417 | 417 |
418 // Directories containing "-" are not valid pub packages and we therefore | 418 // Directories containing "-" are not valid pub packages and we therefore |
419 // do not include them in the list of packages. | 419 // do not include them in the list of packages. |
420 isValid(packageName) => | 420 isValid(packageName) => |
421 packageName != 'third_party' && !packageName.contains('-'); | 421 packageName != 'third_party' && !packageName.contains('-'); |
422 | 422 |
423 var dartDir = TestUtils.dartDir; | 423 var dartDir = TestUtils.dartDir; |
424 var futures = [ | 424 var futures = [ |
425 listDir(dartDir.append('pkg'), isValid), | 425 listDir(dartDir.append('pkg'), isValid), |
426 listDir(dartDir.append('third_party').append('pkg'), isValid), | 426 listDir(dartDir.append('third_party').append('pkg'), isValid), |
427 listDir(dartDir.append('runtime').append('observatory'), isValid), | 427 listDir(dartDir.append('runtime').append('observatory'), isValid), |
| 428 listDir(dartDir.append('sdk').append('lib').append('_internal'), isValid), |
428 ]; | 429 ]; |
429 return Future.wait(futures).then((results) { | 430 return Future.wait(futures).then((results) { |
430 var packageDirectories = {}; | 431 var packageDirectories = {}; |
431 for (var result in results) { | 432 for (var result in results) { |
432 for (var packageTuple in result) { | 433 for (var packageTuple in result) { |
433 String packageName = packageTuple[0]; | 434 String packageName = packageTuple[0]; |
434 String fullPath = packageTuple[1]; | 435 String fullPath = packageTuple[1]; |
435 String yamlFile = | 436 String yamlFile = |
436 new Path(fullPath).append('pubspec.yaml').toNativePath(); | 437 new Path(fullPath).append('pubspec.yaml').toNativePath(); |
437 if (new File(yamlFile).existsSync()) { | 438 if (new File(yamlFile).existsSync()) { |
(...skipping 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2392 for (var key in PATH_REPLACEMENTS.keys) { | 2393 for (var key in PATH_REPLACEMENTS.keys) { |
2393 if (path.startsWith(key)) { | 2394 if (path.startsWith(key)) { |
2394 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); | 2395 path = path.replaceFirst(key, PATH_REPLACEMENTS[key]); |
2395 break; | 2396 break; |
2396 } | 2397 } |
2397 } | 2398 } |
2398 } | 2399 } |
2399 return path; | 2400 return path; |
2400 } | 2401 } |
2401 } | 2402 } |
OLD | NEW |