diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2014-07-24 12:59:14 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-01-23 19:13:27 +0100 |
commit | 75a2c81b0041df4ca59178cf52d9e5a8815f3524 (patch) | |
tree | 3a63d34f62e7872e8ecbbec9233a5eb33886211b /tests/auto/corelib/io/qprocess | |
parent | 1814142b7a11befab315bf3f9d91c4ffbf56ef3e (diff) |
Handle posix_spawn using exit code 127 to indicate fail-to-start
Most posix_spawn implementations are done using fork(), so the only way
to report errors afer fork() is via a special exit code.
Reference: http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html
Change-Id: I3a37f81b0cb278bb31e5cb83c87e6b4c034dbc19
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.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp index 3866dd246b..a67d08da6f 100644 --- a/tests/auto/corelib/io/qprocess/tst_qprocess.cpp +++ b/tests/auto/corelib/io/qprocess/tst_qprocess.cpp @@ -317,9 +317,6 @@ void tst_QProcess::execute() { QCOMPARE(QProcess::execute("testProcessNormal/testProcessNormal", QStringList() << "arg1" << "arg2"), 0); -#ifdef QPROCESS_USE_SPAWN - QEXPECT_FAIL("", "QProcess cannot detect failure to start when using posix_spawn()", Continue); -#endif QCOMPARE(QProcess::execute("nonexistingexe"), -2); } @@ -1527,6 +1524,11 @@ void tst_QProcess::nativeArguments() void tst_QProcess::exitCodeTest() { for (int i = 0; i < 255; ++i) { +#ifdef QPROCESS_USE_SPAWN + // POSIX reserves exit code 127 when using posix_spawn + if (i == 127) + continue; +#endif QProcess process; process.start("testExitCodes/testExitCodes " + QString::number(i)); QVERIFY(process.waitForFinished(5000)); |