Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 5aed693

Browse files
authored
Test running the macOS engine has no stray logging (#54716)
Assert that running the macOS engine does not log anything unexpected See also issue flutter/flutter#111577 Similar Windows check in #47774 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent 385b60b commit 5aed693

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

shell/platform/darwin/macos/framework/Source/FlutterEngineTest.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ @implementation MockableFlutterEngine
210210

211211
// Replace stdout stream buffer with our own.
212212
StreamCapture stdout_capture(&std::cout);
213+
StreamCapture stderr_capture(&std::cerr);
213214

214215
// Launch the test entrypoint.
215216
FlutterEngine* engine = GetFlutterEngine();
@@ -219,9 +220,12 @@ @implementation MockableFlutterEngine
219220
latch.Wait();
220221

221222
stdout_capture.Stop();
223+
stderr_capture.Stop();
222224

223225
// Verify hello world was written to stdout.
224-
EXPECT_TRUE(stdout_capture.GetOutput().find("Hello logging") != std::string::npos);
226+
// Check equality to ensure no unexpected stray logging.
227+
EXPECT_EQ(stdout_capture.GetOutput(), "flutter: Hello logging\n");
228+
EXPECT_TRUE(stderr_capture.GetOutput().empty());
225229
}
226230

227231
TEST_F(FlutterEngineTest, DISABLED_BackgroundIsBlack) {

0 commit comments

Comments
 (0)