Fix tst_process on QNX when using spawn

QNX posix_spawn() implementation actually allows for detecting whether a
non-existent process has failed to start.

Change-Id: Ic1bf8da0d4636f1d7d9b7b4cf6ad45376f6df0ed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Rafael Roquetto 2014-09-12 15:48:06 -03:00 committed by Thiago Macieira
parent bc4b1d7efe
commit 8ca735762d

View File

@ -717,7 +717,7 @@ void tst_QProcess::waitForFinished()
QCOMPARE(output.count("\n"), 10*1024);
process.start("blurdybloop");
#ifdef QPROCESS_USE_SPAWN
#if defined(QPROCESS_USE_SPAWN) && !defined(Q_OS_QNX)
QEXPECT_FAIL("", "QProcess cannot detect failure to start when using posix_spawn()", Abort);
#endif
QVERIFY(!process.waitForFinished());
@ -1540,7 +1540,7 @@ void tst_QProcess::exitCodeTest()
//-----------------------------------------------------------------------------
void tst_QProcess::failToStart()
{
#ifdef QPROCESS_USE_SPAWN
#if defined(QPROCESS_USE_SPAWN) && !defined(Q_OS_QNX)
QSKIP("QProcess cannot detect failure to start when using posix_spawn()");
#endif
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
@ -1610,7 +1610,7 @@ void tst_QProcess::failToStart()
//-----------------------------------------------------------------------------
void tst_QProcess::failToStartWithWait()
{
#ifdef QPROCESS_USE_SPAWN
#if defined(QPROCESS_USE_SPAWN) && !defined(Q_OS_QNX)
QSKIP("QProcess cannot detect failure to start when using posix_spawn()");
#endif
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
@ -1640,7 +1640,7 @@ void tst_QProcess::failToStartWithWait()
//-----------------------------------------------------------------------------
void tst_QProcess::failToStartWithEventLoop()
{
#ifdef QPROCESS_USE_SPAWN
#if defined(QPROCESS_USE_SPAWN) && !defined(Q_OS_QNX)
QSKIP("QProcess cannot detect failure to start when using posix_spawn()");
#endif
qRegisterMetaType<QProcess::ProcessError>("QProcess::ProcessError");
@ -1891,7 +1891,7 @@ void tst_QProcess::waitForReadyReadForNonexistantProcess()
QVERIFY(!process.waitForReadyRead()); // used to crash
process.start("doesntexist");
QVERIFY(!process.waitForReadyRead());
#ifdef QPROCESS_USE_SPAWN
#if defined(QPROCESS_USE_SPAWN) && !defined(Q_OS_QNX)
QEXPECT_FAIL("", "QProcess cannot detect failure to start when using posix_spawn()", Abort);
#endif
QCOMPARE(errorSpy.count(), 1);