qt5base-lts/tests/auto
Marc Mutz ed19fc0531 QFileSystemWatcher: lock autotest code away into a cold section
The code contained a sizeable chunk of string parsing along with
qDebug()s in the normal path of execution. That code, however, was
only used for Qt's own autotests.

The idea of this patch is, then, to not only move the autotest case
into the cold text section (using Q_UNLIKELY), but also to completely
exclude it, when QT_BUILD_INTERNAL is not set.

Unfortunately, the structure of the function did not really lend
itself to #ifdefing that part of the code out (production code was in
the middle of non-production code), so I transformed the engine
selection code into a lambda, replacing assignment with returns, and
swapping the branches of the central if around to yield a single block
of code that can be excluded from compilation with just one #ifdef.

As a consequence, the runtime code is almost unaffected, and the
function is much easier to read now.

Since the test-specific code is only compiled into Qt now in developer
builds, guard the tests that rely on this behavior with the same macro.

Change-Id: I9fd1c57020a13cef4cd1b1674ed2d3ab9424d7cd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-05-21 12:58:27 +02:00
..
android Updated license headers 2016-01-21 18:55:18 +00:00
bic/data Add binary compatibility files for 5.12 for QtBase 2018-12-21 19:42:57 +00:00
cmake Export modules' enabled/disabled features to cmake 2018-09-28 13:10:28 +00:00
concurrent Remove handling of missing Q_COMPILER_INITIALIZER_LISTS 2019-05-02 23:10:55 +00:00
corelib QFileSystemWatcher: lock autotest code away into a cold section 2019-05-21 12:58:27 +02:00
dbus Merge remote-tracking branch 'origin/5.12' into 5.13 2019-02-19 01:00:08 +01:00
gui Merge remote-tracking branch 'origin/5.13' into dev 2019-05-13 08:04:58 +02:00
guiapplauncher Fix path to examples part of tst_GuiAppLauncher 2015-02-13 07:28:15 +00:00
installed_cmake Add a unit test for testing Qt in its install location. 2013-07-02 23:08:54 +02:00
network Add setAutoDeleteReplies to QNetworkAccessManager 2019-05-15 12:48:07 +00:00
opengl qWaitFor: Prevent being stuck in QCoreApplication::processEvents 2019-01-09 18:10:54 +00:00
other Handle missing enum value in test 2019-05-13 16:39:44 +00:00
printsupport tst_QPrinter: stabilize qprinter test 2019-01-20 13:39:54 +00:00
shared Read font selection flags and use them when querying for metrics 2018-11-30 16:15:03 +00:00
sql QSqlError: fix redundant space in text() output 2019-03-26 06:12:10 +00:00
testlib Merge remote-tracking branch 'origin/5.13' into dev 2019-05-13 08:04:58 +02:00
tools Merge remote-tracking branch 'origin/5.13' into dev 2019-05-15 07:11:41 +02:00
widgets QtCore: mark obsolete enumerations as deprecated 2019-05-17 14:08:30 +00:00
xml Prefix QTextStream operators with Qt:: in tests 2019-05-03 09:36:36 +00:00
auto.pro winrt: Skip network auto tests for now 2018-06-22 05:02:39 +00:00
network-settings.h Port tst_qtcpsocket to the docker server 2019-02-28 15:48:31 +00:00