aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata/ruleConditions
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2013-04-03 11:40:30 +0200
committerChristian Kandeler <christian.kandeler@digia.com>2013-04-05 10:59:40 +0200
commitffb6be9612e270372d3fa9887d74cdaa1d9306cc (patch)
tree9692d91f2163a9a78e3732100a0c856ffcc12bb8 /tests/auto/blackbox/testdata/ruleConditions
parentb29a80aee8a9adaca5ffd2c172670158458c5614 (diff)
implement Rule.condition property
Now it's possible to turn rules on/off dependent on module properties set by the product. Change-Id: Ie11b31f416bd95a8a764ce99d7d8ca190eff08b5 Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'tests/auto/blackbox/testdata/ruleConditions')
-rw-r--r--tests/auto/blackbox/testdata/ruleConditions/foo.narf0
-rw-r--r--tests/auto/blackbox/testdata/ruleConditions/main.cpp1
-rw-r--r--tests/auto/blackbox/testdata/ruleConditions/modules/narfzort/narfzort.qbs26
-rw-r--r--tests/auto/blackbox/testdata/ruleConditions/ruleConditions.qbs12
-rw-r--r--tests/auto/blackbox/testdata/ruleConditions/templates/zorduct.qbs11
5 files changed, 50 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/ruleConditions/foo.narf b/tests/auto/blackbox/testdata/ruleConditions/foo.narf
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/auto/blackbox/testdata/ruleConditions/foo.narf
diff --git a/tests/auto/blackbox/testdata/ruleConditions/main.cpp b/tests/auto/blackbox/testdata/ruleConditions/main.cpp
new file mode 100644
index 000000000..76e819701
--- /dev/null
+++ b/tests/auto/blackbox/testdata/ruleConditions/main.cpp
@@ -0,0 +1 @@
+int main() { return 0; }
diff --git a/tests/auto/blackbox/testdata/ruleConditions/modules/narfzort/narfzort.qbs b/tests/auto/blackbox/testdata/ruleConditions/modules/narfzort/narfzort.qbs
new file mode 100644
index 000000000..a35b6ee05
--- /dev/null
+++ b/tests/auto/blackbox/testdata/ruleConditions/modules/narfzort/narfzort.qbs
@@ -0,0 +1,26 @@
+import qbs 1.0
+
+Module {
+ property bool buildZort: true
+ FileTagger {
+ pattern: "*.narf"
+ fileTags: ["narf"]
+ }
+ Rule {
+ condition: product.moduleProperty("narfzort", "buildZort");
+ inputs: ["narf"]
+ Artifact {
+ fileName: product.name + "." + input.fileName + ".zort"
+ fileTags: ["zort"]
+ }
+ prepare: {
+ var cmd = JavaScriptCommand();
+ cmd.sourceCode = function() {
+ var f = new TextFile(output.fileName, TextFile.WriteOnly);
+ f.write("NARF! ZORT!");
+ f.close();
+ }
+ return cmd;
+ }
+ }
+}
diff --git a/tests/auto/blackbox/testdata/ruleConditions/ruleConditions.qbs b/tests/auto/blackbox/testdata/ruleConditions/ruleConditions.qbs
new file mode 100644
index 000000000..766bf3c5d
--- /dev/null
+++ b/tests/auto/blackbox/testdata/ruleConditions/ruleConditions.qbs
@@ -0,0 +1,12 @@
+import qbs 1.0
+import "templates/zorduct.qbs" as Zorduct
+
+Project {
+ Zorduct {
+ narfzort.buildZort: false
+ name: "unzorted"
+ }
+ Zorduct {
+ name: "zorted"
+ }
+}
diff --git a/tests/auto/blackbox/testdata/ruleConditions/templates/zorduct.qbs b/tests/auto/blackbox/testdata/ruleConditions/templates/zorduct.qbs
new file mode 100644
index 000000000..c36e00850
--- /dev/null
+++ b/tests/auto/blackbox/testdata/ruleConditions/templates/zorduct.qbs
@@ -0,0 +1,11 @@
+import qbs 1.0
+
+Product {
+ type: ["application", "zort"]
+ Depends { name: "cpp" }
+ Depends { name: "narfzort" }
+ files: [
+ "main.cpp",
+ "foo.narf"
+ ]
+}