Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
blockingtestdialogs.h
Go to the documentation of this file.
1
// Copyright (C) 2026 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4
#
ifndef
BLOCKINGTESTDIALOGS_H
5
#
define
BLOCKINGTESTDIALOGS_H
6
7
#
include
"hdc.h"
8
9
#
include
<
QtCore
/
qjsonobject
.
h
>
10
#
include
<
QtCore
/
qlist
.
h
>
11
#
include
<
QtCore
/
qrect
.
h
>
12
#
include
<
QtCore
/
qregularexpression
.
h
>
13
#
include
<
QtCore
/
qstring
.
h
>
14
15
#
include
<
optional
>
16
17
QT_BEGIN_NAMESPACE
18
19
class
BlockingTestDialogs
20
{
21
public
:
22
BlockingTestDialogs(
const
QString &testConfigPath, Hdc hdc);
23
24
bool
isEmpty()
const
;
25
26
bool
answerVisibleDialog();
27
28
private
:
29
struct
Dialog
30
{
31
QString name;
32
QRegularExpression prompt;
33
QList<QRegularExpression> buttons;
34
QString position;
35
};
36
37
struct
ScreenText
38
{
39
QString text;
40
QRect bounds;
41
};
42
43
void
loadDeclarations(
const
QString &testConfigPath);
44
static
std::optional<Dialog> parseDialog(
const
QJsonObject &declaration);
45
46
QList<ScreenText> dumpScreenTexts()
const
;
47
static
void
collectTexts(
const
QJsonObject &node, QList<ScreenText> &texts);
48
49
static
bool
anyTextMatches(
50
const
QList<ScreenText> &texts,
const
QRegularExpression &pattern);
51
static
std::optional<ScreenText> findButton(
52
const
QList<ScreenText> &texts,
const
QRegularExpression &pattern,
53
const
QString &position);
54
bool
pressButtons(
const
Dialog &dialog,
const
QList<ScreenText> &texts)
const
;
55
void
reportUnmatchedDialog(
const
QList<ScreenText> &texts);
56
57
QList<Dialog> m_dialogs;
58
Hdc m_hdc;
59
QString m_lastReportedUnknownDialog;
60
};
61
62
QT_END_NAMESPACE
63
64
#
endif
// BLOCKINGTESTDIALOGS_H
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
EXIT_NOEXITCODE
static constexpr int EXIT_NOEXITCODE
Definition
main.cpp:44
EXIT_ERROR
static constexpr int EXIT_ERROR
Definition
main.cpp:42
waitForProcessStart
static bool waitForProcessStart(const Hdc &hdc, const QString &bundleName, const QString &shellExitCodePath, int timeoutSecs=30)
Definition
main.cpp:138
waitForProcessDeath
static void waitForProcessDeath(const Hdc &hdc, const QString &bundleName, int timeoutSecs=15)
Definition
main.cpp:122
quietBeforeDialogCheck
static constexpr auto quietBeforeDialogCheck
Definition
main.cpp:51
shellSingleQuote
static QString shellSingleQuote(const QString &value)
Definition
main.cpp:44
EXIT_CRASH
static constexpr int EXIT_CRASH
Definition
main.cpp:41
g_interrupted
static std::atomic< bool > g_interrupted
Definition
main.cpp:106
quietBeforeDialogCheckWhileStarting
static constexpr auto quietBeforeDialogCheckWhileStarting
Definition
main.cpp:52
sigHandler
static void sigHandler(int sig)
Definition
main.cpp:108
dialogsExpectedWhileStarting
static constexpr auto dialogsExpectedWhileStarting
Definition
main.cpp:53
waitForStdoutFile
static bool waitForStdoutFile(const Hdc &hdc, const QString &shellStdoutPath, int timeoutSecs=10)
Definition
main.cpp:159
EXIT_TIMEOUT
static constexpr int EXIT_TIMEOUT
Definition
main.cpp:42
answerBlockingDialogsIfStalled
static void answerBlockingDialogsIfStalled(BlockingTestDialogs &blockingTestDialogs, const QElapsedTimer &elapsed, std::chrono::nanoseconds lastOutputAt)
Definition
main.cpp:175
main
int main(int argc, char *argv[])
[ctor_close]
Definition
src_corelib_animation_qpropertyanimation.cpp:100
qtbase
src
tools
harmonyostestrunner
blockingtestdialogs.h
Generated on
for Qt by
1.18.0