aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2018-05-23 13:17:23 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2018-05-24 11:08:19 +0000
commit57fd0ab336f0d88c007e4d7f5d09230d9a9e460b (patch)
tree8cd4e812e9779b1af7c19b8c7fb18e6e6a8b53d9 /tests
parentb9c2e80bd1dd6a336139aff32248100b61e34404 (diff)
Apply all groups with the same file tag filter
... rather than considering only the last one. It is a valid use case to add more properties and/or file tags in derived items. Change-Id: I9ebc95a3f485c16c3cc7e21723645ab87c9c1693 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/testdata/filetagsfilter-merging/MyApplication.qbs11
-rw-r--r--tests/auto/blackbox/testdata/filetagsfilter-merging/filetagsfilter-merging.qbs29
-rw-r--r--tests/auto/blackbox/testdata/filetagsfilter-merging/main.cpp1
-rw-r--r--tests/auto/blackbox/tst_blackbox.cpp11
-rw-r--r--tests/auto/blackbox/tst_blackbox.h1
5 files changed, 53 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/filetagsfilter-merging/MyApplication.qbs b/tests/auto/blackbox/testdata/filetagsfilter-merging/MyApplication.qbs
new file mode 100644
index 000000000..1bd215cc6
--- /dev/null
+++ b/tests/auto/blackbox/testdata/filetagsfilter-merging/MyApplication.qbs
@@ -0,0 +1,11 @@
+import qbs
+
+CppApplication {
+ consoleApplication: true
+ Group {
+ fileTagsFilter: "application"
+ qbs.install:true
+ qbs.installPrefix: product.name
+ qbs.installDir: "wrong"
+ }
+}
diff --git a/tests/auto/blackbox/testdata/filetagsfilter-merging/filetagsfilter-merging.qbs b/tests/auto/blackbox/testdata/filetagsfilter-merging/filetagsfilter-merging.qbs
new file mode 100644
index 000000000..2a0046158
--- /dev/null
+++ b/tests/auto/blackbox/testdata/filetagsfilter-merging/filetagsfilter-merging.qbs
@@ -0,0 +1,29 @@
+import qbs
+import qbs.TextFile
+
+MyApplication {
+ name: "myapp"
+ type: base.concat("extra-output")
+ files: "main.cpp"
+ Group {
+ fileTagsFilter: "application"
+ qbs.installDir: "binDir"
+ fileTags: "extra-input"
+ }
+ Rule {
+ inputs: "extra-input"
+ Artifact {
+ filePath: input.fileName + ".txt"
+ fileTags: "extra-output"
+ }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.description = "creating " + output.fileName;
+ cmd.sourceCode = function() {
+ var f = new TextFile(output.filePath, TextFile.WriteOnly);
+ f.close();
+ }
+ return cmd;
+ }
+ }
+}
diff --git a/tests/auto/blackbox/testdata/filetagsfilter-merging/main.cpp b/tests/auto/blackbox/testdata/filetagsfilter-merging/main.cpp
new file mode 100644
index 000000000..237c8ce18
--- /dev/null
+++ b/tests/auto/blackbox/testdata/filetagsfilter-merging/main.cpp
@@ -0,0 +1 @@
+int main() {}
diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp
index f0c731446..df3000ad0 100644
--- a/tests/auto/blackbox/tst_blackbox.cpp
+++ b/tests/auto/blackbox/tst_blackbox.cpp
@@ -3423,6 +3423,17 @@ void TestBlackbox::fileDependencies()
QVERIFY(!m_qbsStdout.contains("compiling zort.cpp"));
}
+void TestBlackbox::fileTagsFilterMerging()
+{
+ QDir::setCurrent(testDataDir + "/filetagsfilter-merging");
+ QCOMPARE(runQbs(QStringList{"-f", "filetagsfilter-merging.qbs"}), 0);
+ const QString installedApp = defaultInstallRoot + "/myapp/binDir/"
+ + QFileInfo(relativeExecutableFilePath("myapp")).fileName();
+ QVERIFY2(QFile::exists(installedApp), qPrintable(installedApp));
+ const QString otherOutput = relativeProductBuildDir("myapp") + "/myapp.txt";
+ QVERIFY2(QFile::exists(otherOutput), qPrintable(otherOutput));
+}
+
void TestBlackbox::installedTransformerOutput()
{
QDir::setCurrent(testDataDir + "/installed-transformer-output");
diff --git a/tests/auto/blackbox/tst_blackbox.h b/tests/auto/blackbox/tst_blackbox.h
index f55158be5..cafdf2def 100644
--- a/tests/auto/blackbox/tst_blackbox.h
+++ b/tests/auto/blackbox/tst_blackbox.h
@@ -108,6 +108,7 @@ private slots:
void exportsQbs();
void externalLibs();
void fileDependencies();
+ void fileTagsFilterMerging();
void generatedArtifactAsInputToDynamicRule();
void generator();
void generator_data();