aboutsummaryrefslogtreecommitdiffstats
path: root/googletest/src
diff options
context:
space:
mode:
authorvslashg <gfalcon@google.com>2019-10-25 10:21:03 -0400
committervslashg <gfalcon@google.com>2019-10-25 10:21:03 -0400
commit540835fa687e73c9d634c710e62a721c2be40786 (patch)
tree7103d19b9edeff546e862b88b6e90226382f81de /googletest/src
parent37f322783175a66c11785d17fc153477b0777753 (diff)
parent778733f9ecdd2b14a0167df54dd25d2d6f6e24f6 (diff)
downloadgoogletest-540835fa687e73c9d634c710e62a721c2be40786.tar.gz
googletest-540835fa687e73c9d634c710e62a721c2be40786.tar.bz2
googletest-540835fa687e73c9d634c710e62a721c2be40786.zip
Merge pull request #2515 from ciband:feat/support_esp8266
PiperOrigin-RevId: 276333426
Diffstat (limited to 'googletest/src')
-rw-r--r--googletest/src/gtest-filepath.cc5
-rw-r--r--googletest/src/gtest.cc2
-rw-r--r--googletest/src/gtest_main.cc9
3 files changed, 14 insertions, 2 deletions
diff --git a/googletest/src/gtest-filepath.cc b/googletest/src/gtest-filepath.cc
index bd7b99ff..9aad12fb 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);
@@ -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.cc b/googletest/src/gtest.cc
index 6ddc5c80..8afb070d 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -4506,6 +4506,7 @@ class ScopedPrematureExitFile {
}
~ScopedPrematureExitFile() {
+#if !defined GTEST_OS_ESP8266
if (!premature_exit_filepath_.empty()) {
int retval = remove(premature_exit_filepath_.c_str());
if (retval) {
@@ -4514,6 +4515,7 @@ class ScopedPrematureExitFile {
<< retval;
}
}
+#endif
}
private:
diff --git a/googletest/src/gtest_main.cc b/googletest/src/gtest_main.cc
index f6e1dd96..46b27c3d 100644
--- a/googletest/src/gtest_main.cc
+++ b/googletest/src/gtest_main.cc
@@ -30,13 +30,20 @@
#include <cstdio>
#include "gtest/gtest.h"
-#ifdef ARDUINO
+#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) {