forked from qt-creator/qt-creator
Tests: Port manual/process to QtcProcess
Change-Id: I50d489e47f61927745f63b37dae3e3567355414f Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -25,7 +25,8 @@
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include <utils/synchronousprocess.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QTimer>
|
||||
@@ -47,15 +48,16 @@ static int testSynchronous(const QString &cmd, const QStringList &args)
|
||||
{
|
||||
std::fprintf(stdout, "testSynchronous %s %s\n", qPrintable(cmd),
|
||||
qPrintable(args.join(QLatin1Char(' '))));
|
||||
QProcess p;
|
||||
p.start(cmd, args);
|
||||
Utils::QtcProcess p;
|
||||
p.setCommand({cmd, args});
|
||||
p.start();
|
||||
if (!p.waitForStarted())
|
||||
return -2;
|
||||
p.closeWriteChannel();
|
||||
|
||||
QByteArray stdOut;
|
||||
QByteArray stdErr;
|
||||
if (!Utils::SynchronousProcess::readDataFromProcess(p, 2, &stdOut, &stdErr)) {
|
||||
if (!p.readDataFromProcess(2, &stdOut, &stdErr, false)) {
|
||||
std::fputs("Timeout", stderr);
|
||||
return -3;
|
||||
}
|
||||
|
Reference in New Issue
Block a user