copied everything over from 2012 and removed all of the actual robot code except the drivetrain stuff
git-svn-id: https://robotics.mvla.net/svn/frc971/2013/trunk/src@4078 f308d9b7-e957-4cde-b6ac-9a88185e7312
diff --git a/aos/crio/googletest/google_test_server.cc b/aos/crio/googletest/google_test_server.cc
new file mode 100644
index 0000000..46631b5
--- /dev/null
+++ b/aos/crio/googletest/google_test_server.cc
@@ -0,0 +1,45 @@
+#include <stdio.h>
+
+#include "gtest/gtest.h"
+
+extern "C" int run_gtest(char *arg1, char *arg2, char *arg3, char *arg4,
+ char *arg5, char *arg6, char *arg7, char *arg8,
+ char *arg9, char *arg10, char *arg11) {
+ static bool run = false;
+ if (!run) {
+ run = true;
+ } else {
+ printf("error: gtest only supports being run once\n");
+ return -1;
+ }
+
+ char *argv[1 + 11 + 1];
+ // In /tmp in case it wants to write anything relative to "itself".
+ argv[0] = const_cast<char *>("/tmp/aos-crio-googletest-runner");
+ argv[12] = NULL; // the argv passed to main is always NULL-terminated
+ argv[1] = arg1;
+ argv[2] = arg2;
+ argv[3] = arg3;
+ argv[4] = arg4;
+ argv[5] = arg5;
+ argv[6] = arg6;
+ argv[7] = arg7;
+ argv[8] = arg8;
+ argv[9] = arg9;
+ argv[10] = arg10;
+ argv[11] = arg11;
+ int argc = 0;
+ while (argc[argv] != NULL) ++argc;
+
+ testing::GTEST_FLAG(color) = "yes";
+ testing::InitGoogleTest(&argc, argv);
+
+ if (argc > 1) {
+ printf("warning: flags not recognized by gtest passed\n");
+ for (int i = 1; i < argc; ++i) {
+ printf("\t%s\n", argv[i]);
+ }
+ }
+
+ return RUN_ALL_TESTS();
+}
diff --git a/aos/crio/googletest/googletest.gyp b/aos/crio/googletest/googletest.gyp
new file mode 100644
index 0000000..d887ecd
--- /dev/null
+++ b/aos/crio/googletest/googletest.gyp
@@ -0,0 +1,14 @@
+{
+ 'targets': [
+ {
+ 'target_name': 'googletest',
+ 'type': 'static_library',
+ 'sources': [
+ 'google_test_server.cc',
+ ],
+ 'dependencies': [
+ '<(EXTERNALS):gtest',
+ ],
+ },
+ ],
+}