summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* Exclude VxWorks platform from stack trace generationKrzysztof Sommerfeld2023-07-271-2/+2
| | | | | Change-Id: I71c2e542ef144f544610edb9245dcbc38ea7db3f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Change the Qt Testlib example pagesVenugopal Shivashankar2023-07-217-470/+483
| | | | | | | | | | | | | These pages are designed as tutorials, so they can be \page instead of \example. Also, reorganized the tutorials, moving them out of the testlib manual, into several qdoc files. Task-number: QTBUG-115248 Pick-to: 6.5 6.6 Change-Id: I2cbd66ecc1082ecc9d3d1742b621ee009daf1031 Reviewed-by: Kai Köhne <kai.koehne@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Fix warning in recently-added testlib snippetEdward Welbourne2023-07-181-4/+4
| | | | | | | | | | | | Amends commit fa296ee1dcf4c16fb6f242cf08949485e499fec3 to implement MyObject::startup(), mark it void (its return was ignored) and flag its static wrapper as [[maybe_unused]] to calm a compiler warning. As a drive-by, fix indentation of the class definition. Change-Id: I3918bf8a4625a7e2b4e6d4e0cbfa68a337115865 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Testlib: Make QTEST_ASSERT usable in constexpr functionsKai Köhne2023-07-171-3/+2
| | | | | | | | | | | Commit 8ea27bb1c669e21100a6a042b0378b3346bdf671 adapted the definition of Q_ASSERT already. Adopt the same logic for QTEST_ASSERT. Pick-to: 6.5 6.6 Change-Id: I5a5d0f62df79b18635d3b426a439c35b25d739c2 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Enable QT_NO_CONTEXTLESS_CONNECT for most of QtBaseGiuseppe D'Angelo2023-07-111-0/+1
| | | | | | | | | It's clean now, keep it as such. Enabling it for QtCore is still OK, because it just hides a function template declared in a header. Change-Id: I8e7dfae179732ba04241a6a3258c2d722e8259df Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: state blacklist condition requirement explicitlyMitch Curtis2023-07-101-1/+2
| | | | | | | | | | | | Each line with a test function must be followed by a line describing the conditions for ignoring that test function. From what I can see, this wasn't explicitly stated anywhere. Fixes: QTBUG-114825 Pick-to: 6.2 6.5 6.6 Change-Id: I1941d6c9a6d56a8374a0c5a99c538cf1eaebd544 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QCOMPARE: restore compatibility with braced-init-listsGiuseppe D'Angelo2023-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a611a9f537f1187825339c2a2214c8ec4a23680f (in Qt 5) added support for mixed-type comparisons through QCOMPARE. That commit added a new overload for qCompare taking two types, T1 and T2; but it also left the same-type qCompare(T, T) overload around, guarded by a Qt 6 version check. The mixed-type version is however not a generalization of the same-type one, because it won't work if one of the arguments doesn't participate in FTAD. Case in point: braced-init-lists. In Qt 5 this worked: QCOMPARE(some_container, {42}); but in Qt 6 it does not work any more. The mixed-type overload fails deduction (can't deduce T2); in Qt 5 the same-type overload deduced T=SomeContainer, and {42} was used to select a constructor for SomeContainer. -- There's a partial, straightforward workaround for this: default T2 to T1 in the mized-type overload. In that case T2 has a "fallback" if it cannot be deduced. This is partial because of course doesn't address the case in which T1 cannot be deduced, but I don't think that is common at all. QList is special here, because it has qCompare overloads that makes it comparable with arrays, initializer lists and more. I don't like that very much -- we should probably have a qCompare(input_range, input_range) overload, but that's an exercise for C++20. Change-Id: I344ba33167829984978cd8d649a1904349a9edab Pick-to: 6.5 6.6 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QtTest: fix documention wording and typoAmanda Hamblin-Trué2023-07-051-2/+2
| | | | | | Pick-to: 6.6 6.5 Change-Id: I71c38e40db9ff222016ed24a43f646ceef749180 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* QtTest: code tidies: use the 4-arg connect overloadGiuseppe D'Angelo2023-07-051-2/+2
| | | | | | | | The 3-arg connect is error-prone and makes the lifetime of the connection unclear. Change-Id: I51f9bd87caa9baa57d06c8f3fd9ed8b37ef49cae Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Silence compiler warning about unreachable codeVolker Hilsheimer2023-06-301-2/+3
| | | | | | | | | | | | | | | | | | The warning has been reported by users, but never observed in CI, even though the only path that can lead to the last return statement becoming unreachable is very common in Qt: if a QDebug stream operator exists, then we always return early. Nevertheless, rewrite the code to have a single return statement. Task-number: QTBUG-112371 Fixes: QTBUG-114944 Pick-to: 6.6 6.5 Change-Id: Iaf9ec683ceceedb00771fb0743a09dcc8f50ba3f Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
* QTest: add QDeadlineTimer qWaitFor() overloadAhmad Samir2023-06-302-10/+13
| | | | | | | | | | | | For Forever timers, don't check the remaining time. Merge src_corelib_kernel_qtestsupport_core_snippet.cpp and src_corelib_kernel_qtestsupport_core.cpp. [ChangeLog][QtCore][QTest] Added QDeadlineTimer qWaitFor() overload. Change-Id: I74c3f362b77206426136a418e656465e43f45b09 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTest: add qWait(chrono::milliseconds) overloadAhmad Samir2023-06-301-1/+2
| | | | | | | | | | | | | | | | | The code bailed out of the while loop when "remainingTime <= 0", for a QDeadlineTimer::isForever() timer remainingTime() returns -1, whereas remainingTimeAsDuration() returns nanoseconds::max(). I.e. the original code stopped the while loop when the timer isForever() or "expired" (i.e. remaining time is 0). I am not sure the isForever() part was intended that way or not, but it makes sense, if QCoreApplication::processEvents() has already run "forever", there is no point looping again. [ChangeLog][QtCore][QTest] Added qWait(chrono::milliseconds) overload. Change-Id: I871c28b053c6ba4f81a7e2d434aa4fbe03c8c5e7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTest: add qSleep(std::chrono::milliseconds) overloadAhmad Samir2023-06-301-2/+3
| | | | | | | | | Using chrono means one can write 10s instead of 10'000. [ChangeLog][QTest] Added qSleep(std::chrono::milliseconds) overload. Change-Id: Iac1b12a3fc3f692b557e2d459e6f3bc565f20e93 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use a global value for warning limit when testing documentation in CITopi Reinio2023-06-271-3/+0
| | | | | | | | | | | | | | | | | | | The most common limit for the maximum number of allowed documentation warnings is zero. Use a global value for 'warninglimit', adopted by all Qt module documentation projects that include the configuration from qtbase/doc/global. This allows for a temporary increase of the limit across all modules as needed - for example, when updating the QDoc binary that the CI provisions to a version that introduces new types of documentation warnings. Increase this base limit temporarily to 10 to help re-enable documentation testing in CI as it's currently disabled. Task-number: QTBUG-113326 Change-Id: I8b66951ca9324bcfaec3b5a7ec2cff544c62feb0 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QtCore: Remove std::mutex and std::condition_variable fallbacksThiago Macieira2023-06-121-3/+3
| | | | | | | | | | | | They existed because INTEGRITY hadn't yet been updated to the C++11 Standard Library, with a minor for broken MinGW cross-compilation builds that forgot to enable gthreads support in libstdc++. The former appears to have been since fixed and the latter is a massive toolchain configuration mistake. Change-Id: I63b988479db546dabffcfffd1766b55132371f9b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove the manual undef of the min/max macros, or def NOMINMAXAmir Masoud Abdol2023-06-082-14/+0
| | | | | | | | | | We now add NOMINMAX to PlatformCommonInternal target which will be linked to everything else, so min/max will not be defined upon the inclusion of `windows.h`, or other headers. Pick-to: 6.5 6.6 Change-Id: I10016720dac7ce015e929885b7368ee86d8b6918 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Detect when Xcode is presenting os_log as structured log messagesTor Arne Vestbø2023-06-071-2/+2
| | | | | | | | | In that case, just like when os_log mirrors to stderr by itself, we want to disable Qt's fallback stderr handler. Pick-to: 6.6 6.5 Change-Id: Ia373b19788edbce616d4f0d3d9f0b217ddc1e5c0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add Gui_sync_headers as the explicit dependency for Test moduleAlexey Edelev2023-06-021-0/+5
| | | | | | | | | | The Test module uses Gui header files implictily without explicit Gui linking. We need the dependency chain at least between the module_sync_headers targets to make sure that all header files required for successful module build are present "in time". Change-Id: I40fd81cceeb0e0e8271db4ba33fd914eb484d001 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Clarify module changes in Qt6Jaishree Vyas2023-05-091-1/+1
| | | | | | | | | Changed Briefs for better understanding Fixes: QTBUG-109324 Pick-to: 6.5 Change-Id: I15b0c0dc12b1bf96626fb8ea4ad16d04b2b118ca Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Move the formatting of <chrono> durations to QDebug & QtTestThiago Macieira2023-05-062-0/+16
| | | | | | | | | | | | [ChangeLog][QtCore][QDebug] Added pretty formatting of C++ <chrono> durations. [ChangeLog][QtTest] Added pretty formatting of C++ <chrono> durations for QCOMPARE expressions. Change-Id: I3b169860d8bd41e9be6bfffd1757cc087ba957fa Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QTestEventLoop: don't stop the test fails outside the main threadThiago Macieira2023-05-051-1/+2
| | | | | | | | | | | | | | | | | | | | | This amends commit 115f828ae406d2805869fccda9269209af646a84 "QTestEventLoop: stop when the test fails" from Qt 6.3 to not attempt to stop the QTestEventLoop instance if the failure happened outside the main thread. This is to prevent the QTEL from being created outside the main thread and thus cause warnings about QObject in addition to and logged before the real test failure. [ChangeLog][QtTest][QTestEventLoop] The QTestEventLoop no longer attempts to exit its event loop if the failure was detected outside the main thread. QWARN : tst_QMutex::tryLock_non_recursive() QObject: Cannot create children for a parent that is in a different thread. (Parent is QCoreApplication(0x7fffffffe710), parent's thread is QThread(0x802e29000), current thread is QThread(0x7fffffffd5a8) FAIL! : tst_QMutex::tryLock_non_recursive() 'timer.elapsed() >= waitTime - systemTimersResolution' returned FALSE. () Change-Id: Ieab617d69f3b4b54ab30fffd175b139322a1f02c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Use qt_add_executable() not add_executable() in snippetsLeena Miettinen2023-04-261-1/+1
| | | | | | | | | Changes code snippets that are visible in the docs. Task-number: QTBUG-113116 Pick-to: 6.5 Change-Id: If743234bfe6947acf02307bf1144daad4fba5d73 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Split multi-file Files entries in qt_attribution.json as listsEdward Welbourne2023-04-201-1/+1
| | | | | | | | | | | This is now the official format for Files, when there's more than one, rather than using space-joined lists. Pick-to: 6.5 Change-Id: I4a6247fff0ece8ece2944178af38894fd5a2e1e2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Deploy Comment fields in qt_attribution.json filesEdward Welbourne2023-04-201-0/+1
| | | | | | | | | | | | | | Replace the old abuse of other fields as comments, to be overwritten by a later setting to a proper value, with actual Comment fields, now that we have them. Added a new comment to the valgrind files to say where they come from in the upstream. Pick-to: 6.5 Change-Id: I2edcfa2949fa9e59f3f67d3e578d8e5009854cf6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Remove unused documentation code snippetsFriedemann Kleint2023-04-173-10/+0
| | | | | | | | | | | | | | | | | | | Modules: - Core - Gui - Widgets - Open(Widgets) - PrintSupport - Sql - Network - Concurrent - Testlib Pick-to: 6.5 Change-Id: I63e58c01bec4bd162486020f0085227fdaa83b18 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix some narrowing conversion warningsAhmad Samir2023-04-081-1/+2
| | | | | | | | | ioctl call for FIONREAD takes an int arg, it won't work correctly otherwise. Cast the return of the read() call to int, because it won't read more than buffSize (which is an int). Change-Id: I130202a732684257bbb0e79c9358b60a61010c46 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Testlib: fix the last few s/Q_OS_MAC/Q_OS_DARWIN/wEdward Welbourne2023-03-201-1/+1
| | | | | Change-Id: I6fe6a865aea37c6a2d153bd2c3aace5242362c88 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* QtMiscUtils: add isAsciiPrintable() helperAhmad Samir2023-03-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | - isAsciiPrintable: borrowed the logic from isPrintable(uchar) in qdebug.cpp, now isPrintable(uchar) calls isAsciiPrintable - Replace ::isspace() with ascii_isspace() from qlocale_p.h Functions from ctype.h have a couple of issues: - they're locale-dependent, which isn't what's required here, the code is only interested in ASCII - their args should be representable as uchar or EOF otherwise it's undefined behavior An Early-Warning could use something like: grep -rP "\b(isalnum|isalpha|isblank|iscntrl|isdigit|islower|isgraph|\ "isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper)\b" Pick-to: 6.5 Task-number: QTBUG-111262 Change-Id: I1f47f41bd56735297078ff0d0ddc2ebf999abf8b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTest: Rename QCOMPARE_XX parameters to add meaningMårten Nordheim2023-03-084-85/+85
| | | | | | | | | | | | | | | The parameter names were previously "lhs" and "rhs", which is incredibly abstract for a testing framework. One of the parameters will tend to be a baseline value to compare against while the other is the result of some action we want to test. Thus I suggest they be renamed "computed" and "baseline". This way we can, hopefully, retain the semantic that the 'left'/first argument is the computed ('actual' in QCOMPARE) value while the 'right'/second argument is the baseline ('expected' in QCOMPARE.) Change-Id: I3e0fdce2a3f1faca06fdf7184ef6e0eb9724d990 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Doc: fix link to QTest::failOnWarningVolker Hilsheimer2023-03-052-4/+4
| | | | | | | | | Also fix incorrect failOnWarning*s* elsewhere in comments. Pick-to: 6.5 6.5.0 Change-Id: I0bbc5e71060348153876f3d9a7c77c67f3c2e00d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QSignalSpy: add wait(std::chrono::milliseconds) overloadAhmad Samir2023-03-032-8/+31
| | | | | | | | | Make the wait(int) overload call the new one. Task-number: QTBUG-110059 Fixes: QTBUG-100041 Change-Id: Ia085453c05e09e219ba56010b2504113bbc1dd34 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTestEventLoop: add enterLoop(std::chrono::milliseconds) overloadAhmad Samir2023-03-032-5/+7
| | | | | | | Task-number: QTBUG-110059 Change-Id: Ibf1d76afd313e390103be4a22e44af7fb41ace1b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: fix links to qFuzzyIsNullVolker Hilsheimer2023-03-031-1/+1
| | | | | | | | The function is in the QtNumeric documentation context. Pick-to: 6.5 6.5.0 Change-Id: Ibc6a8961bc04efd4ab1eb50bb371e6a169d513dc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Remove duplicate wordsAndreas Eliasson2023-02-281-1/+1
| | | | | | Change-Id: Ia7a38a1035bd34d00f20351a0adc3927e473b2e7 Pick-to: 6.5 6.4 6.2 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QTestTable: quote tag name in duplicate tag warning messageAhmad Samir2023-02-221-1/+1
| | | | | | | | Easier to see what the duplicate tag name is. Change-Id: Iee156aa7d6766628ec60e712811a83a2ff66dbb1 Reviewed-by: Jason McDonald <macadder1@gmail.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Update Valgrind to its 3.20.0Edward Welbourne2023-02-202-25/+543
| | | | | | | | | | | | | | | | It now generates its valgrind.h from a valgrind.h.in, but there were only two @...@ tokens to substitute, so that was easy enough. From reading the diff, important changes: * Added x86 support on FreeBSD (32- and 64-bit) * Added nanoMIPS support on Linux * Inline assembly fixes for S390 * Added VALGRIND_CLO_CHANGE request Pick-to: 6.5 Task-number: QTBUG-110999 Change-Id: I66990c958cf40c34e7d58dd60b1e11984303fb64 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* src: Remove remains of qmake conversion from CMakeLists.txt filesFriedemann Kleint2023-02-101-29/+0
| | | | | | Pick-to: 6.5 Change-Id: Id644d322a602038403bb7f46c532744575fbf6d3 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
* Improve documentation of data-driven testsEdward Welbourne2023-01-312-11/+14
| | | | | | | | | | | Mention addRow() as well as newRow(), even though the example only uses the latter. Link the best-practice section to the fuller story. Fixed a minor grammar glitch in the manual while I was about it. Pick-to: 6.5 Change-Id: Ib1c52cd8d2b6a04ea944d24d9d26c901b6cdf4e7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Rewrite the QtTest best practice guide on testing for warningsEdward Welbourne2023-01-312-15/+40
| | | | | | | | | | | It previously only covered ignoring them; we can now turn them into errors. Expand the section to include some motivation for why it is best practice to purge warnings from test output. That prepares the scene for how to suppress what's expected and make errors of the rest. Pick-to: 6.5 Change-Id: Ieb4b14b2b048d1db2fead004ee7471b82507722f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Object to creating duplicate entries in a test-data tableEdward Welbourne2023-01-312-0/+19
| | | | | | | | | | | | | | | | | | Tero Heikkinen caught tst_QQuaternion() using a duplicated test data tag and was surprised that testlib let it get away with that. That seems like a reasonable thing to discourage. While I'm at it, duplicate columns should be discouraged. [ChangeLog][QtTest] Duplicate data tags are now warned about. Every call to QTest::newRow() or QTest::addRow() should result in a distinct data tag. If they do not, a warning is produced. Likewise, duplicate column names are forbidden; each call to QTest::addColumn() should use a distinct name. Fixes: QTBUG-107185 Pick-to: 6.5 Change-Id: Idfdb7cdfdd71e1fe3db5cadb243eeecc83032922 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Cross-reference newRow() and addRow() in QTest docs and improve wordingEdward Welbourne2023-01-311-12/+22
| | | | | | | | | | | | Mitch helpfully pointed out, in review of my change to the "Data Driven Testing" doc that the two functions didn't \sa each other, so I added that. Which naturally prompted a review of their language. Also, split a long line in the code. Pick-to: 6.5 Change-Id: I5f3e973052e0107bd5bdaeecaebe218e043380ff Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Don't implicitly cast BATCHED_TEST_NAME to qstringMikolaj Boc2023-01-311-1/+1
| | | | | | | | | Some tests disable implicit casts from char * to qstring. Use QStringLiteral in qtest.h to avoid compilation problems with such tests. Change-Id: I977b6d90e5a7a8f23298b13789302501606f63d3 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QTestlib: Disambiguate static functionsFriedemann Kleint2023-01-232-9/+9
| | | | | | | | | They cause clashes in CMake Unity (Jumbo) builds. Task-number: QTBUG-109394 Pick-to: 6.5 Change-Id: I2920cc3f36ad60be1ee618c16653df5bc259019a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix build with -no-feature-shortcutTasuku Suzuki2023-01-171-0/+4
| | | | | | | | qplatformtheme.h complains about Q_GADGET without <QtCore/QKeySequence> Pick-to: 6.5 Change-Id: I7561bd3e2484c44842cd25ab12aacb9c00ebedfd Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Mark qRegisterTestCase as new in Qt 6.5Kai Köhne2023-01-161-1/+3
| | | | | | | | | Also remove reference to QTestCaseEvent loop class, which is not documented. Pick-to: 6.5 Change-Id: Ic09b3b102db535dfb090b9a4072ad29515a911ae Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* Doc: Increase Test Function TimeoutJaishree Vyas2022-12-211-0/+41
| | | | | | | | | Documentation on QTEST_FUNCTION_TIMEOUT environment variable Pick-to: 5.15 6.2 6.4 6.5 Fixes: QTBUG-88652 Change-Id: Ib851eb2312088cf6b9ab277faa571757f4076ad4 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QTest::WatchDog: fix missing timeout resets on test function changeMarc Mutz2022-12-161-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | Since e0cad1aab53119a0e47467f2236f019ce8d6da2a, the code suffered from an ABA problem where the TestFunctionStart expectation is set in testFinished(), but by the time WatchDog::run() gets around to examining the state when returning from condition_variable::wait() in waitFor(), the next beginTest() has already set the expectation back to TestFunctionEnd. There are several known solutions for ABA problems. Embedding a generation count into the expectation state seemed to be the most straight-forward fix, and can be done without DWCAS support, because the state is just 2 bits, leaving the other 30 or 62 bits for the generation counter, so do that. [ChangeLog][QTestLib] Fixed a bug which caused QTEST_FUNCTION_TIMEOUT to be applied to the whole test execution, as opposed to each test function. Fixes: QTBUG-109466 Pick-to: 6.5 6.4 6.2 5.15 Change-Id: If71ade932330407b85d204d45c74350c651325fe Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QTest::WatchDog: Extract Method setExpectation()Marc Mutz2022-12-161-11/+10
| | | | | | | | | | Keeps the code DRY and enables a follow-up commit to fix QTBUG-109466. Task-number: QTBUG-109466 Pick-to: 6.5 6.4 6.2 5.15 Change-Id: I2b904ea7b38286b07049524ba63c2c5028e680bb Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Doc: Change links from froglogic to qt domainKai Köhne2022-12-094-5/+5
| | | | | | Pick-to: 5.15 6.2 6.4 Change-Id: Ic249f8dfa168948eddc83f35314708ffb40e75b1 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Doc: Remove qtestlib-tools sectionAndreas Eliasson2022-11-302-15/+0
| | | | | | | | | qtestlib-tools is dead. Fixes: QTBUG-107806 Pick-to: 6.4 6.2 Change-Id: Ic479b9e133c1889a046d1b7483af9d8ad8ac4968 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>