diff options
author | Chris Johnson <chrisjohnsonmail@gmail.com> | 2019-08-29 17:34:26 (GMT) |
---|---|---|
committer | Chris Johnson <chrisjohnsonmail@gmail.com> | 2019-10-11 16:47:49 (GMT) |
commit | c2206b05aa0f2fbdf5b353b32cd565b0e89d3fa6 (patch) | |
tree | 9174a533f344d2a13ab1802767a86be0ffcbb7e0 /googletest/src | |
parent | 40a6b9662199890b20ccbac3b964ce04713d8ede (diff) | |
download | googletest-c2206b05aa0f2fbdf5b353b32cd565b0e89d3fa6.zip googletest-c2206b05aa0f2fbdf5b353b32cd565b0e89d3fa6.tar.gz googletest-c2206b05aa0f2fbdf5b353b32cd565b0e89d3fa6.tar.bz2 |
Add ESP8266 configs to PlatformIO build
Added various conditional compliations for ESP8266 to stub out
missing functionality.
Diffstat (limited to 'googletest/src')
-rw-r--r-- | googletest/src/gtest-filepath.cc | 5 | ||||
-rw-r--r-- | googletest/src/gtest_main.cc | 9 |
2 files changed, 12 insertions, 2 deletions
diff --git a/googletest/src/gtest-filepath.cc b/googletest/src/gtest-filepath.cc index eb1024e..7e03e81 100644 --- a/googletest/src/gtest-filepath.cc +++ b/googletest/src/gtest-filepath.cc @@ -236,7 +236,7 @@ bool FilePath::DirectoryExists() const { result = true; } #else - posix::StatStruct file_stat; + posix::StatStruct file_stat = {}; result = posix::Stat(path.c_str(), &file_stat) == 0 && posix::IsDir(file_stat); #endif // GTEST_OS_WINDOWS_MOBILE @@ -323,6 +323,9 @@ bool FilePath::CreateFolder() const { delete [] unicode; #elif GTEST_OS_WINDOWS int result = _mkdir(pathname_.c_str()); +#elif GTEST_OS_ESP8266 + // do nothing + int result = 0; #else int result = mkdir(pathname_.c_str(), 0777); #endif // GTEST_OS_WINDOWS_MOBILE diff --git a/googletest/src/gtest_main.cc b/googletest/src/gtest_main.cc index 361cb73..3747925 100644 --- a/googletest/src/gtest_main.cc +++ b/googletest/src/gtest_main.cc @@ -30,13 +30,20 @@ #include <cstdio> #include "gtest/gtest.h" -#if defined GTEST_OS_ESP8266 || defined GTEST_OS_ESP32 +#if GTEST_OS_ESP8266 || GTEST_OS_ESP32 +# if GTEST_OS_ESP8266 +extern "C" { +# endif void setup() { testing::InitGoogleTest(); } void loop() { RUN_ALL_TESTS(); } +# if GTEST_OS_ESP8266 +} +# endif + #else GTEST_API_ int main(int argc, char **argv) { |