Commit Graph

279 Commits

Author SHA1 Message Date
Mårten Nordheim
895a786827 Fix crash when using signaldumper and sender is deleted
Testlib's signaldumper functionality would crash inside
testlib as it dereferenced the sender after it was deleted.

Change-Id: I6013b75b0a121e2768429d8a3cf0339a940314f2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-09-23 08:27:18 +00:00
Qt Forward Merge Bot
104f0535a1 Merge remote-tracking branch 'origin/5.13' into 5.14
Change-Id: Idcf8fc1d79bcd84b494d7f43308e6fe82d60e1a4
2019-09-13 01:00:15 +02:00
Assam Boudjelthia
17032c4d64 Re-add tst_selftests "crashes old stdout txt" on QEMU
The test is not failing anymore on QEMU targets.

This partially reverts commit
71bd06d516.

Fixes: QTBUG-71915
Change-Id: I68593edf0ec245e14879833c8aa90661a3c2e227
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-09-09 11:19:38 +00:00
Friedemann Kleint
ecb6327762 QTestLib: Introduce initMain() to run in main before qApp exists
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>
2019-08-13 19:07:05 +02:00
Vitaly Fanaskov
e8c7124768 Introduce QSignalSpy constructor allows to spy on a meta method
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>
2019-08-13 17:26:18 +02:00
Friedemann Kleint
9c8d1ca18b QTestlib: Check compared images for device pixel ratio
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>
2019-07-09 20:15:34 +02:00
Edward Welbourne
84e89c1e9e Convert uses of QTime as a timer to QElapsedTimer
Change-Id: I2297f61efa5adf9ea5194c7f3ff68574cbcf452c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-06-14 10:42:33 +02:00
Samuel Gaist
5398ce2432 test: migrate QAbstractItemModelTester to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: I23bc9693fb9f553fd63d10687d51322394717ed7
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
2019-06-10 09:32:36 +02:00
Qt Forward Merge Bot
e56d3b03ed Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/corelib/tools/qlocale_data_p.h
        (Regenerated by running the scripts in util/local_database/)
	src/gui/opengl/qopengltextureuploader.cpp

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Allan Sandfeld Jensen <allan.jensen@qt.io>
Change-Id: I12df7f066ed0a25eb109f61c4b8d8dea63b683e2
2019-05-09 13:06:11 +00:00
Konstantin Shegunov
c6bee8e4b2 Fix integer overflows in QDeadlineTimer
If the deadline is far in the future, the conversions to nanoseconds
or internal arithmetic may overflow and give an invalid object, thus
the deadline may end up in the past. Added a test to the testlib
selftest for sleep.

[ChangeLog][QtCore][QDeadlineTimer] Fixed integer overflows
leading to immediate timeouts.

Task-number: QTBUG-69750
Change-Id: I9814eccdf9f9b3add9ca66ec3e27e10cd5ad54a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-08 17:19:44 +00:00
Liang Qi
fbfacd33be Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/android/templates/AndroidManifest.xml
	src/network/ssl/qsslsocket_mac.cpp
	src/widgets/styles/qstylesheetstyle.cpp
	tests/auto/corelib/kernel/qtimer/BLACKLIST
	tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
	tests/auto/testlib/selftests/expected_blacklisted.lightxml
	tests/auto/testlib/selftests/expected_blacklisted.tap
	tests/auto/testlib/selftests/expected_blacklisted.teamcity
	tests/auto/testlib/selftests/expected_blacklisted.txt
	tests/auto/testlib/selftests/expected_blacklisted.xml
	tests/auto/testlib/selftests/expected_blacklisted.xunitxml
	tests/auto/testlib/selftests/expected_float.tap
	tests/auto/testlib/selftests/expected_float.teamcity
	tests/auto/testlib/selftests/expected_float.txt
	tests/auto/testlib/selftests/expected_float.xunitxml

Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: If93cc432a56ae3ac1b6533d0028e4dc497415a52
2019-02-08 12:31:02 +01:00
Edward Welbourne
150c6fb74b Add testlib selftests for double and for non-finite float and double
Tidied up the existing float tests in the process.
(In particular, s/SUCCESS/PASS/ since that matches real test output.)
These verify that QCOMPARE() handles floats and doubles as intended.
Extended the existing qFuzzyCompare tests to probe the boundaries of
the ranges of values of both types, in the process.

