aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-11-12 15:47:47 -0800
committerJake Petroules <jake.petroules@qt.io>2017-11-13 10:33:57 +0000
commitf878553d488b12c02c3ed3d1bc3d07f8c3c5754f (patch)
tree7bdbcc8bf56ffdc0e1606c8094d2d8ec9cd98f2a
parent056ef501aee7e251cde2dbcf07563f2f1c18c9aa (diff)
Fix assetcatalog test with newer versions of macOS
The default deployment target handling has since changed in a way such that we cannot assume the 'default' target is the current host version. Therefore, make the test explicit about the required deployment target. Change-Id: I2547c6051def619dba8b9e6f18b26942fc6707cd Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs4
-rw-r--r--tests/auto/blackbox/tst_blackboxapple.cpp21
2 files changed, 19 insertions, 6 deletions
diff --git a/tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs b/tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs
index 298f60e2e..ef67796f9 100644
--- a/tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs
+++ b/tests/auto/blackbox/testdata-apple/ib/assetcatalog/assetcatalogempty.qbs
@@ -12,7 +12,9 @@ Project {
filez.push("empty.xcassets/empty.iconset");
else if (Utilities.versionCompare(xcode.version, "5") >= 0)
filez.push("empty.xcassets");
- if (qbs.hostOSVersionMinor >= 10) // need macOS 10.10 to build SBs
+ if (qbs.hostOSVersionMinor >= 10 // need macOS 10.10 to build SBs
+ && cpp.minimumMacosVersion !== undefined
+ && Utilities.versionCompare(cpp.minimumMacosVersion, "10.10") >= 0)
filez.push("Storyboard.storyboard");
return filez;
}
diff --git a/tests/auto/blackbox/tst_blackboxapple.cpp b/tests/auto/blackbox/tst_blackboxapple.cpp
index 98b06a6b1..9fe189ed7 100644
--- a/tests/auto/blackbox/tst_blackboxapple.cpp
+++ b/tests/auto/blackbox/tst_blackboxapple.cpp
@@ -156,25 +156,36 @@ void TestBlackboxApple::assetCatalog()
rmDirR(relativeBuildDir());
QbsRunParameters params;
+ const auto v = HostOsInfo::hostOsVersion();
const QString flattens = "modules.ib.flatten:" + QString(flatten ? "true" : "false");
+ const QString macosTarget = "modules.cpp.minimumMacosVersion:'" + v.toString() + "'";
// Make sure a dry run does not write anything
- params.arguments = QStringList() << "-f" << "assetcatalogempty.qbs" << "--dry-run" << flattens;
+ params.arguments = QStringList() << "-f" << "assetcatalogempty.qbs" << "--dry-run"
+ << flattens << macosTarget;
QCOMPARE(runQbs(params), 0);
QVERIFY(!directoryExists(relativeBuildDir()));
- params.arguments = QStringList() << "-f" << "assetcatalogempty.qbs" << flattens;
+ params.arguments = QStringList() << "-f" << "assetcatalogempty.qbs"
+ << flattens << macosTarget;
QCOMPARE(runQbs(params), 0);
// empty asset catalogs must still produce output
if (xcodeVersion >= qbs::Internal::Version(5))
QVERIFY((bool)m_qbsStdout.contains("compiling empty.xcassets"));
- // should not produce a CAR since minimumMacosVersion will be < 10.9
- QVERIFY(!regularFileExists(relativeProductBuildDir("assetcatalogempty") + "/assetcatalogempty.app/Contents/Resources/Assets.car"));
+ // should additionally produce raw assets since deployment target will be < 10.9
+ // older versions of ibtool generated either raw assets OR .car files;
+ // newer versions always generate the .car file regardless of the deployment target
+ if (v < qbs::Internal::Version(10, 9)) {
+ QVERIFY(regularFileExists(relativeProductBuildDir("assetcatalogempty")
+ + "/assetcatalogempty.app/Contents/Resources/other.png"));
+ QVERIFY(regularFileExists(relativeProductBuildDir("assetcatalogempty")
+ + "/assetcatalogempty.app/Contents/Resources/other@2x.png"));
+ }
rmDirR(relativeBuildDir());
- params.arguments.append("modules.cpp.minimumMacosVersion:10.9"); // force CAR generation
+ params.arguments.append("modules.cpp.minimumMacosVersion:'10.10'"); // force CAR generation
QCOMPARE(runQbs(params), 0);
// empty asset catalogs must still produce output