aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2021-03-20 20:16:57 +0300
committerIvan Komissarov <ABBAPOH@gmail.com>2021-03-30 14:32:46 +0000
commit5160a0b6e386b157fc1f5375efd881b8433b29ee (patch)
tree44dc163382dea5d28844239db863e97b07dcfd23 /tests
parent980a5fc3f61f42bdd8cdee832235861e095e8e01 (diff)
codesign: do not sign intermediate products when multiplexing
We should only sign the resulting binary during the lipo step. Change-Id: If4d508bcdf347bf2fc68d345ed8d5913a7457f8d Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/blackbox/testdata-apple/apple-multiconfig/apple-multiconfig.qbs2
-rw-r--r--tests/auto/blackbox/testdata-apple/codesign/codesign.qbs10
-rw-r--r--tests/auto/blackbox/testdata-apple/multiarch-helpers.js (renamed from tests/auto/blackbox/testdata-apple/apple-multiconfig/helpers.js)0
-rw-r--r--tests/auto/blackbox/tst_blackboxapple.cpp23
4 files changed, 29 insertions, 6 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/codesign.qbs b/tests/auto/blackbox/testdata-apple/codesign/codesign.qbs
index 312e9f001..eafb0be84 100644
--- a/tests/auto/blackbox/testdata-apple/codesign/codesign.qbs
+++ b/tests/auto/blackbox/testdata-apple/codesign/codesign.qbs
@@ -1,5 +1,8 @@
+import "../multiarch-helpers.js" as Helpers
+
Project {
name: "p"
+ property string xcodeVersion
property bool isBundle: true
property bool enableSigning: true
@@ -12,6 +15,9 @@ Project {
codesign.signingType: "ad-hoc"
install: true
installDir: ""
+
+ qbs.architectures:
+ project.xcodeVersion ? Helpers.getArchitectures(qbs, project.xcodeVersion) : []
}
DynamicLibrary {
@@ -23,6 +29,8 @@ Project {
codesign.signingType: "ad-hoc"
install: true
installDir: ""
+ qbs.architectures:
+ project.xcodeVersion ? Helpers.getArchitectures(qbs, project.xcodeVersion) : []
}
LoadableModule {
@@ -34,5 +42,7 @@ Project {
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 5d1c0f273..5d1c0f273 100644
--- a/tests/auto/blackbox/testdata-apple/apple-multiconfig/helpers.js
+++ b/tests/auto/blackbox/testdata-apple/multiarch-helpers.js
diff --git a/tests/auto/blackbox/tst_blackboxapple.cpp b/tests/auto/blackbox/tst_blackboxapple.cpp
index 8915ac8b2..884d2c077 100644
--- a/tests/auto/blackbox/tst_blackboxapple.cpp
+++ b/tests/auto/blackbox/tst_blackboxapple.cpp
@@ -717,6 +717,9 @@ void TestBlackboxApple::codesign()
{
QFETCH(bool, isBundle);
QFETCH(bool, enableSigning);
+ QFETCH(bool, multiArch);
+
+ const auto xcodeVersion = findXcodeVersion();
QDir::setCurrent(testDataDir + "/codesign");
QbsRunParameters params(QStringList{"qbs.installPrefix:''"});
@@ -724,10 +727,17 @@ void TestBlackboxApple::codesign()
<< QStringLiteral("project.isBundle:%1").arg(isBundle ? "true" : "false");
params.arguments
<< QStringLiteral("project.enableSigning:%1").arg(enableSigning ? "true" : "false");
+ if (multiArch)
+ params.arguments << QStringLiteral("project.xcodeVersion:") + xcodeVersion.toString();
rmDirR(relativeBuildDir());
QCOMPARE(runQbs(params), 0);
+ const int codeSignCount =
+ QString::fromUtf8(m_qbsStdout).count(QStringLiteral("codesign"));
+ // We have 3 products, we have to sign each exactly once, even in the multiplexed case
+ QCOMPARE(codeSignCount, enableSigning ? 3 : 0);
+
const auto appName = isBundle ? QStringLiteral("A.app") : QStringLiteral("A");
const auto appPath = defaultInstallRoot + "/" + appName;
QVERIFY(QFileInfo(appPath).exists());
@@ -772,11 +782,14 @@ void TestBlackboxApple::codesign_data()
{
QTest::addColumn<bool>("isBundle");
QTest::addColumn<bool>("enableSigning");
-
- QTest::newRow("bundle, unsigned") << true << false;
- QTest::newRow("standalone, unsigned") << false << false;
- QTest::newRow("bundle, signed") << true << true;
- QTest::newRow("standalone, signed") << false << true;
+ QTest::addColumn<bool>("multiArch");
+
+ QTest::newRow("bundle, unsigned") << true << false << false;
+ QTest::newRow("standalone, unsigned") << false << false << false;
+ QTest::newRow("bundle, signed") << true << true << false;
+ QTest::newRow("standalone, signed") << false << true << false;
+ QTest::newRow("bundle, signed, multiarch") << true << true << true;
+ QTest::newRow("standalone, signed, multiarch") << false << true << true;
}
void TestBlackboxApple::deploymentTarget()