summaryrefslogtreecommitdiffstats
path: root/src/testlib/doc/snippets
Commit message (Collapse)AuthorAgeFilesLines
* Fix MSVC compiler warning in code snippetsKai Köhne2021-06-081-5/+3
| | | | | | | | | Fixes warning C5046: 'testObject::MyTestObject::toString': Symbol involving type with internal linkage not defined Change-Id: I9925eb15e262f29e636c019c87311a6ea2c47505 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Fix warnings about wrong snippet path or missing .pro fileNico Vertriest2021-02-192-0/+14
| | | | | | Task-number: QTBUG-91147 Change-Id: I6a55b2b713dd70cf1cbb0b93a8d4152e175e2c4d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* CMake: Port the snippet project setup to CMakeVenugopal Shivashankar2021-02-104-8/+86
| | | | | | | | Change-Id: I411e58e94752f3b2d0a3e8aac0ab7c4c2272db89 Fixes: QTBUG-89826 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove the qmake project filesJoerg Bornemann2021-01-074-37/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-224-4/+4
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Use explicit linkage with target_link_librariesKai Koehne2020-11-301-1/+1
| | | | | | | | | | | | | | The Professional CMake book suggests always using explicit linkage with target_link_libraries, so let's use that. Whether to use PUBLIC or PRIVATE depends on the context. But let's be conservative and advise on using PRIVATE by default. Task-number: QTBUG-88935 Pick-to: 6.0 Change-Id: I12b80ee85be9f6916f1e4dea6b1c9cb29e03c20f Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: Fix documentation warnings for Qt TestTopi Reinio2020-11-191-1/+5
| | | | | | Task-number: QTBUG-86295 Change-Id: If3c48bee8c898a228128ade18fbdeaa2b8de8b20 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Prefer versioned CMake library targetsv6.0.0-beta3Kai Koehne2020-11-011-1/+1
| | | | | | | | The non-versioned one's do miss some properties. It's therefore best to not advocate using them. Change-Id: I53645e65ed4de4e0100e59905c024cdfe40be0c5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Deprecate QVariant::TypeLars Knoll2020-10-231-3/+3
| | | | | | | | | It's been obsolete for a long time already. Make sure the compiler now warns about it and remove all remaining uses in qtbase. Change-Id: I0ff80311184dba52d2ba5f4e2fabe0d47fdc59d7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Update CMake snippets to Qt 6Kai Koehne2020-09-251-2/+2
| | | | | | | Change-Id: I53021781a25c141db5d5fc6771192cd8d6ed732a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix qdoc warning from broken snippetVolker Hilsheimer2020-09-231-1/+1
| | | | | Change-Id: Ieaf7676dd7406363dfd970528dd13e65b9af87c3 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Compile snippets only when running testsPaul Wicking2020-09-102-13/+17
| | | | | | | | | | Turn snippets projects into subdirs with libraries to avoid messy dependencies. Fixes: QTBUG-86497 Pick-to: 5.15 Change-Id: Idb2c43f97d56c9b8d9992617ef716bde40fff5b7 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Doc: Mention no_testcase_installs which can be used to prevent installAndy Shaw2020-08-201-0/+4
| | | | | | | Change-Id: If8044a339cab754d427fd7626dd6813c7cc99e56 Pick-to: 5.15 5.12 Fixes: QTBUG-85827 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix build of testlib doc snippetsTor Arne Vestbø2020-07-291-2/+1
| | | | | | | | The file src_qtestlib_qtestcase was built twice, causing duplicate main symbols Change-Id: I18750b87eee27603d9f56129fd6c30fddf4a4828 Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* QTestlib: Enable comparing QList against initializer lists/arraysFriedemann Kleint2020-07-211-0/+20
| | | | | | | | | | | | | | | | | | | | | It is unnecessary to create a QList container just for comparison. Split out helpers for comparing sequence sizes and sequences from qCompare(QList) and add a template for an array with a non-type template parameter for the size. One can then write something like: const int expected[] = {10, 12,...}; QCOMPARE(QFontDatabase.pointSizes(...), expected) Unfortunately, any commas in such an array will be misread by macro expansion as macro argument separators, so any expected array with more than one entry needs an extra macro expanding __VA_ARGS__. Change-Id: Ie7c8dc20bf669bbb25f6d7f8562455f8d03968c8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Document how to use CMake for Qt TestLibKai Koehne2020-05-262-1/+9
| | | | | | Task-number: QTBUG-73058 Change-Id: I6e29a83a1346ea0d2f94fcf445e1de9c07072aa6 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Enable warnings-are-errors also for snippetsKai Koehne2020-05-071-0/+2
| | | | | | Pick-to: 5.15 Change-Id: I6b3645924e4f090c7887ce0d6296a71dc8f8159d Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Snippets: Fix dependency issuesKai Koehne2020-05-071-3/+0
| | | | | | | | | | | | | | | | The widget snippet was sometimes ignored, because the printsupport dependency was not explicit in the top-level src.pro file. This lead to a situation that, if printsupport by chance was already built, it was tested, otherwise silently ignored. This shows that having requires(qtHaveModule()) inside src/ is actually harmful, and they are therefore removed from snippets.pro. Also, the dependencies for the snippets projects are now moved to a central place so that the correctness is easier to check. Pick-to: 5.15 Change-Id: Ice051fa04848040e206c78361fbbcf680383c6b2 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Fix compilation of testlib snippets if sql, widgets are missingKai Koehne2020-05-051-0/+3
| | | | | Change-Id: Ibcc872408ba829085809737004d9d3186bd20bab Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Doc: Fix compilation issue with QVERIFY2 exampleKai Koehne2020-04-231-1/+1
| | | | | | | | | | | | | Fixes error C2124: divide or mod by zero when compiling the test code (enabled by 713cd83200f3c60eac5d389dfabc44be1446e2ac). Pick-to: 5.15 Change-Id: I2ae39426fc0012f79714ff3d6484d792cab4bd92 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Make Qt Test snippets compilableNico Vertriest2020-04-039-183/+396
| | | | | | Task-number: QTBUG-81498 Change-Id: I22f07cd539e5e317b6cf15eb369d59915146bd13 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: Update info about building testsLeena Miettinen2019-12-061-0/+14
| | | | | | | Task-number: QTBUG-63987 Change-Id: I4b6e8f35afc9d3ca10b393a0305bbb51bf81ec26 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-11-061-2/+27
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/features/mac/default_post.prf src/corelib/tools/qsimd_p.h src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm util/qfloat16-tables/gen_qfloat16_tables.cpp Change-Id: If48fa8a3bc3c983706b609a6d3822cb67c1352a4
| * Doc: Add best-practice-info for using QVERIFY() and QCOMPARE()Leena Miettinen2019-11-011-2/+27
| | | | | | | | | | | | | | | | | | From https://wiki.qt.io/Writing_Unit_Tests Task-number: QTBUG-63987 Change-Id: I7229ac0712d1207c0c9ebdac868c33bb35dcb0f0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-241-1/+29
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qstandardpaths_unix.cpp src/corelib/tools/qsharedpointer_impl.h tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: Iae95c5778dc091058f16f6db76f04a0178a9e809
| * Doc: Describe initTestCase_data() function and QFETCH_GLOBAL macroLeena Miettinen2019-10-111-1/+29
| | | | | | | | | | | | Fixes: QTBUG-24342 Change-Id: I8f8f3726c5d31e34af9bfe054572c08fc07e01e0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Introduce QSignalSpy constructor allows to spy on a meta methodVitaly Fanaskov2019-08-131-0/+48
|/ | | | | | | | | This functionality is especially convenient if meta-object system is heavily used in a test. For example, if you need to test a bunch of signals based on their names and/or argument types. Change-Id: I09a4ecbbd3d0859b5fd466d9dde7679804eb7614 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.12.1Liang Qi2019-01-081-20/+31
|\ | | | | | | | | | | | | Conflicts: src/widgets/kernel/qtooltip.cpp Change-Id: Ic2f9a425359050eb56b3a4e5162cf5e3447058c8
* | Doc: Restore documentation for QTest functions in other modulesTopi Reinio2019-01-041-0/+52
|/ | | | | | | | | | | | | | Qt Test library sources specific to Core, GUI and Widgets modules were moved around in commit 88867e39b. The new source locations must be referenced in Qt Test documentation configuration. The same sources are excluded in their original doc projects, and the related snippet file is moved over to qttestlib. The commit also fixes the remaining documentation issues for Qt Test. Change-Id: Ibe011aa83639e574d647f12bc9e53e618781bce6 Reviewed-by: Martin Smith <martin.smith@qt.io>
* testlib: Move qtestsystem helpers to their respective modulesTor Arne Vestbø2018-07-161-20/+0
| | | | | | | | | | | | | Having the helpers in each respective module lets us implement the helpers using private APIs without forcing the test to add private dependencies. It also makes it easier to test Qt using a third party testing framework (for running the test suite), while still using the helpers for ensuring tests behave expectedly. Change-Id: I2a6ce24526ed345f3513548f11da05c7804c203f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-02-281-0/+66
|\ | | | | | | Change-Id: Ib21e6b9030b4d5363f440d082ce3df28098d1b95
| * Doc: Add doc for QSKIPNico Vertriest2018-02-281-0/+66
| | | | | | | | | | Change-Id: Ib8cd1b4926652984b41b5a05bf4dbf3214f2856f Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Improve testlib example a bitFrederik Gladhorn2018-02-131-4/+26
|/ | | | | | | | | | | Assuming this is someone's first contact with testlib, we want to mention QCOMPARE. Make the whole thing a bit more readable instead of squeezing everything into single lines and add a bit more code. Change-Id: I76908003427277670d1199774083a3ee01b8747c Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Nico Vertriest <nico.vertriest@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* testlib: Add qWaitFor to wait for predicateTor Arne Vestbø2017-09-251-0/+8
| | | | | | | | Reduces duplication of logic and allows other primitives to be built on top. Change-Id: Ia100014cfb0c09ac2f47c3a156d0c76f0fddafa8 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Long live QTest::addRow()!Marc Mutz2017-01-101-0/+11
| | | | | | | | | | | | | | This new function does the same as newRow(), except that it has a less confusing name (in line with _add_Column()), and accepts printf-style arguments to avoid the need to newRow(qPrintable(QString::asprintf())), a common pattern in client code. It uses qvsnprintf() under the hoods, avoiding the need for the QString const char* round-trip. Port all in-tree users of newRow(qPrintable(QString::asnprintf())) to the new function. Change-Id: Icd5de9b7ea4f6759d98080ec30f5aecadb8bec39 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Fix QVariant::TypeJesus Fernandez2016-11-301-1/+1
| | | | | | | | | QVariant::QString does not exist Task-number: QTBUG-56586 Change-Id: Ic5fe81fc4fc3553f9b755e067ed73c4d1bba9add Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-08-291-6/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cf53aa21bf0f8fbd13c0ce2d33ddf7bc63d0d76a and 3aaa5d6b32130d3eeac872a59a5a44bfb20dfd4a were reverted because of reconstruction in 5.7. defineTest(qtConfTest_checkCompiler) in configure.pri is smart enough to cover the case in a9474d1260a8c8cc9eae14f2984098919d9684e5. DirectWrite: Fix advances being scaled to 0 Since 131eee5cd, the stretch of a font can be 0, meaning "whatever the font provides". In combination with ec7fee96, this would cause advances in the DirectWrite engine to be scaled to 0, causing the QRawFont test to fail. Conflicts: configure mkspecs/features/uikit/device_destinations.sh mkspecs/features/uikit/xcodebuild.mk src/corelib/global/qglobal.cpp src/corelib/global/qnamespace.qdoc src/plugins/platforms/cocoa/qcocoamenuitem.h src/plugins/platforms/windows/qwindowsservices.cpp src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp src/widgets/kernel/qapplication.cpp tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp Change-Id: I4656d8133da7ee9fcc84ad3f1c7950f924432d1e
| * Doc: Remove references to Windows CE in Qt Test docsVenugopal Shivashankar2016-08-221-6/+0
| | | | | | | | | | | | | | | | | | The platform is not supported since Qt 5.7 Task-number: QTBUG-55331 Change-Id: If6202b347efdfb38eba4c4c3a65dde515d066112 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | doc: add docs for QTest::createTouchDevice()Shawn Rutledge2016-06-151-4/+5
|/ | | | | | Task-number: QTBUG-44030 Change-Id: I4bb6a0d0a257cf94883895baebafba70d0cf0f58 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Unify license header usage.Jani Heikkinen2016-03-296-18/+78
| | | | | | | | | Update files using old header.LGPL3 to header.LGPL Update files using old FDL template to use new one Update files using old BSD template to use new one Change-Id: I36a78272516f9953d02956522f285b40adfc8915 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Examples/Doc snippets: Fix single-character string literals.Friedemann Kleint2015-10-131-1/+1
| | | | | | | Use character literals where applicable. Change-Id: I79fa5018f05735201ae35ee94ba0d356fcad1056 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Updated BSD licensed file headersJani Heikkinen2015-02-156-18/+18
| | | | | Change-Id: I6441ff931dbd33b698d762e6f6784898f3f60fe7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-116-30/+30
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* QTest: update docs for toString()Marc Mutz2015-01-081-0/+13
| | | | | | | | | | | | Following c61f8df4047a616ffcb5e775fa8e5981b13e193f, we now prefer overloading toString() in the type's namespace over specializing the primary template. Let the docs reflect that and add an example. Also suggest to delegate the messy raw char pointer handling to the existing toString(QString)/toString(QBA) overloads. Change-Id: Id76181faba86aea52588611ea64ea9b95371a733 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSignalSpy: Added template function pointer constructorKeith Gardner2014-04-231-0/+5
| | | | | | | | | Added the function pointer constructor to QSignalSpy to take advantage of the new connect syntax. Change-Id: I94218a096c677cdba73e1b2cfa8b9c09bc28145f Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Doc: Address some "No documentation for..." warnings in QTestJason McDonald2014-02-221-0/+11
| | | | | | Task-number: QTBUG-36985 Change-Id: I811b4711edc3420911fcd706ecef2d090f41bc89 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
* QtTest: Output correct library nameSze Howe Koh2013-05-271-1/+1
| | | | | | | | | | | "QTest" is the C++ namespace; "QtTest" is the library name - Edited the logger output in qplaintestlogger.cpp - Updated documentation - Updated expected outputs for self-tests Change-Id: I43c525c43221a8d4e843a00d6d55b0f06ef55fd7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix the QTouchEventSequence code snippet so that it compilesAndy Shaw2013-04-181-2/+2
| | | | | | | | | The release() function also requires the QPoint to be set which was missing from the code snippet. Change-Id: I4a5cd2bed0915eb1fbaac3a34fb229eac9c284df Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Geir Vattekar <geir.vattekar@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-186-6/+6
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove metatype registration of built-in types.Stephen Kelly2013-01-031-3/+3
| | | | | | | | As they are built-in, they are effectively registered at compile-time already. Change-Id: I7ae6ba16088eab5d19213fa7b07c2a7760988a86 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>