Unverified Commit e0f642ec authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Update dartdocs devicelab test to handle current analyzer output (#24582)

parent f683e4c4
......@@ -15,7 +15,7 @@ Future<void> main() async {
final Stopwatch clock = Stopwatch()..start();
final Process analysis = await startProcess(
path.join(flutterDirectory.path, 'bin', 'flutter'),
<String>['analyze', '--no-preamble', '--no-congratulate', '--flutter-repo', '--dartdocs'],
<String>['analyze', '--no-preamble', '--flutter-repo', '--dartdocs'],
workingDirectory: flutterDirectory.path,
);
int publicMembers = 0;
......@@ -34,18 +34,24 @@ Future<void> main() async {
// ignore this line
} else if (entry.isNotEmpty) {
otherLines += 1;
print('^ not sure what to do with that line ^');
}
}
bool sawFinalLine = false;
await for (String entry in analysis.stderr.transform<String>(utf8.decoder).transform<String>(const LineSplitter())) {
print('analyzer stderr: $entry');
if (entry.startsWith('[lint] ')) {
// ignore this line
if (entry.contains('(ran in ') && !sawFinalLine) {
// ignore this line once
sawFinalLine = true;
} else {
otherLines += 1;
print('^ not sure what to do with that line ^');
}
}
final int result = await analysis.exitCode;
clock.stop();
if (!sawFinalLine)
throw Exception('flutter analyze did not output final message');
if (publicMembers == 0 && otherErrors == 0 && result != 0)
throw Exception('flutter analyze exited with unexpected error code $result');
if (publicMembers != 0 && otherErrors != 0 && result == 0)
......
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