aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/src
diff options
context:
space:
mode:
authorChris Johnson <chrisjohnsonmail@gmail.com>2018-12-04 21:44:39 -0600
committerGitHub <noreply@github.com>2018-12-04 21:44:39 -0600
commit2c8ab3f18b2ed9fdc1742ec60b6e34248d04efe3 (patch)
treead8950e1471e577aa76519049ca1f269a0e1f4f3 /googlemock/src
parentfe14e3030737509c2b9f9adad80ff56f80e988a2 (diff)
downloadgoogletest-2c8ab3f18b2ed9fdc1742ec60b6e34248d04efe3.tar.gz
googletest-2c8ab3f18b2ed9fdc1742ec60b6e34248d04efe3.tar.bz2
googletest-2c8ab3f18b2ed9fdc1742ec60b6e34248d04efe3.zip
feat: Add initial support for PlatformIO and Arduino
Diffstat (limited to 'googlemock/src')
-rw-r--r--googlemock/src/gmock_main.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/googlemock/src/gmock_main.cc b/googlemock/src/gmock_main.cc
index a3a271e6..50d0b426 100644
--- a/googlemock/src/gmock_main.cc
+++ b/googlemock/src/gmock_main.cc
@@ -32,6 +32,20 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
+#ifdef ARDUINO
+void setup() {
+ int argc = 0;
+ char** argv = nullptr;
+ // Since Google Mock depends on Google Test, InitGoogleMock() is
+ // also responsible for initializing Google Test. Therefore there's
+ // no need for calling testing::InitGoogleTest() separately.
+ testing::InitGoogleMock(&argc, argv);
+}
+void loop() {
+ RUN_ALL_TESTS();
+}
+#else
+
// MS C++ compiler/linker has a bug on Windows (not on Windows CE), which
// causes a link error when _tmain is defined in a static library and UNICODE
// is enabled. For this reason instead of _tmain, main function is used on
@@ -52,3 +66,5 @@ GTEST_API_ int main(int argc, char** argv) {
testing::InitGoogleMock(&argc, argv);
return RUN_ALL_TESTS();
}
+#endif
+