From f0957392a79945b4b3edec98839d440cdb5f5fd6 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 23 Jul 2014 14:27:17 +0200 Subject: Add autotest for tracking wildcard-related changes. Namely, adding and removing files matched by patterns. This does not seem to be explicitly tested anywhere yet. Change-Id: I6d7b79500ee9e7375f22537da5db6a72057bbdee Reviewed-by: Joerg Bornemann --- .../testdata/new-pattern-match/project.qbs | 5 +++++ tests/auto/blackbox/tst_blackbox.cpp | 23 ++++++++++++++++++++++ tests/auto/blackbox/tst_blackbox.h | 1 + 3 files changed, 29 insertions(+) create mode 100644 tests/auto/blackbox/testdata/new-pattern-match/project.qbs diff --git a/tests/auto/blackbox/testdata/new-pattern-match/project.qbs b/tests/auto/blackbox/testdata/new-pattern-match/project.qbs new file mode 100644 index 000000000..18975da75 --- /dev/null +++ b/tests/auto/blackbox/testdata/new-pattern-match/project.qbs @@ -0,0 +1,5 @@ +import qbs + +Product { + files: "*.txt" +} diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 17864d813..0ee9ff2fd 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -1839,6 +1839,29 @@ void TestBlackbox::mocCppIncluded() QCOMPARE(runQbs(), 0); } +void TestBlackbox::newPatternMatch() +{ + QDir::setCurrent(testDataDir + "/new-pattern-match"); + QCOMPARE(runQbs(), 0); + QVERIFY(m_qbsStdout.contains("Resolving")); + waitForNewTimestamp(); + QCOMPARE(runQbs(), 0); + QVERIFY(!m_qbsStdout.contains("Resolving")); + waitForNewTimestamp(); + QFile f("test.txt"); + QVERIFY2(f.open(QIODevice::WriteOnly), qPrintable(f.errorString())); + f.close(); + QCOMPARE(runQbs(), 0); + QVERIFY(m_qbsStdout.contains("Resolving")); + waitForNewTimestamp(); + QCOMPARE(runQbs(), 0); + QVERIFY(!m_qbsStdout.contains("Resolving")); + waitForNewTimestamp(); + f.remove(); + QCOMPARE(runQbs(), 0); + QVERIFY(m_qbsStdout.contains("Resolving")); +} + void TestBlackbox::nonBrokenFilesInBrokenProduct() { QDir::setCurrent(testDataDir + "/non-broken-files-in-broken-product"); diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h index 320039713..6573ad267 100644 --- a/tests/auto/blackbox/tst_blackbox.h +++ b/tests/auto/blackbox/tst_blackbox.h @@ -128,6 +128,7 @@ private slots: void jsExtensionsTextFile(); void inheritQbsSearchPaths(); void mocCppIncluded(); + void newPatternMatch(); void nonBrokenFilesInBrokenProduct(); void objC(); void qmlDebugging(); -- cgit v1.2.3