diff options
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()); } |