summaryrefslogtreecommitdiffstats
path: root/googletest/src
diff options
context:
space:
mode:
authorChris <chrisjohnsonmail@gmail.com>2019-01-07 12:37:34 -0600
committerChris <chrisjohnsonmail@gmail.com>2019-01-07 12:37:34 -0600
commit45c58aa6f3608224975f433e1f4e4b53aa34f97c (patch)
tree29025f5e757fdcfaef94a91ca40044e8d0ed0c0a /googletest/src
parent23e693787399d5d95b25f1e0078419e9b3d921b8 (diff)
downloadgoogletest-45c58aa6f3608224975f433e1f4e4b53aa34f97c.tar.gz
googletest-45c58aa6f3608224975f433e1f4e4b53aa34f97c.zip
fix: Add Arduino setup()/loop() functions back
Added setup()/loop() functions back to *_main.cc files to support compiling in CI. Future features could enable this for the end user.
Diffstat (limited to 'googletest/src')
-rw-r--r--googletest/src/gtest_main.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/googletest/src/gtest_main.cc b/googletest/src/gtest_main.cc
index 2113f621..92285a3d 100644
--- a/googletest/src/gtest_main.cc
+++ b/googletest/src/gtest_main.cc
@@ -30,8 +30,22 @@
#include <stdio.h>
#include "gtest/gtest.h"
+#ifdef ARDUINO
+void setup() {
+ int argc = 0;
+ char** argv = nullptr;
+ testing::InitGoogleTest(&argc, argv);
+}
+
+void loop() { RUN_ALL_TESTS(); }
+
+#else
+
GTEST_API_ int main(int argc, char **argv) {
printf("Running main() from %s\n", __FILE__);
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
+
+#endif
+
OpenPOWER on IntegriCloud