21 #include <condition_variable> 23 #include <gtest/gtest.h> 89 void barricade(std::initializer_list<std::string> clear_events);
93 std::condition_variable
cv_;
99 #define BARRIER(...) barricade(__VA_ARGS__) 101 #define ACTION_OPEN_BARRIER(str) ::testing::InvokeWithoutArgs([this](void){this->triggerClearEvent(str); return true;}) 102 #define ACTION_OPEN_BARRIER_VOID(str) ::testing::InvokeWithoutArgs([this](void){this->triggerClearEvent(str);}) 105 #endif // ASYNC_TEST_H void barricade(std::string clear_event)
Will block until the event given by clear_event is triggered. Unblocks immediately, if the event was triggered in advance.
std::condition_variable cv_
void triggerClearEvent(std::string event)
Triggeres a clear event. If a call to barricade is currently pending it will unblock as soon as all c...
std::set< std::string > clear_events_
Test class that allows the handling of asynchronous test objects.
std::set< std::string > waitlist_