[Lldb-commits] [lldb] [lldb] Add timed callbacks to the MainLoop class (PR #112895)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Tue Nov 26 08:02:19 PST 2024
================
@@ -223,6 +220,61 @@ TEST_F(MainLoopTest, ManyPendingCallbacks) {
ASSERT_TRUE(loop.Run().Success());
}
+TEST_F(MainLoopTest, CallbackWithTimeout) {
+ MainLoop loop;
+ loop.AddCallback([](MainLoopBase &loop) { loop.RequestTermination(); },
+ std::chrono::seconds(2));
+ auto start = std::chrono::steady_clock::now();
+ ASSERT_THAT_ERROR(loop.Run().takeError(), llvm::Succeeded());
+ EXPECT_GE(std::chrono::steady_clock::now() - start, std::chrono::seconds(2));
----------------
DavidSpickett wrote:
Or on Windows the definition of 2 seconds is a little more fuzzy than we'd like it to be :)
https://github.com/llvm/llvm-project/pull/112895
More information about the lldb-commits
mailing list