mirror of
https://github.com/rad4day/Waybar.git
synced 2025-07-13 22:52:30 +02:00
test: count copies and moves done by SafeSignal
This commit is contained in:
@ -7,6 +7,11 @@ class GlibTestsFixture : public sigc::trackable {
|
||||
public:
|
||||
GlibTestsFixture() : main_loop_{Glib::MainLoop::create()} {}
|
||||
|
||||
void setTimeout(int timeout) {
|
||||
Glib::signal_timeout().connect_once([]() { throw std::runtime_error("Test timed out"); },
|
||||
timeout);
|
||||
}
|
||||
|
||||
void run(std::function<void()> fn) {
|
||||
Glib::signal_idle().connect_once(fn);
|
||||
main_loop_->run();
|
||||
|
Reference in New Issue
Block a user