Make SimulatedEventLoop log the correct time
Mock time out for LOG statements so the logged time is the simulated
time. This makes it so all the plotting tools will work, and makes it
so it's easier to debug simulations.
Change-Id: I902b6c52dc6008e5812cde9ec6cacdf72f13206e
diff --git a/aos/testing/test_logging.h b/aos/testing/test_logging.h
index a4d835a..e7059d1 100644
--- a/aos/testing/test_logging.h
+++ b/aos/testing/test_logging.h
@@ -1,6 +1,8 @@
#ifndef AOS_TESTING_TEST_LOGGING_H_
#define AOS_TESTING_TEST_LOGGING_H_
+#include "aos/time/time.h"
+
namespace aos {
namespace testing {
@@ -21,6 +23,13 @@
// we want to use graphing tools to verify what's happening.
void ForcePrintLogsDuringTests();
+// Sets the current mock logging time to monotonic_now. This only applies to
+// the current thread.
+void MockTime(::aos::monotonic_clock::time_point monotonic_now);
+// Clears the mock logging time for the current thread and goes back to using
+// monotonic_clock::now().
+void UnMockTime();
+
} // namespace testing
} // namespace aos