generalized faking queue messages for test control loops and used it
diff --git a/aos/common/controls/control_loop_test.h b/aos/common/controls/control_loop_test.h
new file mode 100644
index 0000000..14be01c
--- /dev/null
+++ b/aos/common/controls/control_loop_test.h
@@ -0,0 +1,34 @@
+#ifndef AOS_COMMON_CONTROLS_CONTROL_LOOP_TEST_H_
+#define AOS_COMMON_CONTROLS_CONTROL_LOOP_TEST_H_
+
+#include "gtest/gtest.h"
+
+#include "aos/common/queue_testutils.h"
+
+namespace aos {
+namespace testing {
+
+// Handles setting up the environment that all control loops need to actually
+// run.
+// This includes sending the queue messages and Clear()ing the queues when
+// appropriate.
+// It also includes dealing with ::aos::time.
+class ControlLoopTest : public ::testing::Test {
+ public:
+ ControlLoopTest();
+
+ virtual ~ControlLoopTest();
+
+ // Simulates everything that happens during 1 time step.
+ void SimulateTimestep(bool enabled);
+
+ private:
+ bool sent_robot_state_last_time_ = false;
+
+ ::aos::common::testing::GlobalCoreInstance my_core;
+};
+
+} // namespace testing
+} // namespace aos
+
+#endif // AOS_COMMON_CONTROLS_CONTROL_LOOP_TEST_H_