aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata/invalid-command-property/invalid-command-property.qbs
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2016-06-15 17:24:34 +0200
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2016-06-15 15:44:10 +0000
commitca96dbd651e483b64581d86698b0fa1568880374 (patch)
tree018195d066b3ffed92a3beaa92edb2a4c03f57b0 /tests/auto/blackbox/testdata/invalid-command-property/invalid-command-property.qbs
parent320ffbca5673445ec059c1874e3855048da2d837 (diff)
Prevent users from creating nonsensical Command properties.
Task-number: QBS-985 Change-Id: If25310b37ee35cf786ae8d0c19d2196129ac2ab1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata/invalid-command-property/invalid-command-property.qbs')
-rw-r--r--tests/auto/blackbox/testdata/invalid-command-property/invalid-command-property.qbs27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/invalid-command-property/invalid-command-property.qbs b/tests/auto/blackbox/testdata/invalid-command-property/invalid-command-property.qbs
new file mode 100644
index 000000000..65437311e
--- /dev/null
+++ b/tests/auto/blackbox/testdata/invalid-command-property/invalid-command-property.qbs
@@ -0,0 +1,27 @@
+import qbs
+import qbs.TextFile
+
+Product {
+ type: ["output"]
+ Group {
+ files: ["input.txt"]
+ fileTags: ["input"]
+ }
+ Rule {
+ inputs: ["input"]
+ Artifact {
+ filePath: "dummy"
+ fileTags: ["output"]
+ }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.description = "Creating output";
+ cmd.textFile = new TextFile(input.filePath, TextFile.ReadOnly);
+ cmd.sourceCode = function() {
+ var content = textFile.readAll();
+ textFile.close();
+ }
+ return [cmd];
+ }
+ }
+}