qt5base-lts/tests
Ievgenii Meshcheriakov 5fc9c02a69 QProcess: Distinguish between null and empty QProcessEnvironment
The documentation for QProcessEnvironment's default constructor
says:

    This constructor creates an empty environment. If set on a
    QProcess, this will cause the current environment variables
    to be removed.

This is not the case however, because setting such an environment
for a process is equivalent to not setting an environment at all
and the child process is executed with parent's environment.

It is still possible starting from Qt 6.2.0 to create an empty
environment by adding a variable to a null environment and removing
it, but that's cumbersome, and the comparison operator says that
it is equal to the null environment but it is obviously behaving in
a different way.

This change adds an additional constructor to QProcessEnvironment
that can be used to construct a null environment, and changes the
default constructor to produce an empty environment. The comparison
operator is changed to correctly distinguish between such objects.
This is a behavior change, but the current behavior is broken
and this is unlikely to affect working code.

[ChangeLog][QtCore][QProcessEnvironment] An additional constructor
was added to explicitly create an object that when set on QProcess
would cause it to inherit the environment from parent (this was
formerly the behavior of a default-constructed QProcessEnvironment,
which will now (as documented) actually give a process an environment
with no variables set). A new method inheritsFromParent() was added
to test for such objects.

Fixes: QTBUG-58053
Change-Id: I15e20c6a5f01ebe2c736d5578c75dba1ee319320
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-11-07 01:53:44 +01:00
..
auto QProcess: Distinguish between null and empty QProcessEnvironment 2021-11-07 01:53:44 +01:00
baselineserver Remove fatuously true or false QT_VERSION checks 2021-09-23 16:57:03 +02:00
benchmarks Remove checks for C++ standard versions C++17 and below 2021-10-01 02:46:09 +02:00
global
libfuzzer CMake: Bump almost all cmake_minimum_required calls to 3.16 2021-09-22 19:36:49 +02:00
manual QNI manual test: Remove unnecessary capturing and wrapping 2021-11-04 12:02:34 +01:00
shared locale: INTEGRITY does not define LC_MEASUREMENTS 2021-09-21 17:56:54 +00:00
testserver Network self-test: make it work with docker/containers 2020-11-17 19:56:06 +01:00
CMakeLists.txt CMake: Refactor optimization flag handling and add optimize_full 2020-10-06 10:07:05 +02:00
README

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.