diff options
Diffstat (limited to 'tests/auto/blackbox/testdata-apple')
13 files changed, 102 insertions, 36 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 6b7fab390..5615722d5 100644 --- a/tests/auto/blackbox/testdata-apple/apple-multiconfig/apple-multiconfig.qbs +++ b/tests/auto/blackbox/testdata-apple/apple-multiconfig/apple-multiconfig.qbs @@ -26,6 +26,7 @@ Project { multiplexByQbsProperties: [] install: true + installDebugInformation: false installDir: "" } @@ -45,6 +46,7 @@ Project { qbs.buildVariants: ["release"] install: true + installDebugInformation: false installDir: "" } @@ -54,7 +56,7 @@ Project { name: "singlelib" targetName: "singlelib" files: ["lib.c"] - cpp.sonamePrefix: qbs.targetOS.contains("darwin") ? "@rpath" : undefined + cpp.sonamePrefix: qbs.targetOS.includes("darwin") ? "@rpath" : undefined cpp.defines: ["VARIANT=" + Utilities.cStringQuote(qbs.buildVariant)] // Turn off multiplexing @@ -62,6 +64,7 @@ Project { multiplexByQbsProperties: [] install: true + installDebugInformation: false installDir: "" } @@ -76,6 +79,7 @@ Project { cpp.minimumIosVersion: "8.0" install: true + installDebugInformation: false installDir: "" } @@ -96,6 +100,7 @@ Project { qbs.buildVariants: "debug" install: true + installDebugInformation: false installDir: "" } @@ -112,6 +117,7 @@ Project { qbs.buildVariants: ["debug", "profiling"] install: true + installDebugInformation: false installDir: "" } @@ -122,12 +128,13 @@ Project { targetName: "multilib" files: ["lib.c"] cpp.minimumIosVersion: "8.0" - cpp.sonamePrefix: qbs.targetOS.contains("darwin") ? "@rpath" : undefined + cpp.sonamePrefix: qbs.targetOS.includes("darwin") ? "@rpath" : undefined cpp.defines: ["VARIANT=" + Utilities.cStringQuote(qbs.buildVariant)] qbs.architectures: Helpers.getArchitectures(qbs, project.xcodeVersion) qbs.buildVariants: ["release", "debug", "profiling"] install: true + installDebugInformation: false installDir: "" } @@ -138,12 +145,13 @@ Project { targetName: "multilib-no-release" files: ["lib.c"] cpp.minimumIosVersion: "8.0" - cpp.sonamePrefix: qbs.targetOS.contains("darwin") ? "@rpath" : undefined + cpp.sonamePrefix: qbs.targetOS.includes("darwin") ? "@rpath" : undefined cpp.defines: ["VARIANT=" + Utilities.cStringQuote(qbs.buildVariant)] qbs.architectures: Helpers.getArchitectures(qbs, project.xcodeVersion) qbs.buildVariants: ["debug", "profiling"] install: true + installDebugInformation: false installDir: "" } @@ -159,6 +167,7 @@ Project { qbs.architectures: Helpers.getArchitectures(qbs, project.xcodeVersion) qbs.buildVariants: ["debug", "profiling"] install: true + installDebugInformation: false installDir: "" } DynamicLibrary { @@ -172,6 +181,7 @@ Project { qbs.architectures: Helpers.getArchitectures(qbs, project.xcodeVersion) qbs.buildVariants: ["debug", "profiling"] install: true + installDebugInformation: false installDir: "" } } diff --git a/tests/auto/blackbox/testdata-apple/bundle-structure/bundle-structure.qbs b/tests/auto/blackbox/testdata-apple/bundle-structure/bundle-structure.qbs index 705f054a8..33ac58967 100644 --- a/tests/auto/blackbox/testdata-apple/bundle-structure/bundle-structure.qbs +++ b/tests/auto/blackbox/testdata-apple/bundle-structure/bundle-structure.qbs @@ -17,7 +17,7 @@ Project { Depends { name: "B" } Depends { name: "C" } Depends { name: "D" } - condition: buildableProducts.contains("A") + condition: buildableProducts.includes("A") name: "A" bundle.isBundle: true bundle.publicHeaders: ["dummy.h"] @@ -33,7 +33,7 @@ Project { Depends { name: "B" } Depends { name: "C" } Depends { name: "D" } - condition: buildableProducts.contains("ABadApple") + condition: buildableProducts.includes("ABadApple") name: "ABadApple" bundle._productTypeIdentifier: "com.apple.product-type.will.never.exist.ever.guaranteed" bundle.isBundle: true @@ -50,7 +50,7 @@ Project { Depends { name: "B" } Depends { name: "C" } Depends { name: "D" } - condition: buildableProducts.contains("ABadThirdParty") + condition: buildableProducts.includes("ABadThirdParty") name: "ABadThirdParty" bundle._productTypeIdentifier: "org.special.third.party.non.existent.product.type" bundle.isBundle: true @@ -103,7 +103,7 @@ Project { ApplicationExtension { Depends { name: "cpp" } - condition: buildableProducts.contains("E") + condition: buildableProducts.includes("E") name: "E" bundle.isBundle: true bundle.publicHeaders: ["dummy.h"] @@ -116,7 +116,7 @@ Project { XPCService { Depends { name: "cpp" } - condition: buildableProducts.contains("F") + condition: buildableProducts.includes("F") name: "F" bundle.isBundle: true bundle.publicHeaders: ["dummy.h"] @@ -129,7 +129,7 @@ Project { Product { Depends { name: "bundle" } - condition: buildableProducts.contains("G") + condition: buildableProducts.includes("G") type: ["inapppurchase"] name: "G" bundle.isBundle: true diff --git a/tests/auto/blackbox/testdata-apple/byteArrayInfoPlist/ByteArray-Info.plist b/tests/auto/blackbox/testdata-apple/byteArrayInfoPlist/ByteArray-Info.plist new file mode 100644 index 000000000..df0429f25 --- /dev/null +++ b/tests/auto/blackbox/testdata-apple/byteArrayInfoPlist/ByteArray-Info.plist @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>DataKey</key> + <!--The data value--> + <data>VGhlIGRhdGEgdmFsdWU=</data> + <key>StringKey</key> + <string>The string value</string> +</dict> +</plist> diff --git a/tests/auto/blackbox/testdata-apple/byteArrayInfoPlist/byteArrayInfoPlist.qbs b/tests/auto/blackbox/testdata-apple/byteArrayInfoPlist/byteArrayInfoPlist.qbs new file mode 100644 index 000000000..4df0886ff --- /dev/null +++ b/tests/auto/blackbox/testdata-apple/byteArrayInfoPlist/byteArrayInfoPlist.qbs @@ -0,0 +1,37 @@ +import qbs.BundleTools +import qbs.TextFile + +CppApplication { + Depends { name: "bundle" } + cpp.minimumMacosVersion: "10.7" + files: ["main.c", "ByteArray-Info.plist"] + type: base.concat(["txt_output"]) + + Properties { + condition: qbs.targetOS.includes("darwin") + bundle.isBundle: true + bundle.identifierPrefix: "com.test" + } + + Rule { + inputs: ["aggregate_infoplist"] + Artifact { + filePath: input.fileName + ".out" + fileTags: ["txt_output"] + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating" + output.fileName + " from " + input.fileName; + cmd.highlight = "codegen"; + cmd.sourceCode = function() { + var plist = new BundleTools.infoPlistContents(input.filePath); + var content = plist["DataKey"]; + var int8view = new Uint8Array(content); + file = new TextFile(output.filePath, TextFile.WriteOnly); + file.write(String.fromCharCode.apply(null, int8view)); + file.close(); + } + return [cmd]; + } + } +} diff --git a/tests/auto/blackbox/testdata-apple/byteArrayInfoPlist/main.c b/tests/auto/blackbox/testdata-apple/byteArrayInfoPlist/main.c new file mode 100644 index 000000000..76e819701 --- /dev/null +++ b/tests/auto/blackbox/testdata-apple/byteArrayInfoPlist/main.c @@ -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 index 08c8f730b..c1fc0502a 100644 --- a/tests/auto/blackbox/testdata-apple/codesign/codesign.qbs +++ b/tests/auto/blackbox/testdata-apple/codesign/codesign.qbs @@ -2,10 +2,13 @@ import "../multiarch-helpers.js" as Helpers Project { name: "p" + // we do not have the access to xcode version in qbs.architectures so we need to pass it here property string xcodeVersion property bool isBundle: true property bool enableSigning: true + property bool multiArch: false + property bool multiVariant: false CppApplication { name: "A" @@ -18,7 +21,8 @@ Project { installDir: "" qbs.architectures: - project.xcodeVersion ? Helpers.getArchitectures(qbs, project.xcodeVersion) : [] + multiArch ? Helpers.getArchitectures(qbs, project.xcodeVersion) : [] + qbs.buildVariants: project.multiVariant ? ["debug", "release"] : [] } DynamicLibrary { @@ -32,7 +36,8 @@ Project { install: true installDir: "" qbs.architectures: - project.xcodeVersion ? Helpers.getArchitectures(qbs, project.xcodeVersion) : [] + multiArch ? Helpers.getArchitectures(qbs, project.xcodeVersion) : [] + qbs.buildVariants: project.multiVariant ? ["debug", "release"] : [] } LoadableModule { @@ -46,6 +51,7 @@ Project { install: true installDir: "" qbs.architectures: - project.xcodeVersion ? Helpers.getArchitectures(qbs, project.xcodeVersion) : [] + multiArch ? Helpers.getArchitectures(qbs, project.xcodeVersion) : [] + qbs.buildVariants: project.multiVariant ? ["debug", "release"] : [] } } diff --git a/tests/auto/blackbox/testdata-apple/deploymentTarget/deployment.qbs b/tests/auto/blackbox/testdata-apple/deploymentTarget/deployment.qbs index 9eff57b60..2179e9c84 100644 --- a/tests/auto/blackbox/testdata-apple/deploymentTarget/deployment.qbs +++ b/tests/auto/blackbox/testdata-apple/deploymentTarget/deployment.qbs @@ -5,7 +5,7 @@ CppApplication { // - will actually link (as of Xcode 8.1) // - exist for the given architecture(s) cpp.minimumMacosVersion: qbs.architecture === "x86_64h" ? "10.12" : "10.6" - cpp.minimumIosVersion: ["armv7s", "arm64", "x86_64"].contains(qbs.architecture) ? "7.0" : "6.0" + cpp.minimumIosVersion: ["armv7s", "arm64", "x86_64"].includes(qbs.architecture) ? "7.0" : "6.0" cpp.minimumTvosVersion: "9.0" cpp.minimumWatchosVersion: "2.0" diff --git a/tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs b/tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs index 6e999adda..d06e24eb3 100644 --- a/tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs +++ b/tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs @@ -1,8 +1,9 @@ +import qbs.Host import qbs.Utilities Project { condition: { - var result = qbs.targetOS.contains("macos"); + var result = qbs.targetOS.includes("macos"); if (!result) console.info("Skip this test"); return result; @@ -17,8 +18,8 @@ Project { filez.push("empty.xcassets/empty.iconset"); else if (Utilities.versionCompare(xcode.version, "5") >= 0) filez.push("empty.xcassets"); - if ((qbs.hostOSVersionMajor >= 11 - || qbs.hostOSVersionMinor >= 10) // need macOS 10.10 or higher to build SBs + if ((Host.osVersionMajor() >= 11 + || Host.osVersionMinor() >= 10) // need macOS 10.10 or higher to build SBs && cpp.minimumMacosVersion !== undefined && Utilities.versionCompare(cpp.minimumMacosVersion, "10.10") >= 0) filez.push("Storyboard.storyboard"); diff --git a/tests/auto/blackbox/testdata-apple/infoPlistVariables/infoPlistVariables.qbs b/tests/auto/blackbox/testdata-apple/infoPlistVariables/infoPlistVariables.qbs index 3f083278f..47ca80f07 100644 --- a/tests/auto/blackbox/testdata-apple/infoPlistVariables/infoPlistVariables.qbs +++ b/tests/auto/blackbox/testdata-apple/infoPlistVariables/infoPlistVariables.qbs @@ -4,7 +4,7 @@ CppApplication { files: ["main.c", "Info.plist"] Properties { - condition: qbs.targetOS.contains("darwin") + condition: qbs.targetOS.includes("darwin") bundle.isBundle: true bundle.identifierPrefix: "com.test" bundle.extraEnv: { diff --git a/tests/auto/blackbox/testdata-apple/multiarch-helpers.js b/tests/auto/blackbox/testdata-apple/multiarch-helpers.js index 5d1c0f273..a8054b63c 100644 --- a/tests/auto/blackbox/testdata-apple/multiarch-helpers.js +++ b/tests/auto/blackbox/testdata-apple/multiarch-helpers.js @@ -34,35 +34,35 @@ var Utilities = require("qbs.Utilities"); // For example: x86 -> x86_64 on macOS, armv7 -> arm64 on iOS function enableOldArch(qbs, xcodeVersion) { - return qbs.targetOS.contains("macos") + return qbs.targetOS.includes("macos") && xcodeVersion && (Utilities.versionCompare(xcodeVersion, "10") < 0 || Utilities.versionCompare(xcodeVersion, "12.2") >= 0) - || qbs.targetOS.contains("ios") + || qbs.targetOS.includes("ios") } function getNewArch(qbs, xcodeVersion) { - if (qbs.targetOS.contains("macos")) + if (qbs.targetOS.includes("macos")) return xcodeVersion && Utilities.versionCompare(xcodeVersion, "12.2") >= 0 ? "arm64" : "x86_64"; - else if (qbs.targetOS.contains("ios-simulator")) + else if (qbs.targetOS.includes("ios-simulator")) return "x86_64" - else if (qbs.targetOS.contains("ios")) + else if (qbs.targetOS.includes("ios")) return "arm64" - else if (qbs.targetOS.contains("tvos")) + else if (qbs.targetOS.includes("tvos")) return "arm64" - else if (qbs.targetOS.contains("watchos")) + else if (qbs.targetOS.includes("watchos")) return "armv7k" throw "unsupported targetOS: " + qbs.targetOS; } function getOldArch(qbs, xcodeVersion) { - if (qbs.targetOS.contains("macos")) + if (qbs.targetOS.includes("macos")) return xcodeVersion && Utilities.versionCompare(xcodeVersion, "12.2") >= 0 ? "x86_64" : "x86"; - else if (qbs.targetOS.contains("ios-simulator")) + else if (qbs.targetOS.includes("ios-simulator")) return "x86" - else if (qbs.targetOS.contains("ios")) + else if (qbs.targetOS.includes("ios")) return "armv7a" throw "unsupported targetOS: " + qbs.targetOS; } diff --git a/tests/auto/blackbox/testdata-apple/objc-arc/objc-arc.qbs b/tests/auto/blackbox/testdata-apple/objc-arc/objc-arc.qbs index 545d5701c..ce128059f 100644 --- a/tests/auto/blackbox/testdata-apple/objc-arc/objc-arc.qbs +++ b/tests/auto/blackbox/testdata-apple/objc-arc/objc-arc.qbs @@ -2,7 +2,7 @@ Product { Depends { name: "cpp" } consoleApplication: true type: ["application"] - condition: qbs.targetOS.contains("darwin") + condition: qbs.targetOS.includes("darwin") Group { cpp.automaticReferenceCounting: true diff --git a/tests/auto/blackbox/testdata-apple/overrideInfoPlist/overrideInfoPlist.qbs b/tests/auto/blackbox/testdata-apple/overrideInfoPlist/overrideInfoPlist.qbs index e70584ed8..270a0792c 100644 --- a/tests/auto/blackbox/testdata-apple/overrideInfoPlist/overrideInfoPlist.qbs +++ b/tests/auto/blackbox/testdata-apple/overrideInfoPlist/overrideInfoPlist.qbs @@ -4,7 +4,7 @@ CppApplication { files: ["main.c", "Override-Info.plist"] Properties { - condition: qbs.targetOS.contains("darwin") + condition: qbs.targetOS.includes("darwin") bundle.isBundle: true bundle.identifierPrefix: "com.test" diff --git a/tests/auto/blackbox/testdata-apple/xcode/xcode-project.qbs b/tests/auto/blackbox/testdata-apple/xcode/xcode-project.qbs index fa4c67b96..e7bf4739a 100644 --- a/tests/auto/blackbox/testdata-apple/xcode/xcode-project.qbs +++ b/tests/auto/blackbox/testdata-apple/xcode/xcode-project.qbs @@ -16,19 +16,19 @@ Project { console.info("Available SDK versions: " + xcode.availableSdkVersions.join(", ")); var targetOsToKey = function(targetOS) { - if (targetOS.contains("ios")) + if (targetOS.includes("ios")) return "iphoneos"; - if (targetOS.contains("ios-simulator")) + if (targetOS.includes("ios-simulator")) return "iphonesimulator"; - if (targetOS.contains("macos")) + if (targetOS.includes("macos")) return "macosx"; - if (targetOS.contains("tvos")) + if (targetOS.includes("tvos")) return "appletvos"; - if (targetOS.contains("tvos-simulator")) + if (targetOS.includes("tvos-simulator")) return "appletvsimulator"; - if (targetOS.contains("watchos")) + if (targetOS.includes("watchos")) return "watchos"; - if (targetOS.contains("watchos-simulator")) + if (targetOS.includes("watchos-simulator")) return "watchossimulator"; throw "Unsupported OS" + targetOS; } |