From 3f05f651ae3621db58468153e32016bc1397800b Mon Sep 17 00:00:00 2001 From: Abseil Team Date: Thu, 5 Sep 2019 18:41:05 -0400 Subject: [PATCH] Googletest export Extend gtest-port and stubs for ESP_PLATFORM ESP_PLATFORM is the macro used to indicate compilation for the ESP32 using the esp-idf. This isn't a fully posix compatible system so various features of google test need to be stubbed out in order for it to work. It's oddly similar to the GTEST_OS_WINDOWS_PHONE setup. PiperOrigin-RevId: 267471968 --- googletest/src/gtest-filepath.cc | 4 ++-- googletest/src/gtest.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/googletest/src/gtest-filepath.cc b/googletest/src/gtest-filepath.cc index 322fbb1b..bd7b99ff 100644 --- a/googletest/src/gtest-filepath.cc +++ b/googletest/src/gtest-filepath.cc @@ -93,8 +93,8 @@ static bool IsPathSeparator(char c) { // Returns the current working directory, or "" if unsuccessful. FilePath FilePath::GetCurrentDir() { #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || \ - GTEST_OS_WINDOWS_RT || ARDUINO - // Windows CE and Arduino don't have a current directory, so we just return + GTEST_OS_WINDOWS_RT || ARDUINO || defined(ESP_PLATFORM) + // These platforms do not have a current directory, so we just return // something reasonable. return FilePath(kCurrentDirectoryString); #elif GTEST_OS_WINDOWS diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc index cbd48d31..0d1f4136 100644 --- a/googletest/src/gtest.cc +++ b/googletest/src/gtest.cc @@ -3038,7 +3038,7 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) { va_start(args, fmt); #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_ZOS || GTEST_OS_IOS || \ - GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT + GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT || defined(ESP_PLATFORM) const bool use_color = AlwaysFalse(); #else static const bool in_color_mode =