qt5base-lts/tests
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
..
auto QFileSystemWatcher: lock autotest code away into a cold section 2019-05-21 12:58:27 +02:00
baselineserver QRegExp include cleanup 2019-04-19 21:21:17 +00:00
benchmarks QtCore: mark obsolete enumerations as deprecated 2019-05-17 14:08:30 +00:00
global tst_bic: Add linux-gcc-ia32 bic data for QtXml 2013-01-16 08:25:28 +01:00
libfuzzer Improve project files of libfuzzer tests 2019-03-13 11:18:40 +00:00
manual QtCore: mark obsolete enumerations as deprecated 2019-05-17 14:08:30 +00:00
shared tst_qfileinfo: Refactor ntfsJunctionPointsAndSymlinks() 2018-09-30 09:59:09 +00:00
testserver Fix the timing issue of QFtp tests when using Docker servers 2019-05-15 06:10:01 +00:00
README Doc: Fix references to Qt Test 2013-01-30 01:35:06 +01:00
tests.pro Build examples and tests only if their requirements are met 2017-03-22 15:55:55 +00:00

This directory contains autotests and benchmarks based on Qt Test. In order
to run the autotests reliably, you need to configure a desktop to match the
test environment that these tests are written for.

Linux X11:

   * The user must be logged in to an active desktop; you can't run the
     autotests without a valid DISPLAY that allows X11 connections.

   * The tests are run against a KDE3 or KDE4 desktop.

   * Window manager uses "click to focus", and not "focus follows mouse". Many
     tests move the mouse cursor around and expect this to not affect focus
     and activation.

   * Disable "click to activate", i.e., when a window is opened, the window
     manager should automatically activate it (give it input focus) and not
     wait for the user to click the window.