summaryrefslogtreecommitdiff
path: root/tests/auto/api
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2015-02-12 11:59:25 +0100
committerChristian Kandeler <christian.kandeler@theqtcompany.com>2015-02-12 12:13:11 +0100
commitb679f075b1a86e9e470059254428aede43b393b1 (patch)
treedc336b6738d4917088ca8994c1042dd2d982f940 /tests/auto/api
parent5447c56a01ac944900026e4634ef1c6e285eda00 (diff)
parente1ea84b740fb54bf7a60e852f68dd5a126da0104 (diff)
downloadqbs-b679f075b1a86e9e470059254428aede43b393b1.tar.gz
Merge branch '1.3' into master
Change-Id: I2be50b137281c2c8201ba8a70187d3ecca14a06e
Diffstat (limited to 'tests/auto/api')
-rw-r--r--tests/auto/api/testdata/two-default-property-values/modules/mymodule/mymodule.qbs24
-rw-r--r--tests/auto/api/testdata/two-default-property-values/modules/myothermodule/myothermodule.qbs5
-rw-r--r--tests/auto/api/testdata/two-default-property-values/project.qbs13
-rw-r--r--tests/auto/api/testdata/two-default-property-values/test.txt0
-rw-r--r--tests/auto/api/tst_api.cpp3
5 files changed, 45 insertions, 0 deletions
diff --git a/tests/auto/api/testdata/two-default-property-values/modules/mymodule/mymodule.qbs b/tests/auto/api/testdata/two-default-property-values/modules/mymodule/mymodule.qbs
new file mode 100644
index 000000000..52e99e24d
--- /dev/null
+++ b/tests/auto/api/testdata/two-default-property-values/modules/mymodule/mymodule.qbs
@@ -0,0 +1,24 @@
+import qbs
+import qbs.TextFile
+
+Module {
+ property string direct
+ property string indirect: direct ? "set" : "unset"
+
+ Rule {
+ inputs: ["txt"]
+ Artifact {
+ filePath: product.moduleProperty("mymodule", "indirect")
+ fileTags: ["mymodule"]
+ }
+ 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/api/testdata/two-default-property-values/modules/myothermodule/myothermodule.qbs b/tests/auto/api/testdata/two-default-property-values/modules/myothermodule/myothermodule.qbs
new file mode 100644
index 000000000..e0ec699df
--- /dev/null
+++ b/tests/auto/api/testdata/two-default-property-values/modules/myothermodule/myothermodule.qbs
@@ -0,0 +1,5 @@
+import qbs
+
+Module {
+ Depends { name: "mymodule" }
+}
diff --git a/tests/auto/api/testdata/two-default-property-values/project.qbs b/tests/auto/api/testdata/two-default-property-values/project.qbs
new file mode 100644
index 000000000..c0bc720f7
--- /dev/null
+++ b/tests/auto/api/testdata/two-default-property-values/project.qbs
@@ -0,0 +1,13 @@
+import qbs
+
+Product {
+ name: "two-default-property-values"
+ type: "mymodule"
+ Depends { name: "mymodule" }
+ Depends { name: "myothermodule" }
+ mymodule.direct: "dummy"
+ Group {
+ files: ["test.txt"]
+ fileTags: ["txt"]
+ }
+}
diff --git a/tests/auto/api/testdata/two-default-property-values/test.txt b/tests/auto/api/testdata/two-default-property-values/test.txt
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/auto/api/testdata/two-default-property-values/test.txt
diff --git a/tests/auto/api/tst_api.cpp b/tests/auto/api/tst_api.cpp
index 2572d5c7d..7ffb596cc 100644
--- a/tests/auto/api/tst_api.cpp
+++ b/tests/auto/api/tst_api.cpp
@@ -323,6 +323,9 @@ void TestApi::buildProject_data()
QTest::newRow("productNameWithDots")
<< QString("productNameWithDots")
<< relativeExecutableFilePath("myapp");
+ QTest::newRow("only default properties")
+ << QString("two-default-property-values")
+ << relativeProductBuildDir("two-default-property-values") + "/set";
QTest::newRow("QBS-728")
<< QString("QBS-728")
<< QString();