summaryrefslogtreecommitdiff
path: root/googletest/src
diff options
context:
space:
mode:
authorCopybara-Service <copybara-worker@google.com>2022-09-27 13:49:56 -0700
committerCopybara-Service <copybara-worker@google.com>2022-09-27 13:49:56 -0700
commite23cdb78e9fef1f69a9ef917f447add5638daf2a (patch)
tree6d2598794d2cf8a8be9475663d0921317142fdfa /googletest/src
parentdfa67352364e00452360e1fa5d59677459712ee7 (diff)
parent7a3abfec0aa5255f0ecf246987422493e9ca6a75 (diff)
downloadgoogletest-git-e23cdb78e9fef1f69a9ef917f447add5638daf2a.tar.gz
Merge pull request #4016 from Maratyszcza:qurt
PiperOrigin-RevId: 477265396 Change-Id: I781dae4ef2c5b6c771d960f1ec5a3c5cff0e97ad
Diffstat (limited to 'googletest/src')
-rw-r--r--googletest/src/gtest-filepath.cc4
-rw-r--r--googletest/src/gtest_main.cc12
2 files changed, 14 insertions, 2 deletions
diff --git a/googletest/src/gtest-filepath.cc b/googletest/src/gtest-filepath.cc
index f6ee90cd..6767db0d 100644
--- a/googletest/src/gtest-filepath.cc
+++ b/googletest/src/gtest-filepath.cc
@@ -96,7 +96,7 @@ static bool IsPathSeparator(char c) {
FilePath FilePath::GetCurrentDir() {
#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || \
GTEST_OS_WINDOWS_RT || GTEST_OS_ESP8266 || GTEST_OS_ESP32 || \
- GTEST_OS_XTENSA
+ GTEST_OS_XTENSA || GTEST_OS_QURT
// These platforms do not have a current directory, so we just return
// something reasonable.
return FilePath(kCurrentDirectoryString);
@@ -323,7 +323,7 @@ bool FilePath::CreateFolder() const {
delete[] unicode;
#elif GTEST_OS_WINDOWS
int result = _mkdir(pathname_.c_str());
-#elif GTEST_OS_ESP8266 || GTEST_OS_XTENSA
+#elif GTEST_OS_ESP8266 || GTEST_OS_XTENSA || GTEST_OS_QURT
// do nothing
int result = 0;
#else
diff --git a/googletest/src/gtest_main.cc b/googletest/src/gtest_main.cc
index 44976375..5abaa29f 100644
--- a/googletest/src/gtest_main.cc
+++ b/googletest/src/gtest_main.cc
@@ -32,9 +32,12 @@
#include "gtest/gtest.h"
#if GTEST_OS_ESP8266 || GTEST_OS_ESP32
+// Arduino-like platforms: program entry points are setup/loop instead of main.
+
#if GTEST_OS_ESP8266
extern "C" {
#endif
+
void setup() { testing::InitGoogleTest(); }
void loop() { RUN_ALL_TESTS(); }
@@ -43,7 +46,16 @@ void loop() { RUN_ALL_TESTS(); }
}
#endif
+#elif GTEST_OS_QURT
+// QuRT: program entry point is main, but argc/argv are unusable.
+
+GTEST_API_ int main() {
+ printf("Running main() from %s\n", __FILE__);
+ testing::InitGoogleTest();
+ return RUN_ALL_TESTS();
+}
#else
+// Normal platforms: program entry point is main, argc/argv are initialized.
GTEST_API_ int main(int argc, char **argv) {
printf("Running main() from %s\n", __FILE__);