summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qprocess
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2017-04-19 11:51:24 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2017-04-23 18:10:50 +0000
commitb137734e6b67dc6b9615c1d200e9f9c5a3b8fee7 (patch)
tree815cd8e82c27939e31756770c6ecc485214eef2c /tests/auto/corelib/io/qprocess
parent3cb4bbfc2644724cfcc0267b84f8979ceb7b08e6 (diff)
Support setCreateProcessArgumentsModifier in QProcess:startDetached
Factor out both CreateProcess calls into one function that also calls the modifier callback for the CreateProcessArguments struct. Task-number: QTBUG-57687 Change-Id: I9d2ef4f2d7cd077aa4c3eba926ab4dfb9e570291 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/io/qprocess')
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
index 5cd1ad5a8b..f8268f5991 100644
--- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
+++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
@@ -2049,6 +2049,11 @@ void tst_QProcess::detachedProcessParameters()
QProcess process;
process.setProgram(QDir::currentPath() + QLatin1String("/testDetached/testDetached"));
+#ifdef Q_OS_WIN
+ int modifierCalls = 0;
+ process.setCreateProcessArgumentsModifier(
+ [&modifierCalls] (QProcess::CreateProcessArguments *) { modifierCalls++; });
+#endif
process.setArguments(QStringList(infoFile.fileName()));
process.setWorkingDirectory(workingDir);
process.setProcessEnvironment(environment);
@@ -2076,6 +2081,9 @@ void tst_QProcess::detachedProcessParameters()
QCOMPARE(actualWorkingDir, workingDir);
QCOMPARE(actualPid, pid);
QCOMPARE(actualEnvVarValue, envVarValue);
+#ifdef Q_OS_WIN
+ QCOMPARE(modifierCalls, 1);
+#endif
}
void tst_QProcess::switchReadChannels()