diff options
author | Joerg Bornemann <joerg.bornemann@digia.com> | 2012-10-08 09:13:16 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2012-10-08 12:03:30 +0200 |
commit | ea418c9277cf86e80e81a2ce0f02654f2bef88eb (patch) | |
tree | feb725982727be2b2a9d2ef55ecc99a351c385d7 /tests | |
parent | 0d7a4011bd0801e28ccb11890559fe594c96440d (diff) |
normalize autotest executables
All autotest executable names start with "tst_".
Every autotest executable is its own subdir.
Change-Id: Id5b10792930064acd4e741c207d0046f54a55695
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/blackbox/blackbox.pro | 3 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 15 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.h | 2 | ||||
-rw-r--r-- | tests/auto/tools/tools.pro | 2 |
4 files changed, 17 insertions, 5 deletions
diff --git a/tests/auto/blackbox/blackbox.pro b/tests/auto/blackbox/blackbox.pro index 2f0927290..63fdd45e8 100644 --- a/tests/auto/blackbox/blackbox.pro +++ b/tests/auto/blackbox/blackbox.pro @@ -1,7 +1,6 @@ TEMPLATE = app -TARGET = testBlackbox +TARGET = tst_blackbox DEPENDPATH += . -DESTDIR = ../../../bin/ INCLUDEPATH += . ../../../src/lib/ DEFINES += SRCDIR=\\\"$$PWD/\\\" diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 6aad74534..907a3ad48 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -38,12 +38,24 @@ #include "tst_blackbox.h" #include <tools/hostosinfo.h> + +static QString initQbsExecutableFilePath() +{ + QString filePath = QCoreApplication::applicationDirPath() + QLatin1String("/../../../"); + if (qbs::HostOsInfo::isWindowsHost()) + filePath += QLatin1String("../"); + filePath += "bin/qbs"; + filePath = qbs::HostOsInfo::appendExecutableSuffix(QDir::cleanPath(filePath)); + return filePath; + +} + TestBlackbox::TestBlackbox() : testDataDir(QCoreApplication::applicationDirPath() + "/testdata"), testSourceDir(QDir::cleanPath(SRCDIR "/testdata")), + qbsExecutableFilePath(initQbsExecutableFilePath()), buildProfile(QLatin1String("qbs_autotests")), buildDir(QLatin1String("build/") + buildProfile + QLatin1String("-debug")), - qbsExecutableFilePath(QCoreApplication::applicationDirPath() + "/qbs"), #ifdef Q_OS_WIN objectSuffix(QLatin1String(".obj")) #else @@ -121,6 +133,7 @@ void TestBlackbox::touch(const QString &fn) void TestBlackbox::initTestCase() { + QVERIFY(QFile::exists(qbsExecutableFilePath)); QProcess process; process.start(qbsExecutableFilePath, QStringList() << "config" << "--global" << "--list"); QVERIFY(process.waitForStarted()); diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h index a4d6c9d1a..37ba3af1d 100644 --- a/tests/auto/blackbox/tst_blackbox.h +++ b/tests/auto/blackbox/tst_blackbox.h @@ -16,9 +16,9 @@ class TestBlackbox : public QObject Q_OBJECT const QString testDataDir; const QString testSourceDir; + const QString qbsExecutableFilePath; const QString buildProfile; const QString buildDir; - const QString qbsExecutableFilePath; const QString objectSuffix; public: diff --git a/tests/auto/tools/tools.pro b/tests/auto/tools/tools.pro index 27cb2cbe9..c5d5e9797 100644 --- a/tests/auto/tools/tools.pro +++ b/tests/auto/tools/tools.pro @@ -1,5 +1,5 @@ TEMPLATE = app -TARGET = testTools +TARGET = tst_tools DEPENDPATH += . INCLUDEPATH += . ../../../src/lib/ DEFINES += SRCDIR=\\\"$$PWD/\\\" |