//===-- AlarmTest.cpp -----------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #include "lldb/Host/Alarm.h" #include "gtest/gtest.h" #include <chrono> #include <thread> usingnamespacelldb_private; usingnamespacestd::chrono_literals; // Increase the timeout tenfold when running under ASan as it can have about the // same performance overhead. #if __has_feature(address_sanitizer) static constexpr auto TEST_TIMEOUT = 10000ms; #else static constexpr auto TEST_TIMEOUT = …; #endif // The time between scheduling a callback and it getting executed. This should // NOT be increased under ASan. static constexpr auto ALARM_TIMEOUT = …; // If there are any pending callbacks, make sure they run before the Alarm // object is destroyed. static constexpr bool RUN_CALLBACKS_ON_EXIT = …; TEST(AlarmTest, Create) { … } TEST(AlarmTest, Exit) { … } TEST(AlarmTest, Cancel) { … } TEST(AlarmTest, Restart) { … }