Update dartdocs devicelab test to handle current analyzer output (#24582)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user