Revised the toString<double> that qCompare() uses to give enough
precision to actually show some of the differences being tested there
(12 digits, to match what qFuzzyCompare tests, so as to show different
values rather than, e.g. 1e12 for both expected and actual) and to
give consistent results for infinities and NaN (MinGW had eccentric
versions for these, leading to different output from tests, which thus
failed); did the latter also for toString<float> and fixed stray zeros
in MinGW's exponents (which made a kludge in tst_selftest.cpp
redundant, so I removed that, too).

That's further complicated handling of floating-point types, so let's
just keep an eye on how expensive that's getting by adding a benchmark
test for QTest::toString().  Unfortunately, default settings only get
runs that take modest numbers of milliseconds (some as low as 40)
while increasing this with -minumumvalue 100 or more gets the process
killed - and I'm unable to find out who's doing the killing (it's not
QProcess::kill, ::kill or the QtTest WatchDog, as far as I can tell).
So results are rather noisy; the integral tests exhibit speed-ups by
factors up to 5, and slow-downs by factors up to 100, between runs
with and without this change, which does not affec the integral tests.
The relatively modest slow-downs and speed-ups in the floating point
tests thus seem likely to be happenstance rather than signal.

Change-Id: I4a6bbbab6a43bf14a4089e96238a7c8da2c3127e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-02-06 10:11:22 +00:00
Edward Welbourne
d84912838c Add some missing expected_*.tap files for the testlib selftest
Only for tests that have existing expected_*.* files for other
formats, though.

