5#include <QtTest/qtestcase.h>
6#include <QtTest/private/qtestcase_p.h>
7#include <QtTest/qtestassert.h>
9#include <QtCore/qbytearray.h>
10#include <QtCore/qcoreapplication.h>
11#include <QtCore/qdebug.h>
12#include <QtCore/qdir.h>
13#include <QtCore/qdirlisting.h>
14#include <QtCore/qfile.h>
15#include <QtCore/qfileinfo.h>
16#include <QtCore/qfloat16.h>
17#include <QtCore/qlibraryinfo.h>
18#include <QtCore/qlist.h>
19#include <QtCore/qmetaobject.h>
20#include <QtCore/qobject.h>
21#include <QtCore/qstringlist.h>
22#include <QtCore/qtemporarydir.h>
23#include <QtCore/qthread.h>
24#include <QtCore/qvarlengtharray.h>
25#include <QtCore/private/qlocking_p.h>
26#include <QtCore/private/qtools_p.h>
27#include <QtCore/private/qwaitcondition_p.h>
29#include <QtCore/qtestsupport_core.h>
31#include <QtTest/private/qtestlog_p.h>
32#include <QtTest/private/qtesttable_p.h>
33#include <QtTest/qtestdata.h>
34#include <QtTest/private/qtestresult_p.h>
35#include <QtTest/private/qsignaldumper_p.h>
36#include <QtTest/private/qbenchmark_p.h>
37#if QT_CONFIG(batch_test_support)
38#include <QtTest/private/qtestregistry_p.h>
40#include <QtTest/private/cycle_p.h>
41#include <QtTest/private/qtestblacklist_p.h>
42#include <QtTest/private/qtestcrashhandler_p.h>
43#if defined(HAVE_XCTEST)
44#include <QtTest/private/qxctestlogger_p.h>
47#include <QtTest/private/qtestutil_macos_p.h>
50#if defined(Q_OS_DARWIN)
51#include <QtTest/private/qappletestlogger_p.h>
56#if !defined(Q_OS_INTEGRITY) || __GHS_VERSION_NUMBER > 202014
60# undef __cpp_lib_to_chars
74#if defined(Q_OS_LINUX)
81# if !defined(Q_CC_MINGW) || (defined(Q_CC_MINGW) && defined(__MINGW64_VERSION_MAJOR))
87#include <QtCore/private/qcore_unix_p.h>
90#if __has_include(<paths.h>)
99# if !defined(Q_OS_INTEGRITY)
100# include <sys/resource.h>
102# ifndef _PATH_DEFPATH
103# define _PATH_DEFPATH "/usr/bin:/bin"
109# define SA_RESETHAND 0
113#if defined(Q_OS_MACOS)
114#include <IOKit/pwr_mgt/IOPMLib.h>
115#include <mach/task.h>
116#include <mach/mach_init.h>
117#include <CoreFoundation/CFPreferences.h>
120#if defined(Q_OS_WASM)
121#include <emscripten.h>
135#if defined(__COVERAGESCANNER__) && !QT_CONFIG(testlib_selfcover)
140 qputenv(
"QT_TESTCOCOON_ACTIVE",
"1");
143 __coveragescanner_install(appname);
144 __coveragescanner_testname(testname);
145 __coveragescanner_clear();
160 return !(
name.isEmpty() ||
name.endsWith(
"_data")
161 ||
name ==
"initTestCase" ||
name ==
"cleanupTestCase"
162 ||
name ==
"init" ||
name ==
"cleanup");
172class TestFailedException :
public std::exception
175 TestFailedException() =
default;
176 ~TestFailedException()
override =
default;
178 const char *what()
const noexcept override {
return "QtTest: test failed"; }
181class TestSkippedException :
public std::exception
184 TestSkippedException() =
default;
185 ~TestSkippedException()
override =
default;
187 const char *what() const noexcept
override {
return "QtTest: test was skipped"; }
359 return "QTestLib: This test case check (\"%1\") failed because the requested timeout (%2 ms) "
360 "was too short, %3 ms would have been sufficient this time."_L1
373#if defined(Q_OS_MACOS)
374static IOPMAssertionID macPowerSavingDisabled = 0;
391 void invokeTestOnData(
int index)
const;
403 : m_initTestCaseMethod(
TestMethods::findMethod(
o,
"initTestCase()"))
404 , m_initTestCaseDataMethod(
TestMethods::findMethod(
o,
"initTestCase_data()"))
405 , m_cleanupTestCaseMethod(
TestMethods::findMethod(
o,
"cleanupTestCase()"))
407 , m_cleanupMethod(
TestMethods::findMethod(
o,
"cleanup()"))
408 , m_methods(
std::move(
m))
410 if (m_methods.empty()) {
413 m_methods.reserve(
count);
417 m_methods.push_back(me);
425 const int funcIndex =
metaObject->indexOfMethod(signature);
448 try {
ok =
m.invoke(
obj, Qt ::DirectConnection); }
449 catch (
const TestFailedException &) {}
450 catch (
const TestSkippedException &) {}
499static std::chrono::milliseconds defaultTimeout()
508 return std::chrono::milliseconds{
timeout};
522 bool matched =
false;
526 const QByteArray signature = sl.methodSignature();
550 for (
int i = 0;
i < currTestMetaObj->methodCount(); ++
i) {
559 slot[strlen(slot) - 2] =
'\0';
564 const int dataCount =
table.dataCount();
565 localTags.reserve(dataCount);
566 for (
int j = 0;
j < dataCount; ++
j)
571 if (localTags.size() == 0) {
573 fprintf(
stream,
"%s %s\n", currTestMetaObj->className(), slot);
576 for (
int k = 0; k < localTags.size(); ++k)
579 currTestMetaObj->className(), slot, localTags.at(k).toLatin1().data());
583 if (localTags.size() == 0) {
586 stream,
"%s %s __global__ %s\n",
591 for (
int k = 0; k < localTags.size(); ++k)
593 stream,
"%s %s %s __global__ %s\n", currTestMetaObj->className(), slot,
607 int l =
static_cast<int>(strtol(
str, &pEnd, 10));
609 fprintf(stderr,
"Invalid numeric parameter: '%s'\n",
str);
618 const char *logFilename =
nullptr;
631#if defined(Q_OS_DARWIN) && defined(HAVE_XCTEST)
633 logFormat = QTestLog::XCTest;
636 const char *testOptions =
637 " New-style logging options:\n"
638 " -o filename,format : Output results to file in the specified format\n"
639 " Use - to output to stdout\n"
640 " Valid formats are:\n"
641 " txt : Plain text\n"
642 " csv : CSV format (suitable for benchmarks)\n"
643 " junitxml : XML JUnit document\n"
644 " xml : XML document\n"
645 " lightxml : A stream of XML tags\n"
646 " teamcity : TeamCity format\n"
647 " tap : Test Anything Protocol\n"
649 " *** Multiple loggers can be specified, but at most one can log to stdout.\n"
651 " Old-style logging options:\n"
652 " -o filename : Write the output into file\n"
653 " -txt : Output results in Plain Text\n"
654 " -csv : Output results in a CSV format (suitable for benchmarks)\n"
655 " -junitxml : Output results as XML JUnit document\n"
656 " -xml : Output results as XML document\n"
657 " -lightxml : Output results as stream of XML tags\n"
658 " -teamcity : Output results in TeamCity format\n"
659 " -tap : Output results in Test Anything Protocol format\n"
661 " *** If no output file is specified, stdout is assumed.\n"
662 " *** If no output format is specified, -txt is assumed.\n"
664 " Test log detail options:\n"
665 " -silent : Log failures and fatal errors only\n"
666 " -v1 : Log the start of each testfunction\n"
667 " -v2 : Log each QVERIFY/QCOMPARE/QTEST (implies -v1)\n"
668 " -vs : Log every signal emission and resulting slot invocations\n"
670 " *** The -silent and -v1 options only affect plain text output.\n"
672 " Testing options:\n"
673 " -functions : Returns a list of current testfunctions\n"
674 " -datatags : Returns a list of current data tags.\n"
675 " A global data tag is preceded by ' __global__ '.\n"
676 " -eventdelay ms : Set default delay for mouse and keyboard simulation to ms milliseconds\n"
677 " -keydelay ms : Set default delay for keyboard simulation to ms milliseconds\n"
678 " -mousedelay ms : Set default delay for mouse simulation to ms milliseconds\n"
679 " -maxwarnings n : Sets the maximum amount of messages to output.\n"
680 " 0 means unlimited, default: 2000\n"
681 " -nocrashhandler : Disables the crash handler. Useful for debugging crashes.\n"
682 " -repeat n : Run the testsuite n times or until the test fails.\n"
683 " Useful for finding flaky tests. If negative, the tests are\n"
684 " repeated forever. This is intended as a developer tool, and\n"
685 " is only supported with the plain text logger.\n"
686 " -skipblacklisted : Skip blacklisted tests. Useful for measuring test coverage.\n"
687 " -[no]throwonfail : Enables/disables throwing on QCOMPARE()/QVERIFY()/etc.\n"
688 " Default: off, unless QTEST_THROW_ON_FAIL is set."
689 " -[no]throwonskip : Enables/disables throwing on QSKIP().\n"
690 " Default: off, unless QTEST_THROW_ON_SKIP is set."
692 " Benchmarking options:\n"
693#if QT_CONFIG(valgrind)
694 " -callgrind : Use callgrind to time benchmarks\n"
696#ifdef QTESTLIB_USE_PERF_EVENTS
697 " -perf : Use Linux perf events to time benchmarks\n"
698 " -perfcounter name : Use the counter named 'name'\n"
699 " -perfcounterlist : Lists the counters available\n"
701#ifdef HAVE_TICK_COUNTER
702 " -tickcounter : Use CPU tick counters to time benchmarks\n"
704 " -eventcounter : Counts events received during benchmarks\n"
705 " -minimumvalue n : Sets the minimum acceptable measurement value\n"
706 " -minimumtotal n : Sets the minimum acceptable total for repeated executions of a test function\n"
707 " -iterations n : Sets the number of accumulation iterations.\n"
708 " -median n : Sets the number of median iterations.\n"
709 " -vb : Print out verbose benchmarking information.\n";
711 for (
int i = 1;
i < argc; ++
i) {
712 if (strcmp(argv[
i],
"-help") == 0 || strcmp(argv[
i],
"--help") == 0
713 || strcmp(argv[
i],
"/?") == 0) {
714 printf(
" Usage: %s [options] [testfunction[:testdata]]...\n"
715 " By default, all testfunctions will be run.\n\n"
716 "%s", argv[0], testOptions);
720 " QmlTest options:\n"
721 " -import dir : Specify an import directory.\n"
722 " -plugins dir : Specify a directory where to search for plugins.\n"
723 " -input dir/file : Specify the root directory for test cases or a single test case file.\n"
724 " -translation file : Specify the translation file.\n"
725 " -file-selector dir : Specify a file selector for the QML engine.\n"
730 " -help : This help\n");
732 }
else if (strcmp(argv[
i],
"-functions") == 0) {
739 }
else if (strcmp(argv[
i],
"-datatags") == 0) {
744 }
else if (strcmp(argv[
i],
"-txt") == 0) {
746 }
else if (strcmp(argv[
i],
"-csv") == 0) {
748 }
else if (strcmp(argv[
i],
"-junitxml") == 0) {
750 }
else if (strcmp(argv[
i],
"-xunitxml") == 0) {
751 fprintf(stderr,
"WARNING: xunitxml is deprecated. Please use junitxml.\n");
753 }
else if (strcmp(argv[
i],
"-xml") == 0) {
755 }
else if (strcmp(argv[
i],
"-lightxml") == 0) {
757 }
else if (strcmp(argv[
i],
"-teamcity") == 0) {
759 }
else if (strcmp(argv[
i],
"-tap") == 0) {
761 }
else if (strcmp(argv[
i],
"-silent") == 0) {
763 }
else if (strcmp(argv[
i],
"-v1") == 0) {
765 }
else if (strcmp(argv[
i],
"-v2") == 0) {
767 }
else if (strcmp(argv[
i],
"-vs") == 0) {
769 }
else if (strcmp(argv[
i],
"-o") == 0) {
771 fprintf(stderr,
"-o needs an extra parameter specifying the filename and optional format\n");
776 char *filename =
new char[strlen(argv[
i])+1];
777 char *
format =
new char[strlen(argv[
i])+1];
778 if (sscanf(argv[
i],
"%[^,],%s", filename,
format) == 1) {
780 logFilename = argv[
i];
783 if (strcmp(
format,
"txt") == 0)
785 else if (strcmp(
format,
"csv") == 0)
787 else if (strcmp(
format,
"lightxml") == 0)
789 else if (strcmp(
format,
"xml") == 0)
791 else if (strcmp(
format,
"junitxml") == 0)
793 else if (strcmp(
format,
"xunitxml") == 0) {
794 fprintf(stderr,
"WARNING: xunitxml is deprecated. Please use junitxml.\n");
796 }
else if (strcmp(
format,
"teamcity") == 0)
798 else if (strcmp(
format,
"tap") == 0)
801 fprintf(stderr,
"output format must be one of txt, csv, lightxml, xml, tap, teamcity or junitxml\n");
805 fprintf(stderr,
"only one logger can log to stdout\n");
812 }
else if (strcmp(argv[
i],
"-eventdelay") == 0) {
814 fprintf(stderr,
"-eventdelay needs an extra parameter to indicate the delay(ms)\n");
819 }
else if (strcmp(argv[
i],
"-keydelay") == 0) {
821 fprintf(stderr,
"-keydelay needs an extra parameter to indicate the delay(ms)\n");
826 }
else if (strcmp(argv[
i],
"-mousedelay") == 0) {
828 fprintf(stderr,
"-mousedelay needs an extra parameter to indicate the delay(ms)\n");
833 }
else if (strcmp(argv[
i],
"-maxwarnings") == 0) {
835 fprintf(stderr,
"-maxwarnings needs an extra parameter with the amount of warnings\n");
840 }
else if (strcmp(argv[
i],
"-repeat") == 0) {
842 fprintf(stderr,
"-repeat needs an extra parameter for the number of repetitions\n");
848 }
else if (strcmp(argv[
i],
"-nocrashhandler") == 0) {
850 }
else if (strcmp(argv[
i],
"-skipblacklisted") == 0) {
852 }
else if (strcmp(argv[
i],
"-throwonfail") == 0) {
854 }
else if (strcmp(argv[
i],
"-nothrowonfail") == 0) {
856 }
else if (strcmp(argv[
i],
"-throwonskip") == 0) {
858 }
else if (strcmp(argv[
i],
"-nothrowonskip") == 0) {
860#if QT_CONFIG(valgrind)
861 }
else if (strcmp(argv[
i],
"-callgrind") == 0) {
864 "WARNING: Valgrind not found or too old. "
865 "Make sure it is installed and in your path. "
866 "Using the walltime measurer.\n");
872 "WARNING: Current directory not writable. "
873 "Using the walltime measurer.\n");
875 }
else if (strcmp(argv[
i],
"-callgrindchild") == 0) {
880#ifdef QTESTLIB_USE_PERF_EVENTS
881 }
else if (strcmp(argv[
i],
"-perf") == 0) {
886 fprintf(stderr,
"WARNING: Linux perf events not available. Using the walltime measurer.\n");
888 }
else if (strcmp(argv[
i],
"-perfcounter") == 0) {
890 fprintf(stderr,
"-perfcounter needs an extra parameter with the name of the counter\n");
895 }
else if (strcmp(argv[
i],
"-perfcounterlist") == 0) {
899#ifdef HAVE_TICK_COUNTER
900 }
else if (strcmp(argv[
i],
"-tickcounter") == 0) {
903 }
else if (strcmp(argv[
i],
"-eventcounter") == 0) {
905 }
else if (strcmp(argv[
i],
"-minimumvalue") == 0) {
907 fprintf(stderr,
"-minimumvalue needs an extra parameter to indicate the minimum time(ms)\n");
912 }
else if (strcmp(argv[
i],
"-minimumtotal") == 0) {
914 fprintf(stderr,
"-minimumtotal needs an extra parameter to indicate the minimum total measurement\n");
919 }
else if (strcmp(argv[
i],
"-iterations") == 0) {
921 fprintf(stderr,
"-iterations needs an extra parameter to indicate the number of iterations\n");
926 }
else if (strcmp(argv[
i],
"-median") == 0) {
928 fprintf(stderr,
"-median needs an extra parameter to indicate the number of median iterations\n");
934 }
else if (strcmp(argv[
i],
"-vb") == 0) {
936#if defined(Q_OS_DARWIN)
937 }
else if (strncmp(argv[
i],
"-Apple", 6) == 0) {
940# if defined(HAVE_XCTEST)
946 }
else if (argv[
i][0] ==
'-') {
947 fprintf(stderr,
"Unknown option: '%s'\n\n%s", argv[
i], testOptions);
949 fprintf(stderr,
"\nqmltest related options:\n"
950 " -import : Specify an import directory.\n"
951 " -plugins : Specify a directory where to search for plugins.\n"
952 " -input : Specify the root directory for test cases.\n"
957 " -help : This help\n");
966 if (argv[
i][
offset + 1] ==
':') {
993 const bool explicitLoggerRequested = logFormat != -1;
997 bool addFallbackLogger = !explicitLoggerRequested;
999#if defined(QT_USE_APPLE_UNIFIED_LOGGING)
1002 if (safeToAddAppleLogger && QAppleTestLogger::debugLoggingEnabled()) {
1005 addFallbackLogger =
false;
1009 if (addFallbackLogger)
1013 fprintf(stderr,
"-repeat is only supported with plain text logger\n");
1023static QList<QBenchmarkResult>
qMedian(
const QList<QList<QBenchmarkResult>> &container)
1025 const int count = container.size();
1030 return container.front();
1032 QList<QList<QBenchmarkResult>> containerCopy = container;
1033 std::sort(containerCopy.begin(), containerCopy.end(),
1034 [](
const QList<QBenchmarkResult> &
a,
const QList<QBenchmarkResult> &
b) {
1035 return a.first() < b.first();
1038 const int middle =
count / 2;
1041 return containerCopy.at(middle);
1056void TestMethods::invokeTestOnData(
int index)
const
1060 bool isBenchmark =
false;
1063 QList<QList<QBenchmarkResult>> resultsList;
1064 bool minimumTotalReached =
false;
1076 const bool initQuit =
1115 }
while (invokeOk && isBenchmark
1129 :
"accumulation stage result: %1"_L1;
1137 minimumTotalReached =
true;
1139 auto addResult = [](
qreal current,
const QList<QBenchmarkResult> &
r) {
1141 current +=
r.first().measurement.value;
1144 const qreal total = std::accumulate(resultsList.begin(), resultsList.end(), 0.0, addResult);
1147 }
while (isBenchmark
1148 && ((++i < QBenchmarkGlobalData::current->adjustMedianIterationCount()) || !minimumTotalReached)
1161#if QT_CONFIG(thread)
1163class WatchDog :
public QThread
1165 enum Expectation : std::size_t {
1174 static constexpr auto ExpectationMask = Expectation{ThreadStart | TestFunctionStart | TestFunctionEnd | ThreadEnd};
1175 static_assert(size_t(ExpectationMask) == 0x3);
1176 static constexpr size_t GenerationShift = 2;
1178 static constexpr Expectation
state(Expectation e)
noexcept
1179 {
return Expectation{e & ExpectationMask}; }
1180 static constexpr size_t generation(Expectation e)
noexcept
1181 {
return e >> GenerationShift; }
1182 static constexpr Expectation combine(Expectation e,
size_t gen)
noexcept
1183 {
return Expectation{e | (gen << GenerationShift)}; }
1185 bool waitFor(std::unique_lock<std::mutex> &
m, Expectation e)
1187 auto expectationChanged = [
this, e] {
return expecting.load(std::memory_order_relaxed) != e; };
1189 case TestFunctionEnd:
1190 return waitCondition.wait_for(
m, defaultTimeout(), expectationChanged);
1193 case TestFunctionStart:
1194 waitCondition.wait(
m, expectationChanged);
1197 Q_UNREACHABLE_RETURN(
false);
1200 void setExpectation(Expectation e)
1204 auto cur = expecting.load(std::memory_order_relaxed);
1205 auto gen = generation(cur);
1206 if (e == TestFunctionStart)
1208 e = combine(e, gen);
1209 expecting.store(e, std::memory_order_relaxed);
1210 waitCondition.notify_all();
1218 expecting.store(ThreadStart, std::memory_order_relaxed);
1220 waitFor(locker, ThreadStart);
1225 setExpectation(ThreadEnd);
1231 setExpectation(TestFunctionEnd);
1236 setExpectation(TestFunctionStart);
1243 expecting.store(TestFunctionStart, std::memory_order_release);
1244 waitCondition.notify_all();
1246 Expectation e = expecting.load(std::memory_order_acquire);
1252 case TestFunctionStart:
1253 case TestFunctionEnd:
1258 qFatal(
"Test function timed out");
1266 std::condition_variable waitCondition;
1267 std::atomic<Expectation> expecting;
1285 fprintf(stderr,
"Unknown testdata for function %s(): '%s'\n",
name.constData(),
tag.data());
1286 const int localDataCount = lTable.dataCount();
1287 if (localDataCount) {
1288 fputs(
"Available test-specific data tags:\n", stderr);
1289 for (
int i = 0;
i < localDataCount; ++
i)
1290 fprintf(stderr,
"\t%s\n", lTable.testData(
i)->dataTag());
1292 const int globalDataCount = gTable.
dataCount();
1293 if (globalDataCount) {
1294 fputs(
"Available global data tags:\n", stderr);
1295 for (
int i = 0;
i < globalDataCount; ++
i)
1298 if (localDataCount == 0 && globalDataCount == 0)
1299 fputs(
"Function has no data tags\n", stderr);
1325 const int globalDataCount = gTable->
dataCount();
1326 int curGlobalDataIndex = 0;
1327 const auto globalDataTag = [gTable, globalDataCount](
int index) {
1338 return tag.startsWith(
global) &&
tag.endsWith(local) &&
1339 tag.size() ==
global.size() + 1 + local.size() &&
1342 bool foundFunction =
false;
1343 bool blacklisted =
false;
1350 if (curGlobalDataIndex == 0) {
1357 int curDataIndex = 0;
1358 const int dataCount =
table.dataCount();
1359 const auto dataTag = [&
table, dataCount](
int index) {
1360 return dataCount ?
table.testData(
index)->dataTag() :
nullptr;
1369 foundFunction =
true;
1371 globalDataTag(curGlobalDataIndex));
1376 QTest::qSkip(
"Skipping blacklisted test since -skipblacklisted option is set.",
1382 curDataIndex >= dataCount ?
nullptr :
table.testData(curDataIndex));
1388 invokeTestOnData(
index);
1393 if (!
tag.isEmpty() && !globalDataCount)
1397 }
while (curDataIndex < dataCount);
1400 ++curGlobalDataIndex;
1401 }
while (curGlobalDataIndex < globalDataCount);
1403 if (!
tag.isEmpty() && !foundFunction) {
1417 QTEST_ASSERT_X(
data,
"QTest::fetchData()",
"Test data requested, but no testdata available.");
1420 int idx =
data->parent()->indexOf(tagName);
1423 qFatal(
"QFETCH: Requested testdata '%s' not available, check your _data function.",
1428 qFatal(
"Requested type '%s' does not match available type '%s'.",
1433 return data->data(idx);
1439char *
formatString(
const char *prefix,
const char *suffix,
size_t numArguments, ...)
1442 va_start(ap, numArguments);
1447 if (numArguments > 0) {
1450 for (
size_t i = 1;
i < numArguments; ++
i) {
1492 forElipsis[0] =
' ';
1493 forElipsis[1] =
'.';
1494 forElipsis[2] =
'.';
1495 forElipsis[3] =
'.';
1508 const char at =
ba[
i];
1532 bool trimmed =
false;
1533 auto buffer = std::make_unique<char[]>(256);
1537 bool lastWasHexEscape =
false;
1539 for ( ;
p !=
end; ++
p) {
1553 if (fromHex(*
p) != -1) {
1558 lastWasHexEscape =
false;
1561 if (*p < 0x7f && *p >= 0x20 && *
p !=
'\\' && *
p !=
'"') {
1594 lastWasHexEscape =
true;
1622static char *writePrettyUnicodeChar(
char16_t ch,
char *
const buffer)
1626 if (ch < 0x7f && ch >= 0x20 &&
ch !=
'\\' &&
ch !=
'"') {
1655 *
dst++ = toHexUpper(
ch >> 12);
1656 *
dst++ = toHexUpper(
ch >> 8);
1657 *
dst++ = toHexUpper(
ch >> 4);
1658 *
dst++ = toHexUpper(
ch);
1666 auto p =
string.utf16();
1667 auto length =
string.size();
1669 bool trimmed =
false;
1675 for ( ;
p !=
end; ++
p) {
1680 dst = writePrettyUnicodeChar(*
p,
dst);
1700 std::optional<WatchDog>
watchDog = std::nullopt;
1721 for (
int i = 0,
count =
int(m_methods.size());
i <
count; ++
i) {
1722 const char *
data =
nullptr;
1748#if QT_DEPRECATED_SINCE(6, 8)
1749static const char *functionRefFormatter(
const void *
f)
1752 return (*formatter)();
1757 const char *lhsExpr,
const char *rhsExpr,
1761 functionRefFormatter, functionRefFormatter,
1767 const char *(*lhsFormatter)(
const void*),
1768 const char *(*rhsFormatter)(
const void*),
1769 const char *lhsExpr,
const char *rhsExpr,
1779 qputenv(
"QT_QTESTLIB_RUNNING",
"1");
1830#if defined(Q_OS_WASM)
1832 if (typeof
Module !=
"undefined" && typeof
Module.notifyTestFinished !=
"undefined")
1833 Module.notifyTestFinished($0);
1845 CrashHandler::maybeDisableCoreDump();
1848#if defined(Q_OS_MACOS)
1855 if (
qApp && (
qstrcmp(
qApp->metaObject()->className(),
"QApplication") == 0)) {
1856 IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep,
1857 kIOPMAssertionLevelOn, CFSTR(
"QtTest running tests"),
1858 &macPowerSavingDisabled);
1878#if QT_CONFIG(valgrind)
1890#if QT_CONFIG(valgrind)
1891 int callgrindChildExitCode = 0;
1894#ifndef QT_NO_EXCEPTIONS
1898#if QT_CONFIG(valgrind)
1901 qFatal(
"QtTest: -callgrind option is not available with QTEST_APPLESS_MAIN");
1912 std::optional<CrashHandler::FatalSignalHandler> handler;
1913 CrashHandler::prepareStackTrace();
1914 if (!Internal::noCrashHandler)
1917 bool seenBad =
false;
1925 commandLineMethods.push_back(
m);
1927 fprintf(stderr,
"Unknown test function: '%s'.", tfB.constData());
1928 if (!
qPrintTestSlots(stderr, tfB.constData(),
" Possible matches:\n"))
1929 fputc(
'\n', stderr);
1940 fprintf(stderr,
"\n%s -functions\nlists all available test functions.\n\n",
1942 if (commandLineMethods.empty())
1954#ifndef QT_NO_EXCEPTIONS
1970#if QT_CONFIG(valgrind)
1972 return callgrindChildExitCode;
1985#if QT_CONFIG(valgrind)
1993#if defined(Q_OS_MACOS)
1994 IOPMAssertionRelease(macPowerSavingDisabled);
1998#if QT_CONFIG(batch_test_support) || defined(Q_QDOC)
2009void QTest::qRegisterTestCase(
const QString &
name, TestEntryFunction entryFunction)
2014QList<QString> QTest::qGetTestCaseNames()
2019QTest::TestEntryFunction QTest::qGetTestCaseEntryFunction(
const QString&
name)
2036 QVarLengthArray<char *> argv(argc);
2038 QList<QByteArray>
args;
2041 for (
int i = 0;
i < argc; ++
i)
2059bool QTest::qVerify(
bool statement,
const char *statementStr,
const char *description,
2102 const auto exType = what ?
"std::" :
"unknown ";
2103 const auto ofType =
expected ?
" of type " :
"";
2104 const auto no =
expected ?
"an" :
"no";
2105 const auto withMsg = what ?
" with message " :
"";
2106 const auto protect = [](
const char *
s) {
return s ?
s :
""; };
2109 "but caught %sexception%s%s",
2111 exType, withMsg, protect(what));
2139 std::rethrow_exception(std::current_exception());
2140 }
catch (
const std::exception &e) {
2150#if QT_DEPRECATED_SINCE(6, 3)
2182#if QT_CONFIG(regularexpression)
2230#if QT_CONFIG(regularexpression)
2293static inline bool isWindowsBuildDirectory(
const QString &dirName)
2300#if QT_CONFIG(temporaryfile)
2311QSharedPointer<QTemporaryDir> QTest::qExtractTestData(
const QString &dirName)
2313 QSharedPointer<QTemporaryDir>
result;
2317 tempDir->setAutoRemove(
true);
2319 if (!tempDir->isValid())
2322 const QString dataPath = tempDir->path();
2323 const QString resourcePath = u
':' + dirName;
2326 if (!fileInfo.isDir()) {
2331 bool isResourceDirEmpty =
true;
2333 isResourceDirEmpty =
false;
2334 if (!dirEntry.isDir()) {
2335 const QString &filePath = dirEntry.filePath();
2356 if (isResourceDirEmpty) {
2361 result = std::move(tempDir);
2371 const char *sourcedir)
2380 if (binDirectory.exists(
base)) {
2381 found = binDirectory.absoluteFilePath(
base);
2386 else if (isWindowsBuildDirectory(binDirectory.dirName())
2387 && binDirectory.cdUp() && binDirectory.exists(
base)) {
2388 found = binDirectory.absoluteFilePath(
base);
2394 "checking next location"_L1.arg(
base, candidate)),
2400 if (found.isEmpty()) {
2402 if (testObjectName) {
2404 const QString candidate =
"%1/%2/%3"_L1
2410 "checking next location"_L1
2424 if (!srcdir.isAbsolute() && builddir)
2433 "testdata %1 not found relative to source path [%2]"_L1
2440 if (found.isEmpty()) {
2446 "testdata %1 not found in resources [%2]"_L1
2453 if (found.isEmpty()) {
2459 "testdata %1 not found in current directory [%2]"_L1
2466 if (found.isEmpty()) {
2472 "testdata %1 not found in main source directory [%2]"_L1
2479 if (found.isEmpty() && sourcedir) {
2485 "testdata %1 not found in supplied source directory [%2]"_L1
2492 if (found.isEmpty()) {
2494 "testdata %1 could not be located!"_L1.arg(
base)),
2508 const char *sourcedir)
2536 int idx =
data->parent()->indexOf(tagName);
2540 return data->data(
data->parent()->indexOf(tagName));
2548 QTEST_ASSERT_X(tbl,
"QTest::addColumn()",
"Cannot add testdata outside of a _data slot.");
2550 tbl->addColumn(
id,
name);
2575 QTEST_ASSERT_X(dataTag,
"QTest::newRow()",
"Data tag cannot be null");
2577 QTEST_ASSERT_X(tbl,
"QTest::newRow()",
"Cannot add testdata outside of a _data slot.");
2579 "Must add columns before attempting to add rows.");
2581 return *tbl->newData(dataTag);
2614 QTEST_ASSERT_X(tbl,
"QTest::addRow()",
"Cannot add testdata outside of a _data slot.");
2616 "Must add columns before attempting to add rows.");
2625 buf[
sizeof buf - 1] =
'\0';
2628 return *tbl->newData(
buf);
2741 fi.setFile(mainSourceFile);
2745#if QT_DEPRECATED_SINCE(6, 4)
2765 char *actualVal,
char *expectedVal,
2766 const char *actual,
const char *
expected,
2774#if QT_DEPRECATED_SINCE(6, 8)
2791 const char *actual,
const char *
expected,
2795 QTest::functionRefFormatter,
2796 QTest::functionRefFormatter, actual,
expected,
2813 const void *actualPtr,
const void *expectedPtr,
2814 const char *(*actualFormatter)(
const void *),
2815 const char *(*expectedFormatter)(
const void *),
2816 const char *actual,
const char *
expected,
2820 actualFormatter, expectedFormatter,
2842template <
typename T>
2867 auto formatter = Internal::genericToString<qfloat16>;
2869 "Compared qfloat16s are not the same (fuzzy compare)",
2870 &
t1, &
t2, formatter, formatter,
2881 "Compared floats are not the same (fuzzy compare)",
2892 "Compared doubles are not the same (fuzzy compare)",
2904 "Compared values are not the same",
2908#if QT_POINTER_SIZE == 8
2918 "Compared values are not the same",
2931 "Compared values are not the same",
2943 "Compared values are not the same",
2955 "Compared values are not the same",
2967 "Compared values are not the same",
2994#define TO_STRING_IMPL(TYPE, FORMAT) \
2995template <> Q_TESTLIB_EXPORT char *QTest::toString<TYPE>(const TYPE &t) \
2997 char *msg = new char[128]; \
2998 qsnprintf(msg, 128, #FORMAT, t); \
3008#if defined(Q_OS_WIN)
3031 char *
p = strchr(
text,
'e');
3034 const char *
const end =
p + strlen(
p);
3035 p += (
p[1] ==
'-' ||
p[1] ==
'+') ? 2 : 1;
3036 if (
p[0] !=
'0' ||
end - 2 <=
p)
3039 const char *
n =
p + 1;
3040 while (
end - 2 >
n &&
n[0] ==
'0')
3042 memmove(
p,
n,
end + 1 -
n);
3048#define TO_STRING_FLOAT(TYPE, FORMAT) \
3049template <> Q_TESTLIB_EXPORT char *QTest::toString<TYPE>(const TYPE &t) \
3051 char *msg = new char[128]; \
3052 switch (qFpClassify(t)) { \
3054 qstrncpy(msg, (t < 0 ? "-inf" : "inf"), 128); \
3057 qstrncpy(msg, "nan", 128); \
3060 qsnprintf(msg, 128, #FORMAT, double(t)); \
3061 massageExponent(msg); \
3071template <> Q_TESTLIB_EXPORT
char *QTest::toString<char>(
const char &
t)
3073 unsigned char c =
static_cast<unsigned char>(
t);
3074 char *msg =
new char[16];
3110 if (c < 0x20 || c >= 0x7F)
3123 char *msg =
new char[1];
3127 char *msg =
new char[strlen(
str) + 1];
3135 char *msg =
new char[128];
3147 auto *
o =
const_cast<const QObject*
>(vo);
3149 const char *
className =
o->metaObject()->className();
3150 char *msg =
new char[256];
3187 auto formatter = Internal::genericToString<const char *>;
3189 &
t1, &
t2, formatter, formatter,
std::unique_ptr< QTimer > watchDog
static bool preventsStderrLogging()
static QBenchmarkGlobalData * current
static void listCounters()
static bool isAvailable()
static void setCounter(const char *name)
static QBenchmarkTestMethodData * current
static QString outFileBase(qint64 pid=-1)
static bool rerunThroughCallgrind(const QStringList &origAppArgs, int &exitCode)
static bool haveValgrind()
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
void resize(qsizetype size)
Sets the size of the byte array to size bytes.
static QCoreApplication * instance() noexcept
Returns a pointer to the application's QCoreApplication (or QGuiApplication/QApplication) instance.
static QString applicationDirPath()
Returns the directory that contains the application executable.
static QStringList arguments()
static void sendPostedEvents(QObject *receiver=nullptr, int event_type=0)
Immediately dispatches all events which have been previously queued with QCoreApplication::postEvent(...
The QDirListing class provides an STL-style iterator for directory entries.
bool mkpath(const QString &dirPath) const
Creates the directory path dirPath.
static QString toNativeSeparators(const QString &pathName)
static QString currentPath()
Returns the absolute path of the application's current directory.
void setFile(const QString &file)
bool exists() const
Returns true if the file system entry this QFileInfo refers to exists; otherwise returns false.
bool setPermissions(Permissions permissionSpec) override
Sets the permissions for the file to the permissions specified.
bool copy(const QString &newName)
Copies the file named fileName() to newName.
void setFileName(const QString &name)
Sets the name of the file.
static QString decodeName(const QByteArray &localFileName)
This does the reverse of QFile::encodeName() using localFileName.
QString errorString() const
Returns a human-readable description of the last device error that occurred.
bool contains(QStringView s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
static QString path(LibraryPath p)
qsizetype size() const noexcept
const_pointer constData() const noexcept
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
Q_WEAK_OVERLOAD void setObjectName(const QString &name)
Sets the object's name to name.
\inmodule QtCore \reentrant
static QSharedPointer create(Args &&...arguments)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static void setEnabled(bool)
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString sliced(qsizetype pos) const &
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
qsizetype size() const noexcept
Returns the number of characters in this string.
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
int compare(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString static QString asprintf(const char *format,...) Q_ATTRIBUTE_FORMAT_PRINTF(1
const char * dataTag() const
static int verboseLevel()
static void startLogging()
static void setInstalledTestCoverage(bool installed)
static void setVerboseLevel(int level)
static bool loggerUsingStdout()
static void setMaxWarnings(int max)
static void info(const char *msg, const char *file, int line)
static void setPrintAvailableTagsMode()
static void addBenchmarkResults(const QList< QBenchmarkResult > &result)
static bool isRepeatSupported()
static void stopLogging()
static void failOnWarning()
static void warn(const char *msg, const char *file, int line)
static void addLogger(LogMode mode, const char *filename)
static void ignoreMessage(QtMsgType type, const char *msg)
Disables App Nap by registering a background activity.
static const char * currentTestObjectName()
static void fail(const char *message, const char *file, int line)
static const char * currentAppName()
static void finishedCurrentTestDataCleanup()
This function is called after completing each test function, including test functions that are not da...
static void finishedCurrentTestData()
This function is called after completing each test function, including test functions that are not da...
static bool expectFail(const char *dataIndex, const char *comment, QTest::TestFailMode mode, const char *file, int line)
static bool verify(bool statement, const char *statementStr, const char *extraInfo, const char *file, int line)
static bool currentTestFailed()
static void setSkipCurrentTest(bool value)
static void setCurrentAppName(const char *appName)
static void setCurrentTestFunction(const char *func)
static void setBlacklistCurrentTest(bool b)
static void setCurrentTestObject(const char *name)
static const char * currentDataTag()
static bool compare(bool success, const char *failureMsg, char *val1, char *val2, const char *actual, const char *expected, const char *file, int line)
static void addFailure(const char *message, const char *file=nullptr, int line=0)
static bool skipCurrentTest()
static void setCurrentGlobalTestData(QTestData *data)
static void finishedCurrentTestFunction()
This function is called after completing each test function, including test functions that are data-d...
static void setCurrentTestData(QTestData *data)
static bool reportResult(bool success, const void *lhs, const void *rhs, const char *(*lhsFormatter)(const void *), const char *(*rhsFormatter)(const void *), const char *lhsExpr, const char *rhsExpr, QTest::ComparisonOperation op, const char *file, int line, const char *failureMessage=nullptr)
static void addSkip(const char *message, const char *file, int line)
static QTestData * currentGlobalTestData()
static QTestData * currentTestData()
static const char * currentTestFunction()
static QTestTable * currentTestTable()
QTestData * testData(int index) const
static void clearGlobalTestTable()
static QTestTable * globalTestTable()
static QMetaMethod findMethod(const QObject *obj, const char *signature)
TestMethods(const QObject *o, MetaMethods m={})
void invokeTests(QObject *testObject) const
std::vector< QMetaMethod > MetaMethods
static TestRegistry * instance()
const void * constData() const
static int parseCommandLineArgument(const char *argument)
static bool canLogTestProgress()
\keyword 16-bit Floating Point Support\inmodule QtCore \inheaderfile QFloat16
QList< QVariant > arguments
Combined button and popup list for selecting options.
Lock qt_scoped_lock(Mutex &mutex)
Lock qt_unique_lock(Mutex &mutex)
Q_TESTLIB_EXPORT Qt::MouseButtons qtestMouseButtons
bool checkBlackLists(const char *slot, const char *data, const char *global)
void disableWindowRestore()
void generateStackTrace()
Q_TESTLIB_EXPORT void maybeThrowOnFail()
Q_TESTLIB_EXPORT QString formatTryTimeoutDebugMessage(q_no_char8_t::QUtf8StringView expr, int timeout, int actual)
Q_TESTLIB_EXPORT void throwOnFail()
Q_TESTLIB_EXPORT void maybeThrowOnSkip()
Q_TESTLIB_EXPORT void throwOnSkip()
Q_TESTLIB_EXPORT int lastMouseTimestamp
constexpr qsizetype PrettyUnicodeMaxIncrement
Q_TESTLIB_EXPORT int qRun()
Q_TESTLIB_EXPORT bool currentTestResolved()
static bool skipBlacklisted
Q_TESTLIB_EXPORT bool reportResult(bool success, const void *lhs, const void *rhs, const char *(*lhsFormatter)(const void *), const char *(*rhsFormatter)(const void *), const char *lhsExpr, const char *rhsExpr, ComparisonOperation op, const char *file, int line)
constexpr qsizetype PrettyUnicodeMaxOutputSize
Q_TESTLIB_EXPORT QTestData & newRow(const char *dataTag)
Appends a new row to the current test data.
static void invokeTestMethodIfExists(const char *methodName, QObject *obj=QTest::currentTestObject)
Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, const char *const argv[], bool qml)
Q_TESTLIB_EXPORT bool qVerify(bool statement, const char *statementStr, const char *description, const char *file, int line)
void * fetchData(QTestData *data, const char *tagName, int typeId)
static QList< QBenchmarkResult > qMedian(const QList< QList< QBenchmarkResult > > &container)
Q_TESTLIB_EXPORT const char * currentTestFunction()
Returns the name of the test function that is currently executed.
Q_TESTLIB_EXPORT QObject * testObject()
int Q_TESTLIB_EXPORT defaultMouseDelay()
Q_TESTLIB_EXPORT bool runningTest()
static Q_CONSTINIT QBasicMutex mutex
Q_TESTLIB_EXPORT void setMainSourcePath(const char *file, const char *builddir=nullptr)
static void qPrintDataTags(FILE *stream)
Q_TESTLIB_EXPORT void * qElementData(const char *elementName, int metaTypeId)
int Q_TESTLIB_EXPORT defaultKeyDelay()
void setThrowOnFail(bool enable) noexcept
Q_TESTLIB_EXPORT bool qExpectFail(const char *dataIndex, const char *comment, TestFailMode mode, const char *file, int line)
char * toString(const MyPoint &point)
Q_TESTLIB_EXPORT QStringList testFunctions
static bool invokeTestMethodIfValid(QMetaMethod m, QObject *obj=QTest::currentTestObject)
static bool qPrintTestSlots(FILE *stream, const char *filter=nullptr, const char *preamble="")
Q_TESTLIB_EXPORT void * qData(const char *tagName, int typeId)
Q_TESTLIB_EXPORT bool currentTestFailed()
Returns true if the current test function has failed, otherwise false.
static bool installedTestCoverage
static Q_CONSTINIT QBasicAtomicInt g_throwOnFail
Q_TESTLIB_EXPORT void qInit(QObject *testObject, int argc=0, char **argv=nullptr)
void setThrowOnSkip(bool enable) noexcept
Q_TESTLIB_EXPORT QStringList testTags
static Q_CONSTINIT QBasicAtomicInt g_throwOnSkip
char * formatString(const char *prefix, const char *suffix, size_t numArguments,...)
char * toPrettyCString(const char *p, qsizetype length)
char * toHexRepresentation(const char *ba, qsizetype length)
Returns a pointer to a string that is the string ba represented as a space-separated sequence of hex ...
Q_TESTLIB_EXPORT bool compare_string_helper(const char *t1, const char *t2, const char *actual, const char *expected, const char *file, int line)
static void printUnknownDataTagError(QLatin1StringView name, QLatin1StringView tag, const QTestTable &lTable, const QTestTable &gTable)
Q_TESTLIB_EXPORT char * toPrettyUnicode(QStringView string)
Q_TESTLIB_EXPORT void failOnWarning()
Q_DECL_COLD_FUNCTION Q_TESTLIB_EXPORT void qCaught(const char *expected, const char *what, const char *file, int line)
Q_TESTLIB_EXPORT bool printAvailableFunctions
Q_TESTLIB_EXPORT QString qFindTestData(const char *basepath, const char *file=nullptr, int line=0, const char *builddir=nullptr, const char *sourcedir=nullptr)
Q_TESTLIB_EXPORT void ignoreMessage(QtMsgType type, const char *message)
Ignores messages created by qDebug(), qInfo() or qWarning().
Q_TESTLIB_EXPORT void qSkip(const char *message, const char *file, int line)
bool qCompare(QString const &t1, QLatin1StringView const &t2, const char *actual, const char *expected, const char *file, int line)
static int qToInt(const char *str)
Q_TESTLIB_EXPORT const char * currentDataTag()
Returns the name of the current test data.
Q_TESTLIB_EXPORT int qExec(QObject *testObject, int argc=0, char **argv=nullptr)
Executes tests declared in testObject.
Q_TESTLIB_EXPORT bool compare_helper(bool success, const char *failureMsg, const void *actualPtr, const void *expectedPtr, const char *(*actualFormatter)(const void *), const char *(*expectedFormatter)(const void *), const char *actual, const char *expected, const char *file, int line)
Q_TESTLIB_EXPORT QTestData & addRow(const char *format,...) Q_ATTRIBUTE_FORMAT_PRINTF(1
static bool repeatForever
Q_TESTLIB_EXPORT void qCleanup()
Q_TESTLIB_EXPORT void addColumnInternal(int id, const char *name)
Q_DECL_COLD_FUNCTION Q_TESTLIB_EXPORT void qFail(const char *message, const char *file, int line)
Q_TESTLIB_EXPORT void * qGlobalData(const char *tagName, int typeId)
static QObject * currentTestObject
Q_TESTLIB_EXPORT const char * currentAppName()
Returns the name of the binary that is currently executed.
static bool inTestFunction
static QString mainSourcePath
QTCONCURRENT_RUN_NODISCARD auto run(QThreadPool *pool, Function &&f, Args &&...args)
constexpr char toHexUpper(char32_t value) noexcept
constexpr int fromHex(char32_t c) noexcept
#define Q_BASIC_ATOMIC_INITIALIZER(a)
#define QByteArrayLiteral(str)
size_t qstrlen(const char *str)
int qstrncmp(const char *str1, const char *str2, size_t len)
Q_CORE_EXPORT int qvsnprintf(char *str, size_t n, const char *fmt, va_list ap)
Q_CORE_EXPORT int qsnprintf(char *str, size_t n, const char *fmt,...)
Q_CORE_EXPORT char * qstrdup(const char *)
Q_CORE_EXPORT char * qstrcpy(char *dst, const char *src)
Q_CORE_EXPORT int qstrcmp(const char *str1, const char *str2)
AudioChannelLayoutTag tag
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char return DBusMessage dbus_bool_t return DBusMessage dbus_uint32_t return DBusMessage void
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char * destination
static QString methodName(const QDBusIntrospection::Method &method)
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
bool qFuzzyIsNull(qfloat16 f) noexcept
int qFpClassify(qfloat16 f) noexcept
static void installCoverageTool(QLibraryPrivate *libPrivate)
constexpr const T & qMin(const T &a, const T &b)
static bool matches(const QJsonObject &object, const QString &osName, const QVersionNumber &kernelVersion, const QString &osRelease, const QOpenGLConfig::Gpu &gpu)
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLuint GLenum GLsizei length
GLenum GLenum GLsizei count
GLbitfield GLuint64 timeout
[4]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
[4]
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLuint GLsizei const GLchar * message
GLenum GLuint GLintptr offset
GLint GLsizei GLsizei GLenum format
GLsizei const GLchar *const * path
GLenum GLenum GLsizei void * table
static void qInit(QSqlQuery *q, const QString &query, const QSqlDatabase &db)
static QString canonicalPath(const QString &rootPath)
#define qPrintable(string)
#define qUtf16Printable(string)
#define QT_CONFIG(feature)
bool qputenv(const char *varName, QByteArrayView raw)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
Q_CORE_EXPORT bool qEnvironmentVariableIsEmpty(const char *varName) noexcept
Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) noexcept
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
#define QTEST_ASSERT(cond)
#define QTEST_ASSERT_X(cond, where, what)
static bool floatingCompare(const T &actual, const T &expected)
#define TO_STRING_FLOAT(TYPE, FORMAT)
#define TO_STRING_IMPL(TYPE, FORMAT)
static bool installCoverageTool(const char *appname, const char *testname)
static bool isValidSlot(const QMetaMethod &sl)
static void initEnvironment()
static void massageExponent(char *text)
unsigned long long quint64
const char className[16]
[1]
obj metaObject() -> className()
QTestDataSetter(QTestData *data)