[flutter_tools] Fix breakage when test main is tagged with @doNotStore (#79501)

This commit is contained in:
Jia Hao 2021-04-02 09:29:03 +08:00 committed by GitHub
parent 11276d060f
commit 06fa590cd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -182,8 +182,11 @@ Future<void> _testMain() async {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
''');
}
// Don't propagate the return value of `test.main` here. If the `main`
// function on users` test is annotated with `@doNotStore`, it will cause an
// analyzer error otherwise.
buffer.write('''
return test.main();
await Future(test.main);
}
/// Capture any top-level errors (mostly lazy syntax errors, since other are