aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIvan Komissarov <ABBAPOH@gmail.com>2019-06-25 17:18:34 -0500
committerIvan Komissarov <ABBAPOH@gmail.com>2019-06-26 15:25:54 +0000
commit731eadf9bc99d65595761af743a7ebf44fa86525 (patch)
tree147f95145f673d9e578e4d408aca0fabe448f3e5 /tests
parent06f46da6c31de7d5b767da38713b11b1a117b34e (diff)
Fix TestBlackboxApple::xcode for tvos/ios/watchos platforms
Change-Id: Ieed4b81a83e8b8a5c8c061f985587aded3e13ec3 Reviewed-by: Qbs CI Bot <travis-bot@weickelt.de> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/testdata-apple/xcode/xcode-project.qbs26
-rw-r--r--tests/auto/blackbox/tst_blackboxapple.cpp22
2 files changed, 40 insertions, 8 deletions
diff --git a/tests/auto/blackbox/testdata-apple/xcode/xcode-project.qbs b/tests/auto/blackbox/testdata-apple/xcode/xcode-project.qbs
index d7baf8c8e..fbab6d0b1 100644
--- a/tests/auto/blackbox/testdata-apple/xcode/xcode-project.qbs
+++ b/tests/auto/blackbox/testdata-apple/xcode/xcode-project.qbs
@@ -1,5 +1,5 @@
Project {
- property stringList sdks: []
+ property var sdks: {}
Product {
Depends { name: "xcode" }
@@ -14,7 +14,27 @@ Project {
console.info("Latest SDK version: " + xcode.latestSdkVersion);
console.info("Available SDK names: " + xcode.availableSdkNames.join(", "));
console.info("Available SDK versions: " + xcode.availableSdkVersions.join(", "));
- console.info("Actual SDK list: " + project.sdks.join(", "));
+
+ var targetOsToKey = function(targetOS) {
+ if (targetOS.contains("ios"))
+ return "iphoneos";
+ if (targetOS.contains("ios-simulator"))
+ return "iphonesimulator";
+ if (targetOS.contains("macos"))
+ return "macosx";
+ if (targetOS.contains("tvos"))
+ return "appletvos";
+ if (targetOS.contains("tvos-simulator"))
+ return "appletvsimulator";
+ if (targetOS.contains("watchos"))
+ return "watchos";
+ if (targetOS.contains("watchos-simulator"))
+ return "watchossimulator";
+ throw "Unsupported OS" + targetOS;
+ }
+
+ var actualList = project.sdks[targetOsToKey(qbs.targetOS)];
+ console.info("Actual SDK list: " + actualList.join(", "));
var msg = "Unexpected SDK list [" + xcode.availableSdkVersions.join(", ") + "]";
var testArraysEqual = function(a, b) {
@@ -29,7 +49,7 @@ Project {
}
}
- testArraysEqual(project.sdks, xcode.availableSdkVersions);
+ testArraysEqual(actualList, xcode.availableSdkVersions);
}
}
}
diff --git a/tests/auto/blackbox/tst_blackboxapple.cpp b/tests/auto/blackbox/tst_blackboxapple.cpp
index d9cabe270..f71cc6aa8 100644
--- a/tests/auto/blackbox/tst_blackboxapple.cpp
+++ b/tests/auto/blackbox/tst_blackboxapple.cpp
@@ -758,16 +758,28 @@ void TestBlackboxApple::xcode()
sdks.insert({ match[1], match[2] });
}
- auto range = sdks.equal_range("macosx");
- QStringList sdkValues;
- for (auto i = range.first; i != range.second; ++i)
- sdkValues.push_back(QString::fromStdString(i->second));
+ const auto getSdksByType = [&sdks]()
+ {
+ QStringList result;
+ std::string sdkType;
+ QStringList sdkValues;
+ for (const auto &sdk: sdks) {
+ if (!sdkType.empty() && sdkType != sdk.first) {
+ result.append(QStringLiteral("%1:['%2']")
+ .arg(QString::fromStdString(sdkType), sdkValues.join("','")));
+ sdkValues.clear();
+ }
+ sdkType = sdk.first;
+ sdkValues.append(QString::fromStdString(sdk.second));
+ }
+ return result;
+ };
QDir::setCurrent(testDataDir + "/xcode");
QbsRunParameters params;
params.arguments = (QStringList()
<< (QStringLiteral("modules.xcode.developerPath:") + developerPath)
- << (QStringLiteral("project.sdks:['") + sdkValues.join("','") + "']"));
+ << (QStringLiteral("project.sdks:{") + getSdksByType().join(",") + "}"));
QCOMPARE(runQbs(params), 0);
}