Merge pull request #912 from Hixie/temp

Analyze more tests.
This commit is contained in:
Ian Hickson 2015-12-14 11:15:54 -08:00
commit d3dbc07f50

View File

@ -95,10 +95,13 @@ class AnalyzeCommand extends FlutterCommand {
// .../packages/*/bin/*.dart
// .../packages/*/lib/main.dart
// .../packages/*/test/*_test.dart
// .../packages/*/test/*/*_test.dart
Directory packages = new Directory(path.join(ArtifactStore.flutterRoot, 'packages'));
for (FileSystemEntity entry in packages.listSync()) {
if (entry is Directory) {
bool foundOne = false;
Directory binDirectory = new Directory(path.join(entry.path, 'bin'));
if (binDirectory.existsSync()) {
for (FileSystemEntity subentry in binDirectory.listSync()) {
@ -108,11 +111,30 @@ class AnalyzeCommand extends FlutterCommand {
}
}
}
String mainPath = path.join(entry.path, 'lib', 'main.dart');
if (FileSystemEntity.isFileSync(mainPath)) {
dartFiles.add(mainPath);
foundOne = true;
}
Directory testDirectory = new Directory(path.join(entry.path, 'test'));
if (testDirectory.existsSync()) {
for (FileSystemEntity entry in testDirectory.listSync()) {
if (entry is Directory) {
for (FileSystemEntity subentry in entry.listSync()) {
if (subentry is File && subentry.path.endsWith('_test.dart')) {
dartFiles.add(subentry.path);
foundTest = true;
}
}
} else if (entry is File && entry.path.endsWith('_test.dart')) {
dartFiles.add(entry.path);
foundTest = true;
}
}
}
if (foundOne)
pubSpecDirectories.add(entry.path);
}