qt5base-lts/tests/auto/corelib/io
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
..
largefile testlib: Deprecate QWARN() in favor of qWarning() 2021-08-04 19:31:51 +02:00
qabstractfileengine QAbstractFileEngine: Remove useless method overrides 2021-11-03 13:42:35 +01:00
qbuffer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qdataurl Remove the qmake project files 2021-01-07 15:32:28 +01:00
qdebug Remove the qmake project files 2021-01-07 15:32:28 +01:00
qdir Make QDir::mkpath() return true when given an existing root path 2021-10-20 15:04:51 +00:00
qdiriterator Remove conditioning on Android embedded 2021-09-17 17:30:14 +02:00
qfile tst_qfile: Remove unused methods 2021-11-03 13:42:36 +01:00
qfileinfo Compile private Qt APIs autotests for INTEGRITY 2021-10-05 20:35:47 +03:00
qfileselector QFileSelector: Preserve path to root directory 2021-07-21 19:37:16 +02:00
qfilesystementry CMake: Remove the usage of QT_SOURCE_TREE from tests 2021-07-12 18:56:14 +02:00
qfilesystemmetadata Remove the qmake project files 2021-01-07 15:32:28 +01:00
qfilesystemwatcher Remove conditioning on Android embedded 2021-09-17 17:30:14 +02:00
qiodevice Remove conditioning on Android embedded 2021-09-17 17:30:14 +02:00
qipaddress Disable security warnings from MSVC in tests 2021-03-17 17:22:00 +01:00
qlockfile Compile autotests for Integrity 2021-09-20 17:29:04 +03:00
qloggingcategory Remove the qmake project files 2021-01-07 15:32:28 +01:00
qloggingregistry Remove conditioning on Android embedded 2021-09-17 17:30:14 +02:00
qnodebug Remove the qmake project files 2021-01-07 15:32:28 +01:00
qprocess Revert "QProcess: do not emit aboutToClose() twice" 2021-09-24 05:57:47 +00:00
qprocess-noapplication Remove the qmake project files 2021-01-07 15:32:28 +01:00
qprocessenvironment QProcess: Distinguish between null and empty QProcessEnvironment 2021-11-07 01:53:44 +01:00
qresourceengine Remove conditioning on Android embedded 2021-09-17 17:30:14 +02:00
qsavefile Compile autotests for Integrity 2021-09-20 17:29:04 +03:00
qsettings Compile autotests for Integrity 2021-09-20 17:29:04 +03:00
qstandardpaths Fix autotest public API compilation for INTEGRITY 2021-10-15 11:00:25 +03:00
qstorageinfo Remove the qmake project files 2021-01-07 15:32:28 +01:00
qtemporarydir Compile autotests for Integrity 2021-09-20 17:29:04 +03:00
qtemporaryfile Compile autotests for Integrity 2021-09-20 17:29:04 +03:00
qurl tst_qurl{,internal}: Use U+FB01 for normalization to ASCII test cases 2021-08-25 00:13:39 +02:00
qurlinternal tst_qurl{,internal}: Use U+FB01 for normalization to ASCII test cases 2021-08-25 00:13:39 +02:00
qurlquery tests: Remove unused SRCDIR defines 2021-08-17 12:41:57 +00:00
qurluts46 Update UCD to Revision 28 2021-10-18 16:45:10 +00:00
CMakeLists.txt Compile autotests for Integrity 2021-09-20 17:29:04 +03:00