blob: f39c6cf8ee31d435d59fc6abb0785440a54ee043 [file] [log] [blame]
#include "aos/testing/test_logging.h"
#include <thread>
#include "gtest/gtest.h"
#include "aos/logging/logging.h"
namespace aos {
namespace testing {
// Tests logging from multiple threads.
// tsan used to complain about this.
TEST(QueueTestutilsTest, MultithreadedLog) {
EnableTestLogging();
::std::thread thread([]() {
for (int i = 0; i < 1000; ++i) {
AOS_LOG(INFO, "test from thread\n");
}
});
for (int i = 0; i < 1000; ++i) {
AOS_LOG(INFO, "not from thread\n");
}
thread.join();
}
} // namespace testing
} // namespace aos