summaryrefslogtreecommitdiffstats
path: root/googletest/src
diff options
context:
space:
mode:
authorGennadiy Civil <misterg@google.com>2018-12-14 18:54:42 (GMT)
committerGennadiy Civil <misterg@google.com>2018-12-14 18:54:43 (GMT)
commitb5f5c596a9915106c1ac36a3f89db4e0e49c07d1 (patch)
tree2bc11702641f6bcca31032b4c343238d7b9178f6 /googletest/src
parentc6cb7e033591528a5fe2c63157a0d8ce927740dc (diff)
parent31eb5e9b873af4b509be2f77616113007fa0de9d (diff)
downloadgoogletest-b5f5c596a9915106c1ac36a3f89db4e0e49c07d1.zip
googletest-b5f5c596a9915106c1ac36a3f89db4e0e49c07d1.tar.gz
googletest-b5f5c596a9915106c1ac36a3f89db4e0e49c07d1.tar.bz2
Merge pull request #2000 from ciband:feat/add_support_platformio
PiperOrigin-RevId: 225552792
Diffstat (limited to 'googletest/src')
-rw-r--r--googletest/src/gtest_main.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/googletest/src/gtest_main.cc b/googletest/src/gtest_main.cc
index 2113f62..ee1ae52 100644
--- a/googletest/src/gtest_main.cc
+++ b/googletest/src/gtest_main.cc
@@ -30,8 +30,24 @@
#include <stdio.h>
#include "gtest/gtest.h"
+#ifdef ARDUINO
+void setup() {
+ // Since Arduino doesn't have a command line, fake out the argc/argv arguments
+ int argc = 1;
+ const auto arg0 = "PlatformIO";
+ char* argv0 = const_cast<char*>(arg0);
+ char** argv = &argv0;
+
+ 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