Commit d3dbc07f authored by Ian Hickson's avatar Ian Hickson

Merge pull request #912 from Hixie/temp

Analyze more tests.
parents 07341e32 889a1e8e
...@@ -95,10 +95,13 @@ class AnalyzeCommand extends FlutterCommand { ...@@ -95,10 +95,13 @@ class AnalyzeCommand extends FlutterCommand {
// .../packages/*/bin/*.dart // .../packages/*/bin/*.dart
// .../packages/*/lib/main.dart // .../packages/*/lib/main.dart
// .../packages/*/test/*_test.dart
// .../packages/*/test/*/*_test.dart
Directory packages = new Directory(path.join(ArtifactStore.flutterRoot, 'packages')); Directory packages = new Directory(path.join(ArtifactStore.flutterRoot, 'packages'));
for (FileSystemEntity entry in packages.listSync()) { for (FileSystemEntity entry in packages.listSync()) {
if (entry is Directory) { if (entry is Directory) {
bool foundOne = false; bool foundOne = false;
Directory binDirectory = new Directory(path.join(entry.path, 'bin')); Directory binDirectory = new Directory(path.join(entry.path, 'bin'));
if (binDirectory.existsSync()) { if (binDirectory.existsSync()) {
for (FileSystemEntity subentry in binDirectory.listSync()) { for (FileSystemEntity subentry in binDirectory.listSync()) {
...@@ -108,11 +111,30 @@ class AnalyzeCommand extends FlutterCommand { ...@@ -108,11 +111,30 @@ class AnalyzeCommand extends FlutterCommand {
} }
} }
} }
String mainPath = path.join(entry.path, 'lib', 'main.dart'); String mainPath = path.join(entry.path, 'lib', 'main.dart');
if (FileSystemEntity.isFileSync(mainPath)) { if (FileSystemEntity.isFileSync(mainPath)) {
dartFiles.add(mainPath); dartFiles.add(mainPath);
foundOne = true; 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) if (foundOne)
pubSpecDirectories.add(entry.path); pubSpecDirectories.add(entry.path);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment