summaryrefslogtreecommitdiffstats
path: root/src/testlib/doc
Commit message (Collapse)AuthorAgeFilesLines
* Doc: Remove unreferenced and broken \externalpage entryJerome Pasion3 days1-4/+0
| | | | | | | | | | | -Some URLs give 404 -Some bugreports were resolved in Qt 5.1x -Some URLs no longer referenced in Qt 6 Task-number: QTBUG-142088 Pick-to: 6.11 Change-Id: Ic4ae92b3f74ce6f62484453b8943d6b149269bc3 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Doc: Fix "Building with CMake and CTest" section in testlib overviewJoerg Bornemann2025-11-141-5/+6
| | | | | | | | | An earlier attempt to fix links created a superfluous link to the section in the first sentence of the section. Fix the paragraph. Pick-to: 6.10 6.8 Change-Id: If11803340659127429142d36d7669b9f91f7c2ee Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Doc: Use correct file extension in \page commandPaul Wicking2025-09-181-1/+1
| | | | | | | Task-number: QTBUG-140096 Change-Id: I67c41480a6bc29fd6f94d9fa7e4b0308911a8269 Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io> Reviewed-by: Alexei Cazacov <alexei.cazacov@qt.io>
* CMake: Don't use private CMake API in doc snippetsAlexandru Croitor2025-08-211-8/+12
| | | | | | | | | | | | | | | | | | | Private CMake API like qt_internal_extend_target should not be used in public doc snippets. While most of the CMakeLists.txt doc snippets might not appear in the documentation right now, they might in the future (just like the CMake API doc snippets). In addition, using private CMake API for doc snippets targets causes issues with SBOM generation, because the original targets are not created with private API (e.g. qt_internal_add_module vs qt_add_library), and thus important sbom meta information is missing, causing errors at cmake configure time when sbom generation is enabled. Pick-to: 6.8 6.9 6.10 Change-Id: I2ef80f617ba8b745520408d22dd2e6be5ee4c5e0 Reviewed-by: Oleksii Zbykovskyi <Oleksii.Zbykovskyi@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Doc: Fix incorrect usage of \generatelistTopi Reinio2025-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | The \generatelist command takes an optional argument that affect how the members are listed, for example, `classesbymodule` which creates an annotated list of the classes in a named C++ module. `groupsbymodule` is not recognized or documented. QDoc falls back to generating a list of all members of a group in this case. While the end result is correct, this relies on an undocumented feature that is likely to change and break. Replace these instances with an explicit \annotatedlist command that produces the same output. Pick-to: 6.10 Task-number: QTBUG-138901 Change-Id: I5d83c0e54daa1888beebb77d8391ea607b8464ed Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Improve QTest module overviewKai Köhne2025-07-282-6/+8
| | | | | | | | | | * Mention benchmarking functionality; link to overview documentation. * Be more specific in wording; Most of QTest API is not made up of classes, but functions and macros. Pick-to: 6.10 Change-Id: I93fcc860ba858ed9f3d7a90a6690fa1d72e07896 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Make QTest::defaultTryTimeout publicMitch Curtis2025-07-171-0/+31
| | | | | | | | | | | | | | | | This allows users of Qt Test to have control over the default timeout value without having to explicitly pass it via the *_WITH_TIMEOUT variants of the macros. Continues on the work done in 55f163382d36ddf908fc2884f2020a1b92340c10. [ChangeLog][QtTest] Added QTest::defaultTryTimeout to allow configuring the default timeout used by the QTRY_* functions. Task-number: QTBUG-81979 Task-number: QTBUG-138160 Change-Id: I04873fd3cc51e9be19850aa5a7de78f9444a11ee Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Doc: Update the benchmarking option descriptionsAlexei Cazacov2025-06-261-3/+5
| | | | | | | | | | This commit adds a `perf` option description and mentions that the `tickcounter` options requires a hardware support. Fixes: QTBUG-134795 Pick-to: 6.10 6.9 6.8 Change-Id: I8462073850b6811508776b40e867e62eb88f78e7 Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
* Doc: Enable automatic linking to sources on code.qt.ioTopi Reinio2025-05-271-0/+3
| | | | | | | | | | | | Since 6.10, QDoc is capable of generating links to the declaration in the source code for each documented C++ API entity in their `Detailed description`. Add the required configuration to enable this feature in online documentation builds. Change-Id: Iaafabc5aea50a6cd72549bb1c04007bb4de498ca Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Update QTest documentation to reference Qt6TestDheerendra Purohit2025-04-101-1/+1
| | | | | | | | | | | | | The QTest documentation incorrectly referenced Qt5Test instead of Qt6Test. This has been updated to reflect the correct module name. Fixes outdated references in the documentation and ensures consistency with Qt 6 naming conventions. Fixes: QTBUG-134395 Change-Id: I254df83ecbea542c1a47b17aa0b756ed8a6f562a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix restoration of default locale after tests that change itEdward Welbourne2024-11-282-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | Include an example of this in testlib's docs, as an illustration of how to restore global state after a test that frobs it. Replace various "restore as the test finishes" approaches with scope guard forms that also work when the test fails. Add missing restoration to tests that allowed their changes to leak into later tests. (If these later tests actually depended on that, they should be amended to control the default locale for themselves. This both makes the tests more robust and documents the need for a specific locale.) Always restore the actual prior default locale, rather than just assuming it's the system locale (as several tests did). For tst_QMimeDatabase this replaced a home-grown RAII class. For tst_rcc, I included similar treatment of an unregistration of a resource, since that clearly should follow the same pattern. For tests that set the default locale in initTestCase(), I've moved that to their constructor as that comes as close as possible to the sense of doing it in main(), which is the natural place for a global setting intended to apply to the whole program. Change-Id: Ia7970a33b14c4fbd67c1d70dcafbba21f2fae3ef Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert "QTest: add -[no]throwon{fail,skip} command line arguments"Thiago Macieira2024-11-071-6/+0
| | | | | | | | | | | | | | | | | | | | | | This reverts commit fde57300ab51c7deda168f6a4515dcf7b1340618 and a portion of commit 627f804d80d76cb729b84dc319382213cd89763c and of commit e769cf026e328ed7fff660c204ce6e55b80114e3. The command-line feature and the environment variables are a design flaw, because there are NO conditions under which a regular user who isn't the designer of the test can make the correct choice. Either the tests are designed to work with throwing or they are not. The test must be run in the mode that the test developer wrote it. [ChangeLog][QtTest] The command-line options and environment variables that changed the defaults for QTest::setThrowOn{Fail,Skip}() have been removed due to a design flaw. To set the default, either place a call to the required function in the test's initTestCase() function or define the C++ macro. Task-number: QTBUG-66320 Change-Id: I0c17899984ebfd70de97fffd51784aa42d41b743 Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Docs: Organize topics in the qtbase repoAlexei Cazacov2024-08-132-1/+36
| | | | | | | | | | This commit organizes the articles, so they: - have a reasonable tree structure - can be navigated through the topic tree in the Qt Creator help viewer Task-number: QTBUG-127046 Change-Id: I66f2b131b8aacc887b35a770e51c1425431dffb5 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Fix Qt Creator link issuesLeena Miettinen2024-08-051-1/+1
| | | | | Change-Id: I828e2d48a4a332ad48d11fe81fee7e334960bb74 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Introduce QT_SKIP_DEFAULT_TESTCASE_DIRS target propertyAlexey Edelev2024-07-042-0/+105
| | | | | | | | | | | | | | | The property allows skipping to set the QT_TESTCASE_BUILDDIR/SOURCEDIR definitions. This might be helpful in certain uscases, to optimize the build by avoiding the need to set the unused compilation flags. Add the QT_SKIP_DEFAULT_TESTCASE_DIRS variable that is used as the default value for the QT_SKIP_DEFAULT_TESTCASE_DIRS property. Task-number: QTBUG-126729 Change-Id: I6fe5bed428175cdd30d21741c20b745d85f3917d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Fix broken linksSafiyyah Moosa2024-06-261-1/+1
| | | | | | | | | | | | | | | | | This commit fixes: Broken URL (404): 'https://doc.qt.io/qtcreator/creator-autotest.html' from qtest-overview.html https://doc.qt.io/qtcreator/creator-autotest.html is replaced with https://doc.qt.io/qtcreator/creator-how-to-build-and-run-tests.html. Broken URL (404): 'http://www.opengl.org/wiki/Tessellation_Shader' from qopenglshaderprogram.html 'http://www.opengl.org/wiki/Tessellation_Shader' is replaced with https://www.khronos.org/opengl/wiki/Tessellation Task-number: QTBUG-126281 Fixes: QTBUG-126502 Pick-to: 6.8 6.7 6.5 Change-Id: Ifda1258a6500adcfa3fe861135ab98082ed2df10 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Remove \note that indicates you can access the source codeAndreas Eliasson2024-04-291-2/+0
| | | | | | | | | | There used to be an examples page; this is no longer the case. Thus, remove the \note that indicates you can access the source code. Fixes: QTBUG-122166 Pick-to: 6.7 6.6 6.5 Change-Id: I1abe88000ae406e8d2cc9cc1deed42664607626b Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Correct doc snippet licenseLucie Gérard2024-02-282-2/+2
| | | | | | | | | | | | | | All file under doc/snippet should be license as Documentation snippets and according to QUIP-18 [1] this is LicenseRef-Qt-Commercial OR BSD-3-Clause [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I76eedfb6b15c4091f726a5652e3530001d7cdaf7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Qttestlib-manual.qdoc: fix typo in API docsAhmad Samir2024-02-081-1/+1
| | | | | Change-Id: I7865afbdaed266edfb54866cddacc6d6e5ab725c Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Change license of .qdoc filesLucie Gérard2024-02-011-1/+1
| | | | | | | | | | | According to QUIP-18 [1], all .qdoc files should be LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Change-Id: I4559af21fc9069efa9bf0cbd29c5e86cfdac9082 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* QTest: add opt-in changing QCOMPARE etc to exit with throw, not returnMarc Mutz2024-01-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add exception classes and use them to change the control flow for QTEST_{FAIL,SKIP}_ACTION from return'ing from just the immediate function to the full way to the QTestLib infrastructure, here we filter them out. There are three modes: - If QT_NO_EXCEPTION, then we return - If QTEST_THROW_ON_... is also defined, #error out - Otherwise, if QTEST_THROW_ON_... is defined, always throw - Otherwise, the decision is made at runtime (with defaults read from QTEST_THROW_ON_... environment variables). Three selftests depend on the old behavior, as they explicitly check that multiple FAIL SKIP etc emerge, which the new framework, of course, prevents. Locally disable throwing at the test function level. Add initial docs and enable exceptions in all of the selftest subprograms to facilitate switching between the two runtime-selectable modes. [ChangeLog][QtTest] Added QTEST_THROW_ON_FAIL and QTEST_THROW_ON_SKIP C++ macros and environment variables that, when defined, change how QCOMPARE/QVERIFY/QSKIP etc exit the test function on failure. Instead of a return, exiting only the immediately-surrounding function, they throw a special exception instead, thereby exiting from subfunctions of the test function, all the way to QtTestLib. Fixes: QTBUG-66320 Change-Id: I96c38d2a1dcdd9de84942cf448a8bbf3ab6d3679 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* qtestlib: Add option to skip blacklisted testsKalle Viironen2023-11-221-0/+6
| | | | | | | | | | | | | | | Add a command-line option "-skipblacklisted" to testlib to skip blacklisted test cases. Currently, blacklisted test cases are run, but results are ignored. For test code coverage measurements, it's important to see the code coverage of the actually tested code in comparison to the code that was run but not actually tested. The default approach remains unchanged, meaning that blacklisted tests are run with the results ignored. Fixes: QTBUG-112793 Change-Id: I6fe0a6353cb1c021e0232c79bb4f404632fb0bce Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Add QTest option for repeating the entire test executionJøger Hansegård2023-11-151-0/+4
| | | | | | | | | | | | | | | | | Repeated test execution can be useful, under a debugger, to catch an intermittent failure or, under memory instrumentation, to make memory leaks easier to recognize. The new -repeat flag allows running the entire test suite multiple times within the same process. It works by executing all tests sequentially before repeating the execution again. This switch is a developer tool, and is not intended for CI. It can only be used with the plain text logger. Change-Id: I2439462c5c44d1c8aa3d3b5656de3eef44898c68 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Fix warnings and linking issuesTopi Reinio2023-10-091-0/+3
| | | | | | | | | | | | | | | | | | | | Remove or replace links to examples that were removed or moved under manual tests. Replace code snippets that were quoting the now-missing examples. Fix documentation of QSet::removeIf(). Fix typo in documentation macro: Unknown command '\examplecateogry'. Add qtopengl, qtshadertools dependencies to Qt Widgets documentation project to enable correct linking to those topics. Mark all documentation sets in qtbase as free of warnings. Pick-to: 6.6 6.5 Change-Id: I058cd5f2063aa933ea310bceff906f05422a7cb2 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Improve Qt Test documentation regarding skipping/expecting failuresMitch Curtis2023-08-162-10/+17
| | | | | | | | | | | - Mention QEXPECT_FAIL on the best practices page. - Link to the best practices page from "Chapter 6: Skipping Tests with QSKIP". - Add some more links. Pick-to: 6.2 6.5 6.6 Change-Id: I0c9e0adb9fe500791dad44869434cf6ecdcf51a1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* Doc: fix link to QTest::failOnWarningVolker Hilsheimer2023-03-051-3/+3
| | | | | | | | | 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>
* 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-311-0/+4
| | | | | | | | | | | | | | | | | | 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>
* 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>
* Doc: Change links from froglogic to qt domainKai Köhne2022-12-092-3/+3
| | | | | | 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>
* Doc: link to the testlib tutorial section on skippingMitch Curtis2022-10-311-0/+3
| | | | | | | | | | Short of expanding Qt Test Best Practices to have a section about QEXPECT_FAIL, we can link to some existing documentation that briefly covers it. Pick-to: 6.2 6.4 Change-Id: I37bf2672e4b5b6e7315e009f86d03eeb7937d50e Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* testlib: make it possible to test double-clicks with discrete eventsShawn Rutledge2022-10-161-0/+13
| | | | | | | | | | | | | | | | | | | | | | The timestamp will no longer be incremented by 500ms after a mouse release if the delay has been explicitly specified. The default delay is 1 ms since f5010c49a37729375e37e6fe8cea60dd4b880d83 but the running timestamp was unconditionally post-incremented by 500ms after every mouse release, to prevent double-clicks, which were always deemed as unintended (because we have a mouseDClick function for that). Now, we do that 500ms increment only if the user has not provided a delay value in the function argument at all. We have often found it useful in our own tests to generate double-clicks "the hard way", by sending indivdual events, so as to be able to check state in some target object at each step, as shown in the new snippet. [ChangeLog][QtTest] QTest::mouseRelease() and mouseClick() can now be used to test double-clicks, by specifying a realistic timestamp delay. Fixes: QTBUG-102441 Change-Id: I8e8d242061f79efb4c6e02638645e03661a9cd92 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix file which had SPDX-License-Identifier on two linesDmitry Shachnev2022-10-111-2/+1
| | | | | | | | This breaks our automation in Debian. Pick-to: 6.4 Change-Id: Iee035dee8e0d89e22540a2691689da46c4c301a3 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Document shell-friendly data tags as best practiceEdward Welbourne2022-09-075-16/+20
| | | | | | | | | Also follow this best practice in testlib's own documentation and examples. Pick-to: 6.4 Change-Id: I8b57dfa8f88835adae8fceeb122a16635708e338 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix two trivial defects in testlib docsEdward Welbourne2022-09-011-2/+2
| | | | | | | | | | | | | A fragment of inline code wasn't wrapped in \c{}. Doing so made the quotes it was wrapped in redundant. Documentation of of QSKIP's parameter claimed it does something it should, but it's up to the client code using it to write a description that lives up to that. Pick-to: 6.4 Change-Id: Ib355b9b85c9986f244ae01479134245f182c912c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Provide CMake guidance for skipping whole testsEdward Welbourne2022-09-011-5/+14
| | | | | | | | | | The testlib docs on how to skip whole tests was qmake-specific, so add the missing details for CMake. Pick-to: 6.4 Change-Id: I247d08262302dcedb98ffbf301932d6dd84d7ff7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Implement the batch_tests featureMikolaj Boc2022-08-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | An approach of test batching (joining multiple tests into a single binary) has been taken, due to long linking times/binary size on certain platforms, including WASM. This change adds a new feature 'batch_test_support' in Qt testlib. Based on the value of the feature, test batching may become enabled with the -batch-tests switch. Batching works for every target added via qt_internal_add_test. When first such target is being processed, a new combined target for all of the future test sources is created under the name of 'test_batch'. CMake attempts to merge the parameters of each of the tests, and some basic checks are run for parameter differences that are impossible to reconcile. On the C++ level, convenience macros instantiating the tests are redefined when batch_tests is on. The new, changed behavior triggered by the changes in the macros registers the tests in a central test registry, where they are available for execution based solely on their test name. The test name is interoperable with the names CMake is aware of, so CTest is able to run the tests one by one in the combined binary. Task-number: QTBUG-105273 Change-Id: I2b6071d58be16979bd967eab2d405249f5a4e658 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-232-2/+2
| | | | | | | Task-number: QTBUG-105718 Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>