Change-Id: I34ca1900d88454f300e04d849a608c378009489b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-02-01 14:42:23 +00:00
Edward Welbourne
7dd41b3267 generate_expected_output.py: placate FutureWarning from python
Regexes have long specified that a [ as the first character inside a
[...] is just a literal [, but apparently we need to escape it now, to
avoid a "nested set" FutureWarning.

Change-Id: I76a48c9aafb0684a1d6b0d5284fe9852c9ea0e43
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2019-01-31 12:07:20 +00:00
Oliver Wolff
9906cc57ed testlib: Add BXPASS and BXFAIL
Prioritize blacklisting over QEXPECT_FAIL so that a test that is
blacklisted no longer fails if QEXPECT_FAIL returns true unexpectedly. To
reflect this state properly, the two values of BXPASS and BXFAIL were
added to testlib's output.

[ChangeLog][Important Behavior Changes][QtTestLib] Blacklisting of tests
will be taken into account for XPASS and XFAIL. A blacklisted test that
causes an XPASS will no longer be a fail.

Task-number: QTBUG-72928
Change-Id: Ia2232fdc714d405fa3fd9aea6c89eb2836bc5950
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-01-29 12:18:15 +00:00
Daniel Smith
991c498905 Fix inline ASM to use local labels for jump operations
Non-local ASM labels break for this test when compiled with clang.

Change-Id: I15bd250a991c3b03bbc88459a6358090bd157444
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-25 08:45:54 +00:00
Edward Welbourne
3a5f86d784 Add a feature to enable CodeCoverage analysis of testlib
Based on Asmo Saarela's advice (QTPM-686), adapted on advice from
FrogLogic support and converted to a feature so that the selftest and
testlib qmake config can be co-ordinated.

Task-number: QTPM-1385
Change-Id: Icd706f086009e1e08b3f8c5cd553f792402e28c0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-01-24 15:51:13 +00:00
Edward Welbourne
f3de22b211 Add assorted tests to exercise more QTest functions
Coverage analysis reveals some unexercised code.

Task-number: QTPM-1385
Change-Id: Ib3fdbcf778e7af14ca6dfa1a11bcb4943276de69
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-24 15:51:04 +00:00
Qt Forward Merge Bot
f94ca82e0f Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	.qmake.conf

Change-Id: Ibfcb30053f3aacb8ec2ec480e146538c9bf440ea
2019-01-21 13:03:09 +01:00
Edward Welbourne
a53500f5bf Eliminate some stray misleading paths from expected output files
The output files for the tuplediagnostics selftest of testlib had a
stray non-canoical path fragment in them; so replaced with its
canonical form.

Change-Id: Ib421380036c3fb1b91447eb8c87be4ad0dfe5c96
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-16 18:47:41 +00:00
Edward Welbourne
7c7e007794 Add a testlib selftest for the watchdog
Verify that it does cut in after the specified time has elapsed.

Task-number: QTPM-1385
Change-Id: Ib18e8d6af28339f79cca4d62b869287ce07b8cc1
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-12-06 18:29:47 +00:00
Edward Welbourne
c3e6551d4d generate_expected_output.py: refine environment used for subtests
Match the environment tst_selftests.cpp uses for subtests more
faithfully.  Extends b22e50acda.  In the process, tweak how crashers
are handling, in preparation for the watchdog test.

Change-Id: I09a046460f6f3bff0b12069fad6c1437d89572ce
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-12-06 18:29:35 +00:00
Edward Welbourne
dfcb7fce35 Test that mismatches of datatype in test data columns are rejected
One test for bad data for the column, another for a bad QFETCH.
Incidentally extend blacklist testing by blacklisting them.
Reorganise a QEMU condition that needed extended as part of this.

Task-number: QTPM-1385
Change-Id: Iac72ada19760321c5c9264ddfff7740d1fdd0700
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-12-06 18:29:22 +00:00
Liang Qi
5d5c00c676 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/gui/painting/qdrawhelper.cpp

Change-Id: I4916e07b635e1d3830e9b46ef7914f99bec3098e
2018-12-04 09:58:43 +01:00
Qt Forward Merge Bot
1b5bbacdb0 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: I12bcee17e349edd0dd4fd08da76361d1ffb1a727
2018-11-27 01:00:09 +01:00
Sami Nurmenniemi
71bd06d516 Make developer build tests pass for boot2qt
Some tests were fixed and others were skipped/blacklisted.

Task-number: QTBUG-63152
Change-Id: Ica7df555f8d152ee589865911130525101d4b941
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-11-26 07:06:59 +00:00
Allan Sandfeld Jensen
37f617c405 Add qfloat16 support to QCOMPARE
Change-Id: Ide06f215a888328308a06e7e48edd666f790a5f0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-11-20 21:34:13 +00:00
Qt Forward Merge Bot
0441d959ff Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I5dbdc13c6133e5b03e362c5461b4a599d781bd1e
2018-11-13 01:00:13 +01:00
Tor Arne Vestbø
27fb51fa52 macOS: Remove blacklist entries for no longer supported OS versions
Change-Id: Iae6552f1fdcf1dea07a03d3788d378af9140d1a7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-11-12 07:16:30 +00:00
Christian Ehrlicher
76bb804405 QTreeWidget: mark (is|set)Item(Selected|Hidden|Expanded) as deprecated
QTreeWidget::(is|set)Item(Selected|Hidden|Expanded)() are deprecated
for a long time but not marked as such. Therefore explicitly mark them
as deprecated so they can get removed with Qt6.

Change-Id: Ie4971350de61326811e0788df0d359ed3c442869
Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-09 19:07:51 +00:00
Edward Welbourne
3e36fb641e Test and document QTest::toHexRepresentation()
It's not actually exercised by anything in our source tree, but is
potentially useful and has been part of the documented public API for
some time.  So mention that the caller is responsible for delete[]ing
its return and add a test that exercises it.

Task-number: QTPM-1385
Change-Id: Ifc5284b9eb1b678cf3c9708c681311e874838fc6
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-11-08 15:22:21 +00:00
Christian Ehrlicher
d0f909f8db QTreeView/TableView: explicitly mark sortByColumn(int) as deprecated
QTreeView/TableView::sortByColumn(int) was deprecated a long time ago
but never got removed. Therefore mark it with QT_DEPRECATED_SINCE(5, 13)
so we can remove it with Qt6.
Also sync the handling of the sort order changes in QTableView with the
one from QTreeView.

Change-Id: I0371d9a9c21116edaa9125835827f1a200075d36
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-11-02 05:56:58 +00:00
Edward Welbourne
33d7f76f0e Tweak a selftest blacklist to exercise more of the blacklisting code
In the process, corrected an inaccurate XFAIL message (an XPASS is
normally an error, unless blacklisting ignores it so turns it into a
BPASS). Added the missing .tap file to its expected output.
Documented the similarity to the silent/ selftest.

Task-number: QTPM-1385
Change-Id: Id74a1353d54af2f3bfe2c764e33c1f051958ab21
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-11-01 15:06:43 +00:00
Edward Welbourne
b22e50acda generate_expected_output.py: match tst_selftest's test environments
The testlib selftest sets various things in the environment for
crashing tests; the generator for its expected output should set the
same things, as they affect what output is produced.

Change-Id: Iec2ed59982ea1043582573530c33619d8e8ed08e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-11-01 15:06:08 +00:00
Edward Welbourne
30101884a6 Simplify tst_Selftests::compareLine by handling the trivial case first
If the two lines have identical texts, the comparison returns true.
So don't complicate various other conditions on the way there with
filtering out that case; deal with it first so they don't need to.

Change-Id: Iebd230704ce5f53d12d5afa64aab30f83bb9d407
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-11-01 15:05:59 +00:00
Jüri Valdmann
cea2b5510c Fix building tests with -no-gui
Change-Id: I37307080e5adc334fcfcdd2fee650d675228a746
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-10-20 20:38:59 +00:00
Liang Qi
e3ed2281c0 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/cocoa/qnsview_dragging.mm
	src/plugins/platforms/ios/qiosinputcontext.mm
	src/plugins/platforms/xcb/qxcbconnection.cpp
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/plugins/platforms/xcb/qxcbwindow.cpp
	src/tools/androiddeployqt/main.cpp
		Was moved from qttools into qtbase in 5.11.
		So re-apply 32398e4d here.
	tests/auto/corelib/global/qlogging/test/test.pro
	tests/auto/corelib/global/qlogging/tst_qlogging.cpp
	tests/auto/corelib/io/qfile/tst_qfile.cpp
	tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
	tests/auto/corelib/thread/qthreadstorage/test/test.pro
	tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
	tests/auto/widgets/kernel/qapplication/test/test.pro

Done-with: Gatis Paeglis <gatis.paeglis@qt.io>
Done-with: Mårten Nordheim <marten.nordheim@qt.io>
Done-with: Oliver Wolff <oliver.wolff@qt.io>
Change-Id: Id970486c5315a1718c540f00deb2633533e8fc7b
2018-07-02 11:23:45 +02:00
Liang Qi
c3059391fe Make tests compile for Android
This only enables compilation, it doesn't fix any test.

Qt on Android supports process, but not TEST_HELPER_INSTALLS. See also
acdd57cb for winrt.

android-ndk-r10e is used to compile, see
http://doc-snapshots.qt.io/qt5-5.11/androidgs.html .

corelib/io/{qdir,qresourceengine} need to be fixed later.

Done-with: Frederik Gladhorn <frederik.gladhorn@qt.io>
Done-with: Mårten Nordheim <marten.nordheim@qt.io>
Change-Id: I34b924c8ae5d46d6835b8f0a6606450920f4423b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-06-25 08:01:19 +00:00
Mårten Nordheim
4361c0ee84 findtestdata: test 'relative to test source'-fix
Before the fix is applied this test fails because QFINDTESTDATA will
return "/usr/" instead of the folder with the same name in the current
directory.

The 'usr' folder can't be located 'next to' the application since this
does not trigger the issue (QFINDTESTDATA looks for the folder next
to the executable early on). So we put it in a subdirectory and change
the current working directory to its parent directory.

Change-Id: I627679dcb6f2f6954264e23bfc1a71de3bff7203
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
2018-06-22 13:05:03 +00:00
Samuel Gaist
04b180f7f2 Improve std::tuple handling in tests
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>
2018-06-03 20:26:38 +00:00
Edward Welbourne
fec96d9a9f Remove mention of selftest.qrc from generator script's doc
This supplements b1945604a7, which
removed the qrc file in favor of test/test.pro coding for it.

Change-Id: I15507c89ca14fa6e6b8223de671ffff7092272d0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2018-05-08 12:45:25 +00:00
Mitch Curtis
4c92fce761 Fix order of mouse selftest in selftests.pri
Put it in alphabetical order like the rest of the list.

Change-Id: I3da3bb68d1847f53419bb79490b946c935ebb518
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-05-07 14:53:26 +00:00
Mitch Curtis
630b06f86c Add self-tests for QTest::keyPress() and QTest::keyRelease()
They didn't exist up until now, and future patches rely on them, so
add them.

Change-Id: I8afdb9417263b45d43355c688a813bdf99ea5fc8
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-05-07 14:53:18 +00:00
Edward Welbourne
3ac029f674 Make generated selftest output match for in-source builds
When generate_expected_output.py is run for an in-source build, the
raw output contains no paths to the sources for the script to whittle
down, as it does for shadow builds, to just the path from qtbase down.
So kludge together some extra regexes that can fix that up and tweak
some relevant code to provide them with the data they need.

Change-Id: I656d7126087bd9ad20b2af6835fba314d90a171d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-17 16:22:49 +00:00
Tor Arne Vestbø
f69d32b535 testlib: Ignore line locations from TAP reporter when running selftests
This is what the other reporters also do, in various forms.

Task-number: QTBUG-67351
Change-Id: I16f2c4e0991176145ee0fbcbbfeeda071603a3c2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-27 19:34:04 +00:00
Qt Forward Merge Bot
d58f3c4878 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Icf3b9346117ce7149d8687e4cfa182e7586713f3
2018-03-18 01:00:11 +01:00
Friedemann Kleint
ff1630ab0e Stabilize tst_QSignalSpy::waitFunctionPointer_signalEmittedTooLate()
Replace qWait()/QCOMPARE() by QTRY_COMPARE().

Change-Id: Ic5233e2f26e6663a3fbcbb2edb09a517feef4564
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2018-03-17 12:10:05 +00:00
Qt Forward Merge Bot
8264e495fa Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8b5a10d897a926078895ae41f48cdbd2474902b8
2018-03-15 01:00:11 +01:00
Tor Arne Vestbø
3b42e098ef testlib: Add Test Anything Protocol (TAP) reporter
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>
2018-03-14 14:28:36 +00:00
Tor Arne Vestbø
8864aca9e5 Make testlib selftests pass for shadow-builds
Using QFileInfo to check if the file exists based on the filename
alone ignores the fact that all the expected files are embedded
as QRC resources.

The expectedResult() function already does a similar check, so we
can use that directly instead of checking twice if the file exists.

Task-number: QTBUG-66981
Change-Id: I0beb8d3503ed49682ae7d7e2a5172922fab5420d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-03-14 14:28:34 +00:00