summaryrefslogtreecommitdiffstats
path: root/googletest/include/gtest
diff options
context:
space:
mode:
authorChris <chrisjohnsonmail@gmail.com>2019-01-04 03:23:06 (GMT)
committerChris <chrisjohnsonmail@gmail.com>2019-01-04 03:23:06 (GMT)
commit23e693787399d5d95b25f1e0078419e9b3d921b8 (patch)
tree1308611459c6a785a3590811aac5a4b48499ba88 /googletest/include/gtest
parent202dcabf39fd266f676276f17c1823ef1b5eb5a7 (diff)
downloadgoogletest-23e693787399d5d95b25f1e0078419e9b3d921b8.zip
googletest-23e693787399d5d95b25f1e0078419e9b3d921b8.tar.gz
googletest-23e693787399d5d95b25f1e0078419e9b3d921b8.tar.bz2
misc: Reapply Arduino functions
Diffstat (limited to 'googletest/include/gtest')
-rw-r--r--googletest/include/gtest/gtest.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/googletest/include/gtest/gtest.h b/googletest/include/gtest/gtest.h
index a0df29e..70c93da 100644
--- a/googletest/include/gtest/gtest.h
+++ b/googletest/include/gtest/gtest.h
@@ -2499,6 +2499,20 @@ inline int RUN_ALL_TESTS() {
return ::testing::UnitTest::GetInstance()->Run();
}
+#ifdef ARDUINO
+inline void gtest_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);
+}
+
+inline void gtest_loop() { RUN_ALL_TESTS(); }
+#endif
+
GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
#endif // GTEST_INCLUDE_GTEST_GTEST_H_