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
qtestregistry.cpp
Go to the documentation of this file.
1
// Copyright (C) 2022 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
#
include
<
QtTest
/
private
/
qtestregistry_p
.
h
>
5
6
QT_REQUIRE_CONFIG
(
batch_test_support
);
7
8
QT_BEGIN_NAMESPACE
9
10
namespace
QTest
{
11
Q_GLOBAL_STATIC
(
TestRegistry
,
g_registry
);
12
13
TestRegistry
*
TestRegistry
::
instance
()
14
{
15
return
g_registry
;
16
}
17
18
void
TestRegistry
::
registerTest
(
const
QString
&
name
,
TestEntryFunction
entry
)
19
{
20
m_tests
.
emplace
(
name
,
std
::
move
(
entry
));
21
}
22
23
TestRegistry
::
TestEntryFunction
24
TestRegistry
::
getTestEntryFunction
(
const
QString
&
name
)
const
25
{
26
const
auto
it
=
m_tests
.
find
(
name
);
27
return
it
!=
m_tests
.
end
() ?
it
.
value
() :
nullptr
;
28
}
29
30
QStringList
TestRegistry
::
getAllTestNames
()
const
31
{
32
return
m_tests
.
keys
();
33
}
34
}
35
36
QT_END_NAMESPACE
QTest
[15]
Definition
qtestsupport_core.h:14
QTest::Q_GLOBAL_STATIC
Q_GLOBAL_STATIC(TestRegistry, g_registry)
QT_REQUIRE_CONFIG
QT_REQUIRE_CONFIG(batch_test_support)
qtbase
src
testlib
qtestregistry.cpp
Generated on Mon Mar 10 2025 00:45:52 for Qt by
1.13.2