# HG changeset patch # User Andre Heinecke # Date 1396453291 0 # Node ID d95fd88f661633cf13769a5ed15fe2ec6cbb7551 # Parent 3ae8b3ab3eab2beac80228193c3966b2341583a1 Prepare cinstprocesstest to be executed on Windows diff -r 3ae8b3ab3eab -r d95fd88f6616 ui/tests/cinstprocesstest.cpp --- a/ui/tests/cinstprocesstest.cpp Wed Apr 02 15:40:39 2014 +0000 +++ b/ui/tests/cinstprocesstest.cpp Wed Apr 02 15:41:31 2014 +0000 @@ -7,11 +7,24 @@ #include #include -#define RELATIVE_CINST_PATH "../../cinst/cinst" +#define CINST_PATH_CANDIDATES "../../cinst/cinst" << \ + "cinst" << "../../cinst/cinst.exe" << "cinst.exe"; -QProcess *CinstProcessTest::startCinstProcess() { +QProcess *CinstProcessTest::startCinstProcess(const QStringList& args) { + QStringList cinstCandidates; + cinstCandidates << CINST_PATH_CANDIDATES; + QString processPath; + foreach (const QString& candidate, cinstCandidates) { + QFileInfo fi(candidate); + if (fi.isExecutable()) { + processPath = candidate; + break; + } + } + QProcess *installerProcess = new QProcess(); - installerProcess->setProgram(RELATIVE_CINST_PATH); + installerProcess->setArguments(args); + installerProcess->setProgram(processPath); installerProcess->start(); installerProcess->waitForStarted(); return installerProcess; diff -r 3ae8b3ab3eab -r d95fd88f6616 ui/tests/cinstprocesstest.h --- a/ui/tests/cinstprocesstest.h Wed Apr 02 15:40:39 2014 +0000 +++ b/ui/tests/cinstprocesstest.h Wed Apr 02 15:41:31 2014 +0000 @@ -6,7 +6,9 @@ */ #include +#include #include +#include #include #include "certificatelist.h" @@ -15,7 +17,10 @@ Q_OBJECT private: - QProcess* startCinstProcess(); + QProcess* startCinstProcess(const QStringList& args = QStringList()); + QTemporaryFile validListFile; + QTemporaryFile otherListFile; + QTemporaryFile invalidListFile; CertificateList validList; CertificateList otherList; CertificateList invalidList; diff -r 3ae8b3ab3eab -r d95fd88f6616 ui/tests/data/testdata.qrc --- a/ui/tests/data/testdata.qrc Wed Apr 02 15:40:39 2014 +0000 +++ b/ui/tests/data/testdata.qrc Wed Apr 02 15:41:31 2014 +0000 @@ -1,6 +1,8 @@ list-valid-signed.txt + list-invalid-signed.txt + list-valid-other-signature.txt