Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
6QT_REQUIRE_CONFIG(batch_test_support);
7
9
10namespace QTest {
12
14{
15 return g_registry;
16}
17
19{
20 m_tests.emplace(name, std::move(entry));
21}
22
25{
26 const auto it = m_tests.find(name);
27 return it != m_tests.end() ? it.value() : nullptr;
28}
29
31{
32 return m_tests.keys();
33}
34}
35
iterator find(const Key &key)
Returns an iterator pointing to the item with the key in the hash.
Definition qhash.h:1291
iterator emplace(const Key &key, Args &&... args)
Definition qhash.h:1324
QList< Key > keys() const
Returns a list containing all the keys in the hash, in an arbitrary order.
Definition qhash.h:1086
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
Definition qhash.h:1216
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
int(*)(int argv, char **argc) TestEntryFunction
TestEntryFunction getTestEntryFunction(const QString &name) const
static TestRegistry * instance()
void registerTest(const QString &name, TestEntryFunction data)
QStringList getAllTestNames() const
QSet< QString >::iterator it
Combined button and popup list for selecting options.
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
GLuint name
GLuint entry
#define QT_REQUIRE_CONFIG(feature)