summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools/rcc
diff options
context:
space:
mode:
authorhjk <hjk121@nokiamail.com>2013-08-13 15:26:48 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-13 17:24:49 +0200
commit3c2c9649eb7b966cfc2727fd309cf6d928c43f8c (patch)
tree8bc3111175a037b2a812491e34fd4aa19b673a70 /tests/auto/tools/rcc
parent90cdac061783eb2ffd68615016c883ea958c497c (diff)
RCC: Make auto-test pick up the right binary
Change-Id: I30f42d40c69789eb1e292ab6bd1cf2c09d81b11b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'tests/auto/tools/rcc')
-rw-r--r--tests/auto/tools/rcc/tst_rcc.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/auto/tools/rcc/tst_rcc.cpp b/tests/auto/tools/rcc/tst_rcc.cpp
index d9ceb6ff6f..4089d53f3d 100644
--- a/tests/auto/tools/rcc/tst_rcc.cpp
+++ b/tests/auto/tools/rcc/tst_rcc.cpp
@@ -70,6 +70,9 @@ private slots:
void binary();
void cleanupTestCase();
+
+private:
+ QString m_rcc;
};
void tst_rcc::initTestCase()
@@ -77,6 +80,7 @@ void tst_rcc::initTestCase()
// rcc uses a QHash to store files in the resource system.
// we must force a certain hash order when testing or tst_rcc will fail, see QTBUG-25078
QVERIFY(qputenv("QT_RCC_TEST", "1"));
+ m_rcc = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/rcc");
}
QString findExpectedFile(const QString &base)
@@ -145,13 +149,12 @@ void tst_rcc::rcc()
}
// Launch
- const QString command = QLatin1String("rcc");
QProcess process;
- process.start(command, QStringList(qrcfile));
+ process.start(m_rcc, QStringList(qrcfile));
if (!process.waitForFinished()) {
const QString path = QString::fromLocal8Bit(qgetenv("PATH"));
QString message = QString::fromLatin1("'%1' could not be found when run from '%2'. Path: '%3' ").
- arg(command, QDir::currentPath(), path);
+ arg(m_rcc, QDir::currentPath(), path);
QFAIL(qPrintable(message));
}
const QChar cr = QLatin1Char('\r');
@@ -176,13 +179,14 @@ void tst_rcc::rcc()
-static void createRccBinaryData(const QString &baseDir, const QString &qrcFileName, const QString &rccFileName)
+static void createRccBinaryData(const QString &rcc, const QString &baseDir,
+ const QString &qrcFileName, const QString &rccFileName)
{
QString currentDir = QDir::currentPath();
QDir::setCurrent(baseDir);
QProcess rccProcess;
- rccProcess.start("rcc", QStringList() << "-binary" << "-o" << rccFileName << qrcFileName);
+ rccProcess.start(rcc, QStringList() << "-binary" << "-o" << rccFileName << qrcFileName);
bool ok = rccProcess.waitForFinished();
if (!ok) {
QString errorString = QString::fromLatin1("Could not start rcc (is it in PATH?): %1").arg(rccProcess.errorString());
@@ -262,7 +266,7 @@ void tst_rcc::binary_data()
QFileInfo qrcFileInfo = iter.fileInfo();
QString absoluteBaseName = QFileInfo(qrcFileInfo.absolutePath(), qrcFileInfo.baseName()).absoluteFilePath();
QString rccFileName = absoluteBaseName + QLatin1String(".rcc");
- createRccBinaryData(dataPath, qrcFileInfo.absoluteFilePath(), rccFileName);
+ createRccBinaryData(m_rcc, dataPath, qrcFileInfo.absoluteFilePath(), rccFileName);
QString localeFileName = absoluteBaseName + QLatin1String(".locale");
QFile localeFile(localeFileName);