summaryrefslogtreecommitdiffstats
path: root/src/testlib
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2019-11-196-32/+132
|\ | | | | | | Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
| * Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-11-011-2/+2
| |\ | | | | | | | | | Change-Id: I68a6ed3184e62fa89c47c564bb01002c0918d0fd
| | * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-301-2/+2
| | |\ | | | | | | | | | | | | Change-Id: Ib4df563fc7b1f7c40f425e0e71180d9517a672be
| | | * QTestLib: basic WebAssembly supportMorten Johan Sørvig2019-10-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disable the crash signal handler. This makes it possible to run auto-tests in the browser. Long-running tests may cause the browser to interrupt or display the “a web page is slowing down your computer” message, or not produce any console output while the test is running. Change-Id: Ifd53b744bd3652abfb466b78992ce2371eca2536 Task-number: QTBUG-68504 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
| * | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-264-29/+127
| |\| | | | | | | | | | | | | | Change-Id: I379794a01cbf6fb39d94b24cc8c90b1971a212b9
| | * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-254-29/+127
| | |\| | | | | | | | | | | | | Change-Id: Iebedaa967a263854f18cd403ce007d7965f26d2b
| | | * Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-244-29/+127
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Replace \b {Note:} with \noteLeena Miettinen2019-10-212-15/+13
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I1f6947acec4494c151317e1faf79720dad0da6bb Reviewed-by: Martin Smith <martin.smith@qt.io>
| | | | * Doc: Describe using QVERIFY to verify validity of QSignalSpyLeena Miettinen2019-10-141-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From https://wiki.qt.io/Writing_Unit_Tests Change-Id: I3186efe30cde465766800aee1f0a530fb80907fb Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | | | * Doc: Describe initTestCase_data() function and QFETCH_GLOBAL macroLeena Miettinen2019-10-113-12/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-24342 Change-Id: I8f8f3726c5d31e34af9bfe054572c08fc07e01e0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| * | | | QShortcut: Properly port to the new configure systemFriedemann Kleint2019-10-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the feature to corelib so that the QMetaType enumeration values can be properly excluded and there is no need for a dummy class. Use QT_REQUIRE_CONFIG in the headers of classes to be disabled. Add headers/source files in the .pro file depending on the configure feature in libraries and tests. Add the necessary exclusions and use QT_CONFIG. Task-number: QTBUG-76493 Change-Id: I02499ebee1a3d6d9a1e5afd02517beed5f4536b7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | | | | Regenerate src/*Alexandru Croitor2019-11-142-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I0314b4faa1e4860e86198eea4189987e527dfec2 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | | Regenerate everything under ./srcAlexandru Croitor2019-11-122-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ibdbdc17f8c2ee41356f490dd839a47e1bcf4c586 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | | | | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-10-141-29/+63
|\| | | | | | | | | | | | | | | | | | | Change-Id: I4a78428a8ea273b6960792e3b8043f816fa37fcf
| * | | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-021-10/+14
| |\| | | | | | | | | | | | | | | | | | Change-Id: Ideaa64d583746f1ce8265997131fb1ce3a9acbcf
| | * | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2019-10-011-2/+5
| | |\| | | | | | | | | | | | | | | | | Change-Id: I77ba01f09b3dbcaf13cb265a70d9da661c32a61f
| | | * | Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-301-2/+5
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qrandom.cpp src/corelib/io/qfileinfo.cpp src/corelib/kernel/qeventdispatcher_win.cpp src/corelib/kernel/qeventdispatcher_win_p.h src/gui/text/qfontdatabase.cpp src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm src/plugins/platforms/windows/qwindowsglcontext.cpp src/testlib/qtestcase.cpp Done-With: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I4893212471aa24be804c989a581810e2f714545c
| | | | * Do not pass nullptr as '%s'Allan Sandfeld Jensen2019-09-231-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes GCC 9 warning. Change-Id: I2a21d863267b444a29697aa026c21b47e3ac8382 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * | | Short live QtPrivate::{condition_variable,mutex}!Marc Mutz2019-09-271-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a temporary measure to work around an implementation bug on Integrity: For all other platforms, QtPrivate::condition_variable is just std::condition_variable. On Integrity, it's a class that wraps QWaitCondition to provide the interface of std::condition_variable. This allows the use of std::condition_variable across Qt without running into the Integrity issue. Once we can depend on an more modern Integrity toolchain, removing QtPrivate::condition_variable is a simple mechanical change: s/QtPrivate::condition_variable/std::condition_variable/g; s/QtPrivate::mutex/std::mutex/g; Task-number: QTBUG-78450 Change-Id: I293a99d1cdc48691817b926aa51ecd84556e5e90 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-09-221-27/+57
| |\| | | | | | | | | | | | | | | | | | Change-Id: Ic274a375d6fc1312ced2354e034dc0980dd47c51
| | * | | QTestLib: modernize and stream-line WatchDogMarc Mutz2019-09-171-27/+57
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... by porting from (QWaitCondition,QMutex) to std::{condition_variable, mutex} and making the code more accessible by introducing explicit states. This patch was originally starting out to just replace QWaitCondition with std::condition_variable, which is faster and more compact, and the patch still does that, too. The focus, however, has shifted towards improving the accessibility of the code, in particular its states and the transitions between them. Due to the way QWaitCondition prevents spurious wakeups, this code could use its QWaitCondition as a semaphore, e.g. where it was calling wait() in the ctor to be released only when the thread it started has entered run(). That makes the code unnecessarily hard to follow. Fix by introducing an enum Expectation which tells what the watch-dog is currently waiting for, and unmistakably determines the state the watch-dog is in: ThreadStart, TestFunctionStart, ... The timeout value is now selected based on the Expectation value, so the timeout is no longer serving as the implicit state, either. Also port the defaultTimeout() function to return a std::chrono::milliseconds directly. Elsewhere in Qt, we guard against lack of <chrono>, so this unguarded use will also serve as a guide to see whether all supported platforms now, eight Qt releases after we formally require C++11 for Qt usage, provide it. Without <chrono>, there's no timed waiting in the standard library. Change-Id: If97b601c4090a2a2926fa58c903cfe3ec2656324 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-10-116-22/+158
|\| | | | | | | | | | | | | | | Change-Id: I3a1d7673c3c20019ab12a2ea0a60f1619920a34c
| * | | Merge remote-tracking branch 'origin/dev' into wip/qt6Alexandru Croitor2019-09-046-22/+158
| |\| | | | | | | | | | | | | | Change-Id: I54741635460bb2d8f3fd0be535ee1968d6c442bb
| | * | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-08-161-1/+1
| | |\| | | | | | | | | | | | | Change-Id: Ia3645f92b9debf3e1fe2d972300c7d0dbd649268
| | | * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-08-151-1/+1
| | | |\ | | | | | | | | | | | | | | | Change-Id: Id7954ada1f8658d3b1da5e8241a09f2d201a7c56
| | | | * Bound the scope of QTRY_LOOP_IMPL()'s local variableEdward Welbourne2019-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTRY_IMPL() exercises QTRY_LOOP_IMPL() twice, once directly, the second time via QTRY_TIMEOUT_DEBUG_IMPL(); and QTRY_LOOP_IMPL() deliberately doesn't bound its scope (e.g. with the canonical do{...}while(0) trick) so that the latter can access its local variable. Unfortunately, this means the local's declaration in the second use of QTRY_LOOP_IMPL() shadows the first. So enclose the first in braces to bound the scope. Fixes: QTBUG-77297 Change-Id: I849bfe0b8abfb517ed3e783abf86c602163db137 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * | | QTestLib: Introduce initMain() to run in main before qApp existsFriedemann Kleint2019-08-132-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running Qt autotests on a developer machine with a high resolution, failures occur due to either some widget becoming too small, some rounding fuzz appearing when Qt High DPI scaling is active, or some test taking screenshots failing to deal with device pixel ratios != 1 in the obtained pixmaps. It is not feasible to adapt all tests to pass on high resolution monitors in both modes (Qt High DPI scaling enabled/disabled). It should be possible to specify the High DPI setting per test. Previously, it was not possible to set the Qt High DPI scaling attributes since they must be applied before QApplication instantiation. Enable this by checking for the presence of a static void initMain() function on the test object and invoking it before QApplication instantiation. Prototypically use it in tst_qtimer and to turn off High DPI scaling for tst_QGL. [ChangeLog][QtTestLib] It is now possible to perform static initialization before QApplication instantiation by implementing a initMain() function in the test class. Change-Id: Idec0134b189710a14c41a451fa8445bc0c5b1cf3 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * | | Introduce QSignalSpy constructor allows to spy on a meta methodVitaly Fanaskov2019-08-133-0/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * | | QSignalSpy: Extract object validation to a separate methodVitaly Fanaskov2019-08-131-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I167a01257cfdb679cb81861bfae26d8fa40f8c27 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | * | | QSignalSpy: Extract meta signal validation to the separate methodVitaly Fanaskov2019-08-131-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I37a74ea4487a437646815d3117ec8b0fd7073205 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | * | | QSignalSpy: Extract connection functionality into a separate methodVitaly Fanaskov2019-08-131-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ie6406c79b070cba715250711578cd3d80c089559 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | | | Regenerate qtbase/src projectsAlexandru Croitor2019-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To get less diffs for next merges and pro2cmake changes. Change-Id: I7fb5ff34bb884072a9964e8e3488c69f4290fca2 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | | Fix add_qt_docs callsSimon Hausmann2019-09-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Brown paper bag for me, don't use a comma to separate parameters when calling a function. Change-Id: I21e16142fab4fd1c2714df13cd6a892b036e899a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | | | Re-generate main module CMake filesSimon Hausmann2019-09-182-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the calls to add_qt_docs to include the target. Change-Id: I2c4c807bca8faa48bb49f4b8710035f21abfca0e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | | | Regenerate src/testlibAlexandru Croitor2019-09-112-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ia0208ebffc2ad9c87595533d6c09d3f4f068613d Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | | Merge branch 'wip/qt6' into wip/cmakeAlexandru Croitor2019-08-1536-250/+463
|\| | | | | | | | | | | | | | | | | | | Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
| * | | | Merge remote-tracking branch 'origin/dev' into wip/qt6Lars Knoll2019-08-0636-250/+463
| |\| | | | | | | | | | | | | | | | | | Change-Id: Ib719a6249069e6bd6c9311bbec7f364855ab82ff
| | * | | QTest: add toString(QBitArray)Thiago Macieira2019-08-051-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ife213d861bb14c1787e1fffd15b70598cda8baf3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * | | QTestLib: Speed up QCOMPARE for QStringFriedemann Kleint2019-08-014-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add overloads for qCompare() for QStringView making use of the fast formatting helper introduced by 94aa350621e8a5c4ad3b438c10fc1c0a9ed3bc8a for int. Speeds up the bug report example by a factor of 3..4. Task-number: QTBUG-38890 Change-Id: Icc706618b2f1d23b37d354a04d4e1d1cc4b5aee3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * | | QTestLib: Fix various clang warningsFriedemann Kleint2019-07-298-36/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix else after return/break - Fix use of int as boolean literal - Use range-based for in some cases - Avoid copies by using const-ref - Remove unnecessary null-check before delete Task-number: QTBUG-69413 Change-Id: I69f46e6deaa55ef70a8b3a61e6539c79a64aaa23 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * | | Port from QStringViewLiteral to u""Marc Mutz2019-07-291-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that all our supported compilers know char16_t, we no longer need QStringViewLiteral, whose only purpose in life was to turn u"" into L"" for MSVC < 2015. Change-Id: I25a094fe7992d9d5dbeb4a524d9e99e043dcb8ce Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| | * | | QTestLib: Fix class declarations/structureFriedemann Kleint2019-07-1110-34/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove virtual from functions declared as override - Use " = default" for trivial constructors/destructors - Remove all special functions from QTestLog Apply Fixits by Qt Creator with some amendments. Task-number: QTBUG-69413 Change-Id: I812b8116e5b4c927e4e5cee44e63bc705385d866 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| | * | | QTestLib: Introduce nullptrFriedemann Kleint2019-07-1112-62/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply Fixits by Qt Creator with some amendments. Task-number: QTBUG-69413 Change-Id: I620e40a277dc2b20b0ec26fc32577e66b0456bb3 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| | * | | QTestLib: Use member initializationFriedemann Kleint2019-07-1118-94/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apply Fixits by Qt Creator with some amendments. Task-number: QTBUG-69413 Change-Id: Iba0834dc89cbfc215acc5873f31fa6eeed74177d Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
| | * | | Fix testlib build without features.propertiesTasuku Suzuki2019-07-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I3ca7f8cdb59a9a1e61d2702e92cd5e2d1420ac84 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Jason McDonald <macadder1@gmail.com>
| | * | | QTestLib: Speed up QCOMPARE for float, double, int, unsignedFriedemann Kleint2019-07-094-22/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out a helper template formatting the QCOMPARE failure message delaying the formatting of the parameters with toString() and use that for float, double, int and unsigned. This removes the need to always format and allocate strings for the operands even in the success case, speeding up the QColor test from 3.3s to 700ms (Windows/release). Task-number: QTBUG-38890 Change-Id: I999484765bdaed921d3fc35f35a9fbbcd82a9704 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * | | QTestlib: Check compared images for device pixel ratioFriedemann Kleint2019-07-091-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When accidentally running a test doing screen-grabbing with High DPI scaling active, sizes of the obtained pixmaps can differ due to the device pixel ratio. Add a check to make that clearer. [ChangeLog][QtTestLib] Comparison of QImage, QPixmap now checks for the device pixel ratio. Change-Id: Id8d5187e99c565c44a7bfb8b9cfb09737815fb15 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | | Fix mapping of Apple platforms in pro2cmake.pyAlexandru Croitor2019-07-232-6/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "mac" scope in qmake actually means all mac platforms, just like "darwin", aka macOS, iOS, watchOS, etc. Regenerate corelib, gui and testlib after this modification. This is a requirement for the iOS port. Change-Id: I029c7e907d13f6ec31816a08602a5930f9ac16a7 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
* | | | | Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-07-1110-18/+56
|\| | | | | | | | | | | | | | | | | | | Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
| * | | | Merge remote-tracking branch 'origin/dev' into wip/qt6Alexandru Croitor2019-07-088-12/+18
| |\| | | | | | | | | | | | | | | | | | Change-Id: I02cbc4f77a82100b96cdb90c160ce0207f180d7f