blob: e7b682ca0c272c7bd347de879be3c6d8e3542c30 [file] [log] [blame] [edit]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <lib/backtrace-request/backtrace-request.h>
#include <thread>
#include <zxtest/zxtest.h>
// We can't easily verify the backtrace contents, but this at least checks
// that we properly resume after requesting a backtrace. If we either hang
// or get killed the unittest runner will detect it and report a failure.
TEST(BacktraceRequest, RequestResumesAllThreads) {
std::thread t([]() { backtrace_request_all_threads(); });
t.join();
}
TEST(BacktraceRequest, RequestResumesCurrentThread) {
std::thread t([]() { backtrace_request_current_thread(); });
t.join();
}