11#include "llvm/Support/Signals.h"
12#include "gtest/gtest.h"
23TEST(ThreadCrashReporterTest,
All) {
27 auto SignalCurrentThread = []() { infoSignalHandler(); };
29 llvm::sys::SetInfoSignalFunction(&infoSignalHandler);
30 auto SignalCurrentThread = []() { raise(SIGUSR1); };
33 AsyncTaskRunner Runner;
34 auto SignalAnotherThread = [&]() {
35 Runner.runAsync(
"signal another thread", SignalCurrentThread);
41 ThreadCrashReporter ScopedReporter([&Called]() { Called =
true; });
45 SignalCurrentThread();
50 SignalAnotherThread();
56 SignalCurrentThread();
59 std::string Order =
"";
61 ThreadCrashReporter ScopedReporter([&Order] { Order.push_back(
'a'); });
63 ThreadCrashReporter ScopedReporter([&Order] { Order.push_back(
'b'); });
64 SignalCurrentThread();
67 EXPECT_EQ(Order,
"ba");
71 SignalCurrentThread();
72 EXPECT_EQ(Order,
"baa");
static void runCrashHandlers()
Calls all currently-active ThreadCrashReporters for the current thread.
TEST(BackgroundQueueTest, Priority)
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//