/* * Copyright (c) 2018-2020, Andreas Kling * Copyright (c) 2019-2020, Shannon Booth * Copyright (c) 2021, Brian Gianforaro * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include namespace Test { class Crash { public: enum class RunType { UsingChildProcess, UsingCurrentProcess, }; enum class Failure { DidNotCrash, UnexpectedError, }; static constexpr int ANY_SIGNAL = -1; Crash(String test_type, Function crash_function, int crash_signal = ANY_SIGNAL); bool run(RunType run_type = RunType::UsingChildProcess); private: using Report = Variant; bool do_report(Report report); String m_type; Function m_crash_function; int m_crash_signal; }; }