From 2acd53824402affcf473b2355d7323047e660e86 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Tue, 27 Jun 2023 20:46:32 -0700 Subject: [PATCH] On platforms without a file system, don't log an error when no alternative output format is requested. Fixes #4299 PiperOrigin-RevId: 543932266 Change-Id: Ide78c313ecf6829e4910f4a8407275c81edb3848 --- googletest/src/gtest.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index d9fd2770..d1eddf10 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -5655,8 +5655,10 @@ void UnitTestImpl::ConfigureXmlOutput() { << output_format << "\" ignored."; } #else - GTEST_LOG_(ERROR) << "ERROR: alternative output formats require " - << "GTEST_HAS_FILE_SYSTEM to be enabled"; + if (!output_format.empty()) { + GTEST_LOG_(ERROR) << "ERROR: alternative output formats require " + << "GTEST_HAS_FILE_SYSTEM to be enabled"; + } #endif // GTEST_HAS_FILE_SYSTEM }