aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata-apple
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/blackbox/testdata-apple')
-rw-r--r--tests/auto/blackbox/testdata-apple/apple-multiconfig/apple-multiconfig.qbs2
-rw-r--r--tests/auto/blackbox/testdata-apple/codesign/app.cpp1
-rw-r--r--tests/auto/blackbox/testdata-apple/codesign/codesign.qbs48
-rw-r--r--tests/auto/blackbox/testdata-apple/multiarch-helpers.js (renamed from tests/auto/blackbox/testdata-apple/apple-multiconfig/helpers.js)21
4 files changed, 64 insertions, 8 deletions
diff --git a/tests/auto/blackbox/testdata-apple/apple-multiconfig/apple-multiconfig.qbs b/tests/auto/blackbox/testdata-apple/apple-multiconfig/apple-multiconfig.qbs
index c1d35eb8c..6b7fab390 100644
--- a/tests/auto/blackbox/testdata-apple/apple-multiconfig/apple-multiconfig.qbs
+++ b/tests/auto/blackbox/testdata-apple/apple-multiconfig/apple-multiconfig.qbs
@@ -1,6 +1,6 @@
import qbs.Utilities
-import "helpers.js" as Helpers
+import "../multiarch-helpers.js" as Helpers
Project {
minimumQbsVersion: "1.8"
diff --git a/tests/auto/blackbox/testdata-apple/codesign/app.cpp b/tests/auto/blackbox/testdata-apple/codesign/app.cpp
new file mode 100644
index 000000000..76e819701
--- /dev/null
+++ b/tests/auto/blackbox/testdata-apple/codesign/app.cpp
@@ -0,0 +1 @@
+int main() { return 0; }
diff --git a/tests/auto/blackbox/testdata-apple/codesign/codesign.qbs b/tests/auto/blackbox/testdata-apple/codesign/codesign.qbs
new file mode 100644
index 000000000..eafb0be84
--- /dev/null
+++ b/tests/auto/blackbox/testdata-apple/codesign/codesign.qbs
@@ -0,0 +1,48 @@
+import "../multiarch-helpers.js" as Helpers
+
+Project {
+ name: "p"
+ property string xcodeVersion
+
+ property bool isBundle: true
+ property bool enableSigning: true
+
+ CppApplication {
+ name: "A"
+ bundle.isBundle: project.isBundle
+ files: "app.cpp"
+ codesign.enableCodeSigning: project.enableSigning
+ codesign.signingType: "ad-hoc"
+ install: true
+ installDir: ""
+
+ qbs.architectures:
+ project.xcodeVersion ? Helpers.getArchitectures(qbs, project.xcodeVersion) : []
+ }
+
+ DynamicLibrary {
+ Depends { name: "cpp" }
+ name: "B"
+ bundle.isBundle: project.isBundle
+ files: "app.cpp"
+ codesign.enableCodeSigning: project.enableSigning
+ codesign.signingType: "ad-hoc"
+ install: true
+ installDir: ""
+ qbs.architectures:
+ project.xcodeVersion ? Helpers.getArchitectures(qbs, project.xcodeVersion) : []
+ }
+
+ LoadableModule {
+ Depends { name: "cpp" }
+ name: "C"
+ bundle.isBundle: project.isBundle
+ files: "app.cpp"
+ codesign.enableCodeSigning: project.enableSigning
+ codesign.signingType: "ad-hoc"
+ install: true
+ installDir: ""
+ qbs.architectures:
+ project.xcodeVersion ? Helpers.getArchitectures(qbs, project.xcodeVersion) : []
+ }
+}
diff --git a/tests/auto/blackbox/testdata-apple/apple-multiconfig/helpers.js b/tests/auto/blackbox/testdata-apple/multiarch-helpers.js
index 16ba00fa9..5d1c0f273 100644
--- a/tests/auto/blackbox/testdata-apple/apple-multiconfig/helpers.js
+++ b/tests/auto/blackbox/testdata-apple/multiarch-helpers.js
@@ -36,12 +36,16 @@ var Utilities = require("qbs.Utilities");
function enableOldArch(qbs, xcodeVersion) {
return qbs.targetOS.contains("macos")
&& xcodeVersion
- && Utilities.versionCompare(xcodeVersion, "10") < 0
+ && (Utilities.versionCompare(xcodeVersion, "10") < 0
+ || Utilities.versionCompare(xcodeVersion, "12.2") >= 0)
|| qbs.targetOS.contains("ios")
}
-function getNewArch(qbs) {
- if (qbs.targetOS.contains("macos") || qbs.targetOS.contains("ios-simulator"))
+function getNewArch(qbs, xcodeVersion) {
+ if (qbs.targetOS.contains("macos"))
+ return xcodeVersion
+ && Utilities.versionCompare(xcodeVersion, "12.2") >= 0 ? "arm64" : "x86_64";
+ else if (qbs.targetOS.contains("ios-simulator"))
return "x86_64"
else if (qbs.targetOS.contains("ios"))
return "arm64"
@@ -52,8 +56,11 @@ function getNewArch(qbs) {
throw "unsupported targetOS: " + qbs.targetOS;
}
-function getOldArch(qbs) {
- if (qbs.targetOS.contains("macos") || qbs.targetOS.contains("ios-simulator"))
+function getOldArch(qbs, xcodeVersion) {
+ if (qbs.targetOS.contains("macos"))
+ return xcodeVersion
+ && Utilities.versionCompare(xcodeVersion, "12.2") >= 0 ? "x86_64" : "x86";
+ else if (qbs.targetOS.contains("ios-simulator"))
return "x86"
else if (qbs.targetOS.contains("ios"))
return "armv7a"
@@ -62,6 +69,6 @@ function getOldArch(qbs) {
function getArchitectures(qbs, xcodeVersion) {
return enableOldArch(qbs, xcodeVersion)
- ? [getOldArch(qbs), getNewArch(qbs)]
- : [getNewArch(qbs)];
+ ? [getOldArch(qbs, xcodeVersion), getNewArch(qbs, xcodeVersion)]
+ : [getNewArch(qbs, xcodeVersion)];
}