diff options
author | Ivan Komissarov <abbapoh@gmail.com> | 2020-12-18 01:17:50 +0100 |
---|---|---|
committer | Ivan Komissarov <abbapoh@gmail.com> | 2020-12-18 01:19:13 +0100 |
commit | 0b23c1f139a00643521b35f77acfa333b4073194 (patch) | |
tree | d05c959e57403c0190fad46133784b3e77f89a18 /tests/auto/blackbox/tst_blackboxapple.cpp | |
parent | d3d49f4167e72f3a91d349b36ce95a415234e9d1 (diff) | |
parent | 9e9caf2268fd75f4bddd74084afcc7ba27fe5d2e (diff) | |
download | qbs-0b23c1f139a00643521b35f77acfa333b4073194.tar.gz |
Merge branch '1.18'
Change-Id: I37c359289dcd957fbc964a35fab381a047f7d04a
Diffstat (limited to 'tests/auto/blackbox/tst_blackboxapple.cpp')
-rw-r--r-- | tests/auto/blackbox/tst_blackboxapple.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/blackbox/tst_blackboxapple.cpp b/tests/auto/blackbox/tst_blackboxapple.cpp index 79dbab58f..adde389ec 100644 --- a/tests/auto/blackbox/tst_blackboxapple.cpp +++ b/tests/auto/blackbox/tst_blackboxapple.cpp @@ -292,6 +292,36 @@ void TestBlackboxApple::aggregateDependencyLinking() QVERIFY2(QString::fromUtf8(m_qbsStdout).contains(fatLibPath), m_qbsStdout); } +void TestBlackboxApple::appiconset() +{ + QDir::setCurrent(testDataDir + QLatin1String("/ib/appiconset")); + + QbsRunParameters params; + params.arguments = QStringList() << "-f" << "appiconset.qbs"; + QCOMPARE(runQbs(params), 0); + + const auto infoPlistPath = getInfoPlistPath( + relativeProductBuildDir("appiconset") + "/appiconset.app"); + QVERIFY(QFile::exists(infoPlistPath)); + const auto content = readInfoPlistFile(infoPlistPath); + QVERIFY(!content.isEmpty()); + + if (m_qbsStdout.contains("bundle.isShallow: false")) { + QCOMPARE(content.value(QStringLiteral("CFBundleIconFile")), QStringLiteral("AppIcon")); + QCOMPARE(content.value(QStringLiteral("CFBundleIconName")), QStringLiteral("AppIcon")); + QVERIFY(regularFileExists(relativeProductBuildDir("appiconset") + + "/appiconset.app/Contents/Resources/AppIcon.icns")); + } else if (m_qbsStdout.contains("bundle.isShallow: true")) { + const auto icons = content.value(QStringLiteral("CFBundleIcons")).toMap(); + QVERIFY2(!icons.isEmpty(), "Info.plist doesn't contain CFBundleIcons key"); + const auto primaryIcon = icons.value(QStringLiteral("CFBundlePrimaryIcon")).toMap(); + QVERIFY2(!primaryIcon.isEmpty(), "Info.plist doesn't contain CFBundlePrimaryIcon key"); + QCOMPARE(primaryIcon.value(QStringLiteral("CFBundleIconName")), QStringLiteral("AppIcon")); + } else { + QVERIFY2(false, "Cannot determine bundle type"); + } +} + void TestBlackboxApple::assetCatalog() { QFETCH(bool, flatten); |