summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Johnson <chrisjohnsonmail@gmail.com>2019-08-28 14:39:35 (GMT)
committerChris Johnson <chrisjohnsonmail@gmail.com>2019-10-11 16:47:49 (GMT)
commit40a6b9662199890b20ccbac3b964ce04713d8ede (patch)
treed2123c108b6a6bbcf7d5f07dc792daab57c993fb
parentba513d2c9525a7c986c115ed5d603f2cf17c6016 (diff)
downloadgoogletest-40a6b9662199890b20ccbac3b964ce04713d8ede.zip
googletest-40a6b9662199890b20ccbac3b964ce04713d8ede.tar.gz
googletest-40a6b9662199890b20ccbac3b964ce04713d8ede.tar.bz2
feat: Add support for ESP8266 platform
Added support for ESP8266 Arduino platform. Refactored Arduino defines to use the GTEST_OS_* model.
-rw-r--r--googlemock/src/gmock_main.cc2
-rw-r--r--googletest/include/gtest/internal/gtest-port-arch.h4
-rw-r--r--googletest/src/gtest-filepath.cc2
-rw-r--r--googletest/src/gtest.cc2
-rw-r--r--googletest/src/gtest_main.cc2
5 files changed, 9 insertions, 3 deletions
diff --git a/googlemock/src/gmock_main.cc b/googlemock/src/gmock_main.cc
index 98611b9..4d4f48b 100644
--- a/googlemock/src/gmock_main.cc
+++ b/googlemock/src/gmock_main.cc
@@ -32,7 +32,7 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
-#ifdef ARDUINO
+#if defined GTEST_OS_ESP8266 || defined GTEST_OS_ESP32
void setup() {
// Since Google Mock depends on Google Test, InitGoogleMock() is
// also responsible for initializing Google Test. Therefore there's
diff --git a/googletest/include/gtest/internal/gtest-port-arch.h b/googletest/include/gtest/internal/gtest-port-arch.h
index cece93d..e2acad3 100644
--- a/googletest/include/gtest/internal/gtest-port-arch.h
+++ b/googletest/include/gtest/internal/gtest-port-arch.h
@@ -102,6 +102,10 @@
# define GTEST_OS_QNX 1
#elif defined(__HAIKU__)
#define GTEST_OS_HAIKU 1
+#elif defined ESP8266
+# define GTEST_OS_ESP8266 1
+#elif defined ESP32
+# define GTEST_OS_ESP32 1
#endif // __CYGWIN__
#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
diff --git a/googletest/src/gtest-filepath.cc b/googletest/src/gtest-filepath.cc
index bd7b99f..eb1024e 100644
--- a/googletest/src/gtest-filepath.cc
+++ b/googletest/src/gtest-filepath.cc
@@ -93,7 +93,7 @@ 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 || defined(ESP_PLATFORM)
+ GTEST_OS_WINDOWS_RT || GTEST_OS_ESP8266 || GTEST_OS_ESP32
// These platforms do not have a current directory, so we just return
// something reasonable.
return FilePath(kCurrentDirectoryString);
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index a5b4e5a..a11ce18 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -4508,6 +4508,7 @@ class ScopedPrematureExitFile {
}
~ScopedPrematureExitFile() {
+ #if !defined GTEST_OS_ESP8266
if (!premature_exit_filepath_.empty()) {
int retval = remove(premature_exit_filepath_.c_str());
if (retval) {
@@ -4516,6 +4517,7 @@ class ScopedPrematureExitFile {
<< retval;
}
}
+ #endif
}
private:
diff --git a/googletest/src/gtest_main.cc b/googletest/src/gtest_main.cc
index f6e1dd9..361cb73 100644
--- a/googletest/src/gtest_main.cc
+++ b/googletest/src/gtest_main.cc
@@ -30,7 +30,7 @@
#include <cstdio>
#include "gtest/gtest.h"
-#ifdef ARDUINO
+#if defined GTEST_OS_ESP8266 || defined GTEST_OS_ESP32
void setup() {
testing::InitGoogleTest();
}