Test running the macOS engine has no stray logging (flutter/engine#54716)
Assert that running the macOS engine does not log anything unexpected See also issue https://github.com/flutter/flutter/issues/111577 Similar Windows check in https://github.com/flutter/engine/pull/47774 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
@@ -210,6 +210,7 @@ TEST_F(FlutterEngineTest, CanLogToStdout) {
|
||||
|
||||
// Replace stdout stream buffer with our own.
|
||||
StreamCapture stdout_capture(&std::cout);
|
||||
StreamCapture stderr_capture(&std::cerr);
|
||||
|
||||
// Launch the test entrypoint.
|
||||
FlutterEngine* engine = GetFlutterEngine();
|
||||
@@ -219,9 +220,12 @@ TEST_F(FlutterEngineTest, CanLogToStdout) {
|
||||
latch.Wait();
|
||||
|
||||
stdout_capture.Stop();
|
||||
stderr_capture.Stop();
|
||||
|
||||
// Verify hello world was written to stdout.
|
||||
EXPECT_TRUE(stdout_capture.GetOutput().find("Hello logging") != std::string::npos);
|
||||
// Check equality to ensure no unexpected stray logging.
|
||||
EXPECT_EQ(stdout_capture.GetOutput(), "flutter: Hello logging\n");
|
||||
EXPECT_TRUE(stderr_capture.GetOutput().empty());
|
||||
}
|
||||
|
||||
TEST_F(FlutterEngineTest, DISABLED_BackgroundIsBlack) {
|
||||
|
||||
Reference in New Issue
Block a user