Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtestcrashhandler_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the Qt API. It exists purely as an
9// implementation detail. This header file may change from version to
10// version without notice, or even be removed.
11//
12// We mean it.
13//
14
15#ifndef QTESTCRASHHANDLER_H
16#define QTESTCRASHHANDLER_H
17
18#include <QtCore/qnamespace.h>
19#include <QtTest/qttestglobal.h>
20
21#include <QtCore/private/qtools_p.h>
22
23#ifdef Q_OS_UNIX
24#include <sys/mman.h> // for MAP_FAILED
25#endif
26
27QT_BEGIN_NAMESPACE
28namespace QTest {
29namespace CrashHandler {
34#ifdef Q_OS_WIN
35 Cdb,
36#endif
37 };
38
39 bool alreadyDebugging();
40 void blockUnixSignals();
41
42#if !defined(Q_OS_WASM) || QT_CONFIG(thread)
43 void printTestRunTime();
45#endif
46
49
50#if defined(Q_OS_WIN)
52 {
53 public:
55 };
57#elif defined(Q_OS_UNIX) && !defined(Q_OS_WASM)
59 {
60 public:
63
64 private:
66
68 void freeAlternateStack();
70 };
71#else // Q_OS_WASM or weird systems
72class Q_TESTLIB_EXPORT FatalSignalHandler {};
73inline void blockUnixSignals() {}
74#endif // Q_OS_* choice
75} // namespace CrashHandler
76} // namespace QTest
77QT_END_NAMESPACE
78
79#endif // QTESTCRASHHANDLER_H