aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/find
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@theqtcompany.com>2016-08-04 12:00:41 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2016-08-08 20:17:04 +0000
commit188c160b658dc96a70afb08e80286866d6b4c507 (patch)
treeea72b10145ed31ffce5ec7b48051a391d47d1909 /tests/auto/blackbox/find
parent2c916bea64bc480282eeddfc1d55042be10fa4e9 (diff)
Split off the Java-related blackbox tests
They take an extraordinary amount of time and should thus run in parallel to the other tests. Change-Id: I435dd5506cc3f26e351c700ce6be2476d041b6af Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'tests/auto/blackbox/find')
-rw-r--r--tests/auto/blackbox/find/find-android.qbs41
-rw-r--r--tests/auto/blackbox/find/find-jdk.qbs36
-rw-r--r--tests/auto/blackbox/find/find-nodejs.qbs34
-rw-r--r--tests/auto/blackbox/find/find-typescript.qbs35
4 files changed, 146 insertions, 0 deletions
diff --git a/tests/auto/blackbox/find/find-android.qbs b/tests/auto/blackbox/find/find-android.qbs
new file mode 100644
index 000000000..4b39afeea
--- /dev/null
+++ b/tests/auto/blackbox/find/find-android.qbs
@@ -0,0 +1,41 @@
+import qbs
+import qbs.TextFile
+
+Product {
+ property string packageName: ""
+
+ Depends { name: "Android.sdk"; required: false }
+ Depends { name: "Android.ndk"; required: false }
+ type: ["json"]
+ Rule {
+ inputs: ["qbs"]
+ Artifact {
+ filePath: ["android.json"]
+ fileTags: ["json"]
+ }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.description = output.filePath;
+ cmd.sourceCode = function() {
+ var tools = {};
+ if (product.moduleProperty("Android.sdk", "present")) {
+ tools["sdk"] = product.moduleProperty("Android.sdk", "sdkDir");
+ }
+
+ if (product.moduleProperty("Android.ndk", "present")) {
+ tools["ndk"] = product.moduleProperty("Android.ndk", "ndkDir");
+ }
+
+ var tf;
+ try {
+ tf = new TextFile(output.filePath, TextFile.WriteOnly);
+ tf.writeLine(JSON.stringify(tools, undefined, 4));
+ } finally {
+ if (tf)
+ tf.close();
+ }
+ };
+ return cmd;
+ }
+ }
+}
diff --git a/tests/auto/blackbox/find/find-jdk.qbs b/tests/auto/blackbox/find/find-jdk.qbs
new file mode 100644
index 000000000..6bfc70ac5
--- /dev/null
+++ b/tests/auto/blackbox/find/find-jdk.qbs
@@ -0,0 +1,36 @@
+import qbs
+import qbs.TextFile
+
+Product {
+ Depends { name: "java"; required: false }
+ type: ["json"]
+ Rule {
+ inputs: ["qbs"]
+ Artifact {
+ filePath: ["jdk.json"]
+ fileTags: ["json"]
+ }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.description = output.filePath;
+ cmd.sourceCode = function() {
+ var tools = {};
+ if (product.moduleProperty("java", "present")) {
+ tools["javac"] = product.moduleProperty("java", "compilerFilePath");
+ tools["java"] = product.moduleProperty("java", "interpreterFilePath");
+ tools["jar"] = product.moduleProperty("java", "jarFilePath");
+ }
+
+ var tf;
+ try {
+ tf = new TextFile(output.filePath, TextFile.WriteOnly);
+ tf.writeLine(JSON.stringify(tools, undefined, 4));
+ } finally {
+ if (tf)
+ tf.close();
+ }
+ };
+ return cmd;
+ }
+ }
+}
diff --git a/tests/auto/blackbox/find/find-nodejs.qbs b/tests/auto/blackbox/find/find-nodejs.qbs
new file mode 100644
index 000000000..107937da7
--- /dev/null
+++ b/tests/auto/blackbox/find/find-nodejs.qbs
@@ -0,0 +1,34 @@
+import qbs
+import qbs.TextFile
+
+Product {
+ Depends { name: "nodejs"; required: false }
+ type: ["json"]
+ Rule {
+ inputs: ["qbs"]
+ Artifact {
+ filePath: ["nodejs.json"]
+ fileTags: ["json"]
+ }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.description = output.filePath;
+ cmd.sourceCode = function() {
+ var tools = {};
+ if (product.moduleProperty("nodejs", "present")) {
+ tools["node"] = product.moduleProperty("nodejs", "interpreterFilePath");
+ }
+
+ var tf;
+ try {
+ tf = new TextFile(output.filePath, TextFile.WriteOnly);
+ tf.writeLine(JSON.stringify(tools, undefined, 4));
+ } finally {
+ if (tf)
+ tf.close();
+ }
+ };
+ return cmd;
+ }
+ }
+}
diff --git a/tests/auto/blackbox/find/find-typescript.qbs b/tests/auto/blackbox/find/find-typescript.qbs
new file mode 100644
index 000000000..e5616633a
--- /dev/null
+++ b/tests/auto/blackbox/find/find-typescript.qbs
@@ -0,0 +1,35 @@
+import qbs
+import qbs.TextFile
+
+Product {
+ Depends { name: "nodejs"; required: false }
+ Depends { name: "typescript"; required: false }
+ type: ["json"]
+ Rule {
+ inputs: ["qbs"]
+ Artifact {
+ filePath: ["typescript.json"]
+ fileTags: ["json"]
+ }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.description = output.filePath;
+ cmd.sourceCode = function() {
+ var tools = {};
+ if (product.moduleProperty("typescript", "present")) {
+ tools["tsc"] = product.moduleProperty("typescript", "compilerPath");
+ }
+
+ var tf;
+ try {
+ tf = new TextFile(output.filePath, TextFile.WriteOnly);
+ tf.writeLine(JSON.stringify(tools, undefined, 4));
+ } finally {
+ if (tf)
+ tf.close();
+ }
+ };
+ return cmd;
+ }
+ }
+}