diff --git a/test/automatic/main.cpp b/test/automatic/main.cpp index a95b0dafd..29dd1b5d7 100644 --- a/test/automatic/main.cpp +++ b/test/automatic/main.cpp @@ -113,8 +113,10 @@ struct TestCase // cases. bool isolated; // 内部要 fork 的用例须同时隔离并跳过 PlatformInit,且自行确保 fork 时没有其他线程。 + // 接管 STDIO 写端并检查全部输出的用例也跳过,避免 STDIO 线程的日志混入输出。 // Cases that fork internally need isolation, no PlatformInit, and no other threads at - // fork. + // fork. Cases that take over the STDIO writer and check all of its output skip it as + // well, so no STDIO worker log lands in that output. bool platform_init = true; }; @@ -279,7 +281,7 @@ constexpr GroupedTestCase kMainTestCases[] = { false}}, {"linux_host_tests", {"linux_database_raw", &RunVoidEntry, true, false}}, - {"system_tests", {"logger", &RunVoidEntry, true}}, + {"system_tests", {"logger", &RunVoidEntry, true, false}}, {"system_tests", {"linux_shm_topic", &RunVoidEntry, true, false}}, {"system_tests", {"linux_shm_bench", &RunBenchLinuxSharedTopicSet, true, false}}, diff --git a/test/automatic/middleware/logger/logger/test_logger.cpp b/test/automatic/middleware/logger/logger/test_logger.cpp index 703b06e6d..5878a2b0d 100644 --- a/test/automatic/middleware/logger/logger/test_logger.cpp +++ b/test/automatic/middleware/logger/logger/test_logger.cpp @@ -62,8 +62,9 @@ void test_logger() auto* old_stream = LibXR::STDIO::write_stream_; // 临时把日志输出接到 Pipe,检查实际生成的文本;读取后恢复 STDIO 的原指针。 + // 本用例不执行 PlatformInit,没有 STDIO 线程会同时写日志。 // Redirect logging to a Pipe to inspect generated text, then restore the original STDIO - // pointers. + // pointers. The case runs without PlatformInit, so no STDIO worker logs meanwhile. LibXR::STDIO::write_ = &output.GetWritePort(); LibXR::STDIO::write_stream_ = nullptr;