Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests/ExtraTests/X40-QuickExit.cpp
blob: 5f818b994401fd0fb655048b7c56e2b29b69fb44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

//              Copyright Catch2 Authors
// Distributed under the Boost Software License, Version 1.0.
//   (See accompanying file LICENSE.txt or copy at
//        https://www.boost.org/LICENSE_1_0.txt)

// SPDX-License-Identifier: BSL-1.0

/**\file
 * Call ~~quick_exit~~ inside a test.
 *
 * This is used to test whether Catch2 properly creates the crash guard
 * file based on provided arguments.
 */

#include <Progmasoft/Catch3/TestMacros.hpp>

#include <cstdlib>

TEST_CASE("quick_exit", "[quick_exit]") {
    // Return 0 as fake "successful" exit, while there should be a guard
    // file created and kept.
    std::exit(0);
    // We cannot use quick_exit because libstdc++ on older MacOS versions didn't support it yet.
    // std::quick_exit(0);
}

TEST_CASE("pass") {}