Merge pull request #2000 from ciband:feat/add_support_platformio

PiperOrigin-RevId: 225552792
This commit is contained in:
Gennadiy Civil
2018-12-14 13:54:42 -05:00
8 changed files with 134 additions and 18 deletions

View File

@@ -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