process = new QProcess;
connect(process, SIGNAL(readyRead()), this, SLOT(exitLoopSlot()));
-#ifdef Q_OS_MAC
- process->start("testProcessEcho/testProcessEcho.app");
-#else
process->start("testProcessEcho/testProcessEcho");
-#endif
QVERIFY(process->waitForStarted(5000));
process->write(input);
process = new QProcess;
connect(process, SIGNAL(readyRead()), this, SLOT(exitLoopSlot()));
-#ifdef Q_OS_MAC
- process->start("testProcessEcho2/testProcessEcho2.app");
-#else
process->start("testProcessEcho2/testProcessEcho2");
-#endif
QVERIFY(process->waitForStarted(5000));
QVERIFY(!process->waitForReadyRead(250));
QCOMPARE(process->error(), QProcess::Timedout);
#endif
QProcess process;
-#ifdef Q_OS_MAC
- process.start("testProcessLoopback/testProcessLoopback.app");
-#else
process.start("testProcessLoopback/testProcessLoopback");
-#endif
QByteArray array;
array.resize(1024 * 1024);
#endif
process = new QProcess;
-#ifdef Q_OS_MAC
- process->start("testProcessEcho/testProcessEcho.app");
-#else
process->start("testProcessEcho/testProcessEcho");
-#endif
QVERIFY(process->waitForStarted(5000));
for (int i = 0; i < 100; ++i) {
#endif
process = new QProcess;
-#ifdef Q_OS_MAC
- process->start("testProcessEcho/testProcessEcho.app");
-#else
process->start("testProcessEcho/testProcessEcho");
-#endif
if (process->state() != QProcess::Starting)
QCOMPARE(process->state(), QProcess::Running);
{
QProcess process;
-#ifdef Q_OS_MAC
- process.start("testProcessOutput/testProcessOutput.app");
-#else
process.start("testProcessOutput/testProcessOutput");
-#endif
#if !defined(Q_OS_WINCE)
QVERIFY(process.waitForFinished(5000));
QProcess process;
-#ifdef Q_OS_MAC
- process.start("testProcessDeadWhileReading/testProcessDeadWhileReading.app");
-#else
process.start("testProcessDeadWhileReading/testProcessDeadWhileReading");
-#endif
QString output;
process = &proc;
connect(process, SIGNAL(finished(int)), this, SLOT(restartProcess()));
-#ifdef Q_OS_MAC
- process->start("testProcessEcho/testProcessEcho.app");
-#else
process->start("testProcessEcho/testProcessEcho");
-#endif
QCOMPARE(process->write("", 1), qlonglong(1));
QVERIFY(process->waitForFinished(5000));
void tst_QProcess::restartProcess()
{
-#ifdef Q_OS_MAC
- process->start("testProcessEcho/testProcessEcho.app");
-#else
process->start("testProcessEcho/testProcessEcho");
-#endif
}
//-----------------------------------------------------------------------------
QProcess::ProcessChannel channel2 = QProcess::StandardError;
QProcess proc;
-#ifdef Q_OS_MAC
- proc.start("testProcessEcho2/testProcessEcho2.app");
-#else
proc.start("testProcessEcho2/testProcessEcho2");
-#endif
QVERIFY(proc.waitForStarted(5000));
proc.closeReadChannel(i&1 ? channel2 : channel1);
proc.setReadChannel(i&1 ? channel2 : channel1);
QProcess proc;
QVERIFY(!proc.isOpen());
QVERIFY(proc.openMode() == QProcess::NotOpen);
-#ifdef Q_OS_MAC
- proc.start("testProcessEcho3/testProcessEcho3.app");
-#else
proc.start("testProcessEcho3/testProcessEcho3");
-#endif
QVERIFY(proc.waitForStarted(5000));
QVERIFY(proc.isOpen());
QVERIFY(proc.openMode() == QProcess::ReadWrite);
QSignalSpy spy(&proc, SIGNAL(readyRead()));
QVERIFY(spy.isValid());
-#ifdef Q_OS_MAC
- proc.start("testProcessEcho/testProcessEcho.app");
-#else
proc.start("testProcessEcho/testProcessEcho");
-#endif
QCOMPARE(spy.count(), 0);
{
QProcess proc;
-#if defined(Q_OS_MAC)
- proc.start("testProcessEcho/testProcessEcho.app");
-#elif defined(Q_OS_WINCE)
+#if defined(Q_OS_WINCE)
proc.start("testSoftExit/testSoftExit");
#else
proc.start("testProcessEcho/testProcessEcho");
{
QTest::addColumn<QString>("appName");
-#ifdef Q_OS_MAC
- QTest::newRow("gui app") << "testGuiProcess/testGuiProcess.app";
-#else
QTest::newRow("gui app") << "testGuiProcess/testGuiProcess";
-#endif
-#ifdef Q_OS_MAC
- QTest::newRow("console app") << "testProcessEcho2/testProcessEcho2.app";
-#else
QTest::newRow("console app") << "testProcessEcho2/testProcessEcho2";
-#endif
}
//-----------------------------------------------------------------------------
process.setReadChannelMode(QProcess::MergedChannels);
QCOMPARE(process.readChannelMode(), QProcess::MergedChannels);
-#ifdef Q_OS_MAC
- process.start("testProcessEcho2/testProcessEcho2.app");
-#else
process.start("testProcessEcho2/testProcessEcho2");
-#endif
QVERIFY(process.waitForStarted(5000));
process.setReadChannelMode(QProcess::ForwardedChannels);
QCOMPARE(process.readChannelMode(), QProcess::ForwardedChannels);
-#ifdef Q_OS_MAC
- process.start("testProcessEcho2/testProcessEcho2.app");
-#else
process.start("testProcessEcho2/testProcessEcho2");
-#endif
QVERIFY(process.waitForStarted(5000));
QCOMPARE(process.write("forwarded\n"), qlonglong(10));
QProcess process;
-#ifdef Q_OS_MAC
- process.start("testProcessEcho/testProcessEcho.app");
-#else
process.start("testProcessEcho/testProcessEcho");
-#endif
process.write("abcdefgh\n");
while (process.bytesAvailable() < 8)
connect(&process, SIGNAL(finished(int)), this, SLOT(catchExitCode(int)),
Qt::DirectConnection);
-#ifdef Q_OS_MAC
- process.start("testProcessEcho/testProcessEcho.app");
-#else
process.start("testProcessEcho/testProcessEcho");
-#endif
#if !defined(Q_OS_WINCE)
QCOMPARE(process.write("abc\0", 4), qint64(4));
process = new QProcess(this);
-#ifdef Q_OS_MAC
- process->start("testProcessEcho/testProcessEcho.app");
-#else
process->start("testProcessEcho/testProcessEcho");
-#endif
QVERIFY(process->waitForStarted(5000));
QVERIFY(!process->waitForFinished(1));
connect(process, SIGNAL(finished(int)), this, SLOT(exitLoopSlot()));
bytesAvailable = 0;
-#ifdef Q_OS_MAC
- process->start("testProcessEcho/testProcessEcho.app");
-#else
process->start("testProcessEcho/testProcessEcho");
-#endif
QVERIFY(process->waitForStarted(5000));
QSignalSpy spy(process, SIGNAL(readyRead()));
connect(process, SIGNAL(bytesWritten(qint64)), this, SLOT(waitForBytesWrittenInABytesWrittenSlotSlot()));
bytesAvailable = 0;
-#ifdef Q_OS_MAC
- process->start("testProcessEcho/testProcessEcho.app");
-#else
process->start("testProcessEcho/testProcessEcho");
-#endif
QVERIFY(process->waitForStarted(5000));
qRegisterMetaType<qint64>("qint64");
QVERIFY(file.open(QFile::WriteOnly));
QProcess process;
-#ifdef Q_OS_MAC
- process.start("testProcessEcho/testProcessEcho.app");
-#else
process.start("testProcessEcho/testProcessEcho");
-#endif
QVERIFY(process.waitForStarted(5000));
QProcess process;
-#ifdef Q_OS_MAC
- process.start("testProcessEcho/testProcessEcho.app");
-#else
process.start("testProcessEcho/testProcessEcho");
-#endif
process.write("Foo\nBar\nBaz\nBodukon\nHadukan\nTorwukan\nend\n");
process.putChar('\0');
QVERIFY(process.waitForFinished());
file.close();
process.setStandardInputFile("data");
-#ifdef Q_OS_MAC
- process.start("testProcessEcho/testProcessEcho.app");
-#else
process.start("testProcessEcho/testProcessEcho");
-#endif
QPROCESS_VERIFY(process, waitForFinished());
QByteArray all = process.readAll();
else
process.setStandardErrorFile("data", mode);
-#ifdef Q_OS_MAC
- process.start("testProcessEcho2/testProcessEcho2.app");
-#else
process.start("testProcessEcho2/testProcessEcho2");
-#endif
process.write(testdata, sizeof testdata);
QPROCESS_VERIFY(process,waitForFinished());
source.setReadChannelMode(merged ? QProcess::MergedChannels : QProcess::SeparateChannels);
source.setStandardOutputProcess(&sink);
-#ifdef Q_OS_MAC
- source.start("testProcessEcho2/testProcessEcho2.app");
- sink.start("testProcessEcho2/testProcessEcho2.app");
-#else
source.start("testProcessEcho2/testProcessEcho2");
sink.start("testProcessEcho2/testProcessEcho2");
-#endif
QByteArray data("Hello, World");
source.write(data);
QProcess process;
-#ifdef Q_OS_MAC
- process.start("testProcessEcho2/testProcessEcho2.app");
-#else
process.start("testProcessEcho2/testProcessEcho2");
-#endif
process.write(data);
process.closeWriteChannel();
QVERIFY(process.waitForFinished(5000));
#endif
process = new QProcess;
process->setWorkingDirectory("test");
-#ifdef Q_OS_MAC
- process->start("testSetWorkingDirectory/testSetWorkingDirectory.app");
-#else
process->start("testSetWorkingDirectory/testSetWorkingDirectory");
-#endif
#ifndef Q_OS_WIN
QSKIP("setWorkingDirectory will chdir before starting the process on unices");
#endif
for (int i = 0; i < 3; ++i) {
QCOMPARE(process.state(), QProcess::NotRunning);
-#ifdef Q_OS_MAC
- process.start("testProcessOutput/testProcessOutput.app");
-#else
process.start("testProcessOutput/testProcessOutput");
-#endif
#if !defined(Q_OS_WINCE)
QVERIFY(process.waitForReadyRead(10000));
QCOMPARE(QString::fromLatin1(process.readLine().trimmed()),