diff options
author | Joerg Bornemann <joerg.bornemann@digia.com> | 2014-08-06 15:08:28 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@digia.com> | 2014-08-06 15:48:26 +0200 |
commit | 3871bb116d893c5bd405c32217aceaf8824d9bbc (patch) | |
tree | 1f20e5647b54b24bfe9f0c171fb3c70b5e35f4b5 /tests/auto/blackbox/tst_blackbox.cpp | |
parent | c6ee3922806999e0b22ece745cde88630e1ec67f (diff) |
enhance TestBlackbox::changedFiles
It makes a difference whether we start from an initial build with
or without the --changed-files option. An initial build without
the --changed-files options followed by an incremental build with
--changed-files unveils QBS-660.
Task-number: QBS-660
Change-Id: Iee8466dd203bed01cf053c8eb78d7b960f20a035
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'tests/auto/blackbox/tst_blackbox.cpp')
-rw-r--r-- | tests/auto/blackbox/tst_blackbox.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 7c5ce29f0..452e7759b 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -384,23 +384,40 @@ void TestBlackbox::changeDependentLib() QCOMPARE(runQbs(), 0); } +void TestBlackbox::changedFiles_data() +{ + QTest::addColumn<bool>("useChangedFilesForInitialBuild"); + QTest::newRow("initial build with changed files") << true; + QTest::newRow("initial build without changed files") << false; +} + void TestBlackbox::changedFiles() { + QFETCH(bool, useChangedFilesForInitialBuild); + QDir::setCurrent(testDataDir + "/changed-files"); + rmDirR(buildDir); const QString changedFile = QDir::cleanPath(QDir::currentPath() + "/file1.cpp"); - QbsRunParameters params(QStringList("--changed-files") << changedFile); + QbsRunParameters params1; + if (useChangedFilesForInitialBuild) + params1 = QbsRunParameters(QStringList("--changed-files") << changedFile); - // Initial run: Build all files, even though only one of them was marked as changed. - QCOMPARE(runQbs(params), 0); + // Initial run: Build all files, even though only one of them was marked as changed + // (if --changed-files was used). + QCOMPARE(runQbs(params1), 0); QCOMPARE(m_qbsStdout.count("compiling"), 3); + QCOMPARE(m_qbsStdout.count("creating"), 3); waitForNewTimestamp(); touch(QDir::currentPath() + "/main.cpp"); // Now only the file marked as changed must be compiled, even though it hasn't really // changed and another one has. - QCOMPARE(runQbs(params), 0); + QbsRunParameters params2(QStringList("--changed-files") << changedFile); + QCOMPARE(runQbs(params2), 0); QCOMPARE(m_qbsStdout.count("compiling"), 1); + QEXPECT_FAIL("initial build without changed files", "QBS-660", Continue); + QCOMPARE(m_qbsStdout.count("creating"), 1); QVERIFY2(m_qbsStdout.contains("file1.cpp"), m_qbsStdout.constData()); } |