#include "gtest/gtest.h" #include #include #include #include "utils/signals/handler.hpp" #include "utils/stacktrace/stacktrace.hpp" TEST(SignalHandler, SegmentationFaultTest) { SignalHandler::register_handler(Signal::SegmentationFault, []() { std::cout << "Segmentation Fault" << std::endl; Stacktrace stacktrace; std::cout << stacktrace.dump() << std::endl; }); std::raise(SIGSEGV); } int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }