We no longer support macOS 10.11, iOS/tvOS 10, or watchOS 3.
Change-Id: Ide03d8fac06185ef4162ba75ee54a0adf6916905
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Add it to configure.json and replace all occurrences of QT_NO_THREAD
with QT_CONFIG(thread). Add conditions for other features that depend
on thread support. Remove conditions where we can use the QMutex and
QThreadStorage stubs.
Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
QTestEventList refers to QTestEvent, which is an
implementation detail that should not appear in
documentation.
Task-number: QTBUG-68109
Change-Id: Id132889427b757ea17165c8b15ed47bcfb9e1c3f
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Makes it easier to run a test repeatedly until it crashes, and then
attach a debugger.
Change-Id: I8ad5d706becd77a2743a51927c837f3d1da08624
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
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>
The documentation for match() indicates that the index has to be valid
since it determines which column to search in (in addition to "from
which row"). So call match with a valid index, if the model isn't empty.
Change-Id: I5f3754cf14d053bf04d207cefe7dcc938e0f4a5a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
When removing rows, the tester is looking at the data of the row
"just before" and the row "just after" the removed rows, to see if
they are still the same at the end of the removal operation.
Guard this with bounds check, in case there is no row just before
or just after.
This is the opportunity to use modeltester in tst_qidentityproxymodel,
which was already a testcase for removing the only row in a given parent.
Change-Id: Iec8228c16b9c670b794e2665356d153679178494
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
The code (in macros) uses these classes, so the header should ensure
they are defined.
Change-Id: Ic68fa5559b7c0481927b47775b9cb7da12be7979
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Fix warnings about invalid function type casts (return types
conflicting with the FARPROC returned by GetProcAddress()) like:
corelib\global\qoperatingsystemversion_win.cpp💯48: error: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'RtlGetVersionFunction' {aka 'long int (*)(_OSVERSIONINFOW*)'} [-Werror=cast-function-type]
io\qlockfile_win.cpp:158:85: error: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'GetModuleFileNameExFunc' {aka 'long unsigned int (*)(void*, HINSTANCE__*, wchar_t*, long unsigned int)'} [-Werror=cast-function-type]
by introducing nested casts.
Task-number: QTBUG-68742
Task-number: QTQAINFRA-2095
Change-Id: I3a5d2ea901bf5dc35963c589d61cf3dc7393377a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
When cross-compiling for Android on Windows the 'relative to test
source' option could end up possibly matching with a matching folder in
root ('/') because file is a Windows path and the canonicalFilePath of
that path is "".
Fixes tst_qxmlstream (and possibly others) on Android when Qt is
compiled on Windows.
Task-number: QTBUG-68596
Change-Id: I378374e41eea80f43680b3941adaa91fa604934a
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
inLoop is only set, never read and it is private. Since the class is public, it
can't be removed yet, but add a comment so that it will be removed when
possible.
Change-Id: I5e212194cb65626fce2b4c7b68801a73dbe3f500
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Currently when doing comparison with std::tuple the fallback toString
method is called which returns a Q_NULLPTR thus not allowing proper
diagnostic of the values that triggered an error. This patch
adds support for std::tuple to improve the tests output readability.
[ChangeLog][QtTest][QCOMPARE] Now outputs contents of std::tuple on
failure.
Change-Id: I046a55e2ce44c3f7728d51e4745120d38aa5e007
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This patch removes a bad hack for Unity issue described in QTBUG-67757.
The workaround from 243a0660e1 caused
even more problems, see QTBUG-63542.
Besides causing more problems, the usage of this hack was inconsistent.
The goal was to get stable geometry before continuing further in the test
function. The same logic should have been used in qWaitForWindowExposed().
It was never documented that only qWaitForWindowActive() has this tweak.
Also this hack was needed only for Unity, instead being unconditionally
executed for all platforms.
Task-number: QTBUG-67757
Change-Id: I7b7fb4b09151c4ab4807282006d7f956b18f60ad
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
This will make two floating points containing NaN compare as equal,
instead of the regular nan != nan IEEE behavior (which isn't very useful
in a unit-test framework).
Note that this does not apply to indirect comparisons, for example via
QVariant.
Change-Id: I39332e0a867442d58082fffd150851acfdd18c23
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
It depends on QAbstractItemModel, so we need to switch it off if
itemmodel is unavailable.
Change-Id: I97246767a5e387b7a2cee90c34125a8411ef1c4e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This follows the naming convention for global headers and causes
qttestglobal.h to be added to the top of the generated QtTest header. It
is necessary to have it there when other headers depend on features
defined in configure.json.
[ChangeLog][QtTest] The qtest_global.h header is now deprecated. Include
qttestglobal.h instead.
Change-Id: Iaed639d4e13dd99cee6387fce9d15d6e55b0b1e8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This helps to distinguish timeouts from real crashes in COIN.
This is already done for Windows.
Change-Id: I4daeafa36f50482d20cea4bd1106647081ff7abe
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Use QT_CONFIG(regularexpression), disentangle it from QT_BOOTSTRAPPED,
switch it off in the bootstrap build, remove the #ifdefs from
qregularexpression.{h|cpp}, and add QT_REQUIRE_CONFIG(regularexpression)
to the header.
qregularexpression.{h|cpp} are already correctly excluded in tools.pri
if !qtConfig(regularexpression).
Change-Id: I21de154a6a118b76f99003d3acb72ac1e220d302
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Useful for making sense of the event dispatcher, especially when running
tests.
Change-Id: Iea84bcfb40d4954439c2e31ffc0197c64907e800
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The Test Anything Protocol (TAP), was originally Perl's simple text-based
interface between testing modules and test harnesses, but has since been
adopted by a large number of producers and consumers in many different
languages, which allows colorizing and summarizing test results.
The format is very simple:
TAP version 13
ok 1 - test description
not ok 2 - test description
---
message: 'Failure message'
severity: fail
expected: 123
actual: 456
...
ok 3 - test description # SKIP
1..3
The specification [1] is very brief, so the implementation has been
based on how typical consumers behave, especially when it comes to
the undefined diagnostics block.
[1] http://testanything.org/tap-version-13-specification.html
Change-Id: I616e802ea380165c678510e940ddc6607d39c92d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
QtTestLib uses its own message handler for plain text logging, so it doesn't
go though the logic in qDefaultMessageHandler that dispatches logging to
alternate logging sinks.
Building on the approach of Android and Windows, we log to AUL from the
plain text logger. A future improvement in this area would be to make
QtTestLib make more use of the infrastructure in qlogging.cpp, but this
is a bigger task and requires a better overview of the requirements.
The AUL code has been isolated into a wrapper, to allow logging both
to AUl and to e.g. the QPlainTextLogger. This is needed so that we
short circuit the plain text logger in case AUL already has handled
printing to stderr.
Change-Id: Iee0c3902190bd081b7ffbaf77c41b3118ce7f6da
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The privately exported qt_logging_to_console() function has been renamed
to shouldLogToStderr, and exported in the QtPrivate namespace for QtTestLib.
[ChangeLog][Important behavior changes][Logging (including qDebug and
qWarning)] The QT_LOGGING_TO_CONSOLE environment variable has been
deprecated. Use the more specific QT_ASSUME_STDERR_HAS_CONSOLE or
QT_FORCE_STDERR_LOGGING, depending on your usecase.
Change-Id: Ie29228eeac3b700c3de94fee022d5d66d9b5c210
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This reverts commit 2eec3272c7.
The change to qWaitForWindowActive causes regressions
in qtdeclarative, so we need a better fix for the problems
we have with window waiting.
Task-number: QTBUG-66866
Change-Id: I8300dabc870d6aeaa9ba6bfcf3d64146b13c1955
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
After a37785ec76 went in, it become
apparent that multi mouse button state handling in qtestlib is
non-existent, for details see QTBUG-64030 and QTBUG-63786. What
happened behind the scenes often was not what one would expect based
on the provided QTest::mouse* input sequence - events went missing,
incorrect events were generated, each subsequent test function
started with a state set from the function that run earlier. It is
easy to see how a minor change in one test could easily affect outcome
of other tests.
With a37785ec76, Qt platform plugins
are now responsible for sending explicit mouse button type and state
information; qtestlib should take full responsibility now as well.
But using the new API from a37785ec7 alone in qtestlib is not sufficient.
We need to reset mouse state between each new test function run (we do
this at function scope as that fits with the current qtestlib API user
expectations). This patch implements the necessary reseting logic.
Updated tst_qwindow.cpp::generatedMouseMove() to use QTest::mouse* APIs.
That test requires pressing multiple buttons, it was not possible with
QTest::mouse* APIs before this patch.
Added an auto test for multiple mouse button pressing/release in
tests/auto/testlib/selftests/mouse/. And few other tests which are
currently QSKIP-ed, but should be considered when re-designing qtestlib
APIs.
Task-number: QTBUG-64030
Change-Id: I39fdcbc73a467a7463ce2aed622bf22484095635
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Based on the information we got from Unity developers, we need
to check for window's frame geometry to be set, not just window's
position to be set. On various window managers, a window is
'ready' once the frame geometry is set. This fixes autotest
flakiness of tests that use qWaitForWindowActive.
Task-number: QTBUG-66216
Change-Id: Icb664e7b802b474919f3b058c00681574522ccbe
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>