diff options
author | Joerg Bornemann <joerg.bornemann@digia.com> | 2013-03-21 10:15:28 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2013-03-21 14:07:35 +0100 |
commit | 4d0e80bb4d6b1e50199683e9807027ea2558d094 (patch) | |
tree | 310d77a1c26d271829da4d594c8ee368ea1ddb33 /tests/auto | |
parent | f5c852858906f310f24ebef478be3f3b99d7827d (diff) |
speed up tst_blackbox
Do not copy the whole test data directory for every single test case.
It's enough to remove the build directories in the cases where a test
data subdir is used more than once.
Change-Id: I2c56b5be05cbc09fd33eda759ad77c8480d4d0e3
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 11 | ||||
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.h | 2 |
2 files changed, 3 insertions, 10 deletions
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index f265d1f66..f938981ba 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -162,21 +162,14 @@ void TestBlackbox::initTestCase() qWarning("The build profile '%s' could not be found. Please set it up on your machine.", qPrintable(buildProfile)); QVERIFY(found); -} -void TestBlackbox::init() -{ + // Initialize the test data directory. QVERIFY(testDataDir != testSourceDir); rmDirR(testDataDir); QDir().mkpath(testDataDir); ccp(testSourceDir, testDataDir); } -void TestBlackbox::cleanup() -{ -// rmDirR(testDataDir); -} - void TestBlackbox::build_project_data() { QTest::addColumn<QString>("projectSubDir"); @@ -220,6 +213,7 @@ void TestBlackbox::build_project() projectSubDir.prepend('/'); QVERIFY2(QFile::exists(testDataDir + projectSubDir), qPrintable(testDataDir + projectSubDir)); QDir::setCurrent(testDataDir + projectSubDir); + rmDirR(buildDir); QCOMPARE(runQbs(), 0); QVERIFY2(QFile::exists(productFileName), qPrintable(productFileName)); @@ -243,6 +237,7 @@ void TestBlackbox::build_project_dry_run() projectSubDir.prepend('/'); QVERIFY2(QFile::exists(testDataDir + projectSubDir), qPrintable(testDataDir + projectSubDir)); QDir::setCurrent(testDataDir + projectSubDir); + rmDirR(buildDir); QCOMPARE(runQbs(QStringList() << "-n"), 0); const QStringList &buildDirContents diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h index 5cdf32f31..20c3c4a54 100644 --- a/tests/auto/blackbox/tst_blackbox.h +++ b/tests/auto/blackbox/tst_blackbox.h @@ -59,8 +59,6 @@ protected: public slots: void initTestCase(); - void init(); - void cleanup(); private slots: void build_project_data(); |