From 06fa590cd9303757d63772a5979e14a2b37b8bb5 Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Fri, 2 Apr 2021 09:29:03 +0800 Subject: [PATCH] [flutter_tools] Fix breakage when test main is tagged with @doNotStore (#79501) --- packages/flutter_tools/lib/src/test/flutter_platform.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/flutter_tools/lib/src/test/flutter_platform.dart b/packages/flutter_tools/lib/src/test/flutter_platform.dart index b49b2d6527b..6544d5d6bf0 100644 --- a/packages/flutter_tools/lib/src/test/flutter_platform.dart +++ b/packages/flutter_tools/lib/src/test/flutter_platform.dart @@ -182,8 +182,11 @@ Future _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