Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/google/googletest.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'googletest/src/gtest_main.cc')
-rw-r--r--googletest/src/gtest_main.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/googletest/src/gtest_main.cc b/googletest/src/gtest_main.cc
index 44976375..d2260488 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
+// Aduino-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__);