summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-07-16 17:46:42 -0700
committerThiago Macieira <thiago.macieira@intel.com>2015-09-21 21:30:58 +0000
commit6d78b7a0c46ea04f4bb771d960e2f7dff1362341 (patch)
tree4d06f7adc878b050c5a8477d3c546bba608da82e /tests/auto/corelib/io
parent16cd053331d21bb1db9197bcbae783f28a1e0c9b (diff)
QProcess: report the syscall that failed in the Unix child process
Prefix the error string message with either "chdir" or the "execvXX"- family function that failed. In order to simplify the process, I also made it transmit local 8-bit data instead of UTF-16 (this also avoids memory allocation with QString). Since there are now two write(2) calls, it's possible for the parent process to be woken up and read(2) only the first. The parent process now needs to wait for EOF. Change-Id: Ib306f8f647014b399b87ffff13f1956199a5aee0 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'tests/auto/corelib/io')
-rw-r--r--tests/auto/corelib/io/qprocess/tst_qprocess.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
index c512794440..de4467d897 100644
--- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
+++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp
@@ -2285,6 +2285,13 @@ void tst_QProcess::setNonExistentWorkingDirectory()
#endif
QCOMPARE(int(process->error()), int(QProcess::FailedToStart));
+#ifdef Q_OS_UNIX
+# ifdef QPROCESS_USE_SPAWN
+ QEXPECT_FAIL("", "QProcess cannot detect failure to start when using posix_spawn()", Continue);
+# endif
+ QVERIFY2(process->errorString().startsWith("chdir:"), process->errorString().toLocal8Bit());
+#endif
+
delete process;
process = 0;
}