aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2013-10-09 16:56:05 +0200
committerJoerg Bornemann <joerg.bornemann@digia.com>2013-10-09 17:45:28 +0200
commitfec9676b01ec89e774ab51ffcd928adf16333a82 (patch)
treecf78fbee84143d4042c32be9e58f655ebfeb2242 /tests/auto/blackbox
parentf24d90b47d874875f3e8020da8927a78e9dffa13 (diff)
Add test case for QBS-394.
Change-Id: I0c0d622f2c94750053d9a35f6aa90b8492465bbd Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'tests/auto/blackbox')
-rw-r--r--tests/auto/blackbox/testdata/explicitlyDependsOn/dependency.txt0
-rw-r--r--tests/auto/blackbox/testdata/explicitlyDependsOn/project.qbs29
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp14
-rw-r--r--tests/auto/blackbox/tst_blackbox.h1
4 files changed, 44 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/explicitlyDependsOn/dependency.txt b/tests/auto/blackbox/testdata/explicitlyDependsOn/dependency.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/auto/blackbox/testdata/explicitlyDependsOn/dependency.txt
diff --git a/tests/auto/blackbox/testdata/explicitlyDependsOn/project.qbs b/tests/auto/blackbox/testdata/explicitlyDependsOn/project.qbs
new file mode 100644
index 000000000..ab98740c6
--- /dev/null
+++ b/tests/auto/blackbox/testdata/explicitlyDependsOn/project.qbs
@@ -0,0 +1,29 @@
+import qbs
+import qbs.TextFile
+
+Product {
+ type: "mytype"
+ files: "dependency.txt"
+ FileTagger {
+ pattern: "*.txt"
+ fileTags: ["txt"]
+ }
+ Transformer {
+ explicitlyDependsOn: "txt"
+ Artifact {
+ fileName: "test.mytype"
+ fileTags: product.type
+ }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.description = "Creating output artifact";
+ cmd.highlight = "codegen";
+ cmd.sourceCode = function() {
+ var file = new TextFile(output.fileName, TextFile.WriteOnly);
+ file.truncate();
+ file.close();
+ }
+ return cmd;
+ }
+ }
+}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index 8fe2cd574..382f2d5f2 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -1122,6 +1122,20 @@ void TestBlackbox::disabledProject()
QCOMPARE(runQbs(), 0);
}
+void TestBlackbox::explicitlyDependsOn()
+{
+ QDir::setCurrent(testDataDir + "/explicitlyDependsOn");
+ QCOMPARE(runQbs(), 0);
+ QVERIFY(m_qbsStdout.contains("Creating output artifact"));
+ QCOMPARE(runQbs(), 0);
+ QVERIFY(!m_qbsStdout.contains("Creating output artifact"));
+ touch("dependency.txt");
+ waitForNewTimestamp();
+ QCOMPARE(runQbs(), 0);
+ QEXPECT_FAIL(0, "QBS-394", Continue);
+ QVERIFY(m_qbsStdout.contains("Creating output artifact"));
+}
+
void TestBlackbox::fileDependencies()
{
QDir::setCurrent(testDataDir + "/fileDependencies");
diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h
index 58498f1be..7bc711a49 100644
--- a/tests/auto/blackbox/tst_blackbox.h
+++ b/tests/auto/blackbox/tst_blackbox.h
@@ -99,6 +99,7 @@ private slots:
void dependenciesProperty();
void disabledProduct();
void disabledProject();
+ void explicitlyDependsOn();
void fileDependencies();
void jsExtensionsFile();
void jsExtensionsFileInfo();