summaryrefslogtreecommitdiff
path: root/test/shell/verify_binary.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/shell/verify_binary.sh')
-rwxr-xr-xtest/shell/verify_binary.sh19
1 files changed, 13 insertions, 6 deletions
diff --git a/test/shell/verify_binary.sh b/test/shell/verify_binary.sh
index 1da7040..f73943a 100755
--- a/test/shell/verify_binary.sh
+++ b/test/shell/verify_binary.sh
@@ -1,27 +1,34 @@
#!/bin/bash
set -euo pipefail
+set -x
readonly binary="%{binary}s"
expected_platform="MACOS"
if [[ "$PLATFORM_TYPE" == "ios" && "$BUILD_TYPE" == "device" ]]; then
- expected_platform="IPHONEOS"
+ expected_platform="IOS"
elif [[ "$PLATFORM_TYPE" == "ios" && "$BUILD_TYPE" == "simulator" ]]; then
- expected_platform="IPHONESIMULATOR"
+ expected_platform="IOSSIMULATOR"
elif [[ "$PLATFORM_TYPE" == "visionos" && "$BUILD_TYPE" == "device" ]]; then
expected_platform="XROS"
elif [[ "$PLATFORM_TYPE" == "visionos" && "$BUILD_TYPE" == "simulator" ]]; then
expected_platform="XROSSIMULATOR"
+elif [[ "$PLATFORM_TYPE" == "watchos" && "$BUILD_TYPE" == "device" ]]; then
+ expected_platform="WATCHOS"
+elif [[ "$PLATFORM_TYPE" == "watchos" && "$BUILD_TYPE" == "simulator" ]]; then
+ expected_platform="WATCHSIMULATOR"
fi
-otool_output=$(otool -lv "$binary")
-if ! echo "$otool_output" | grep -q "platform $expected_platform"; then
- echo "error: binary $binary does not contain platform $expected_platform, got: '$(echo "$otool_output" | grep platform || true)'"
+platforms=$(otool -lv "$binary" | grep "platform " | sort -u || true)
+if ! echo "$platforms" | grep -q "platform $expected_platform"; then
+ echo "error: binary $binary does not contain platform $expected_platform, got: '$platforms'" >&2
exit 1
fi
lipo_output=$(lipo -info "$binary")
-if ! echo "$lipo_output" | grep -q "$CPU"; then
+expected_cpus=${CPU//,/ }
+expected_cpus=${expected_cpus//sim_/}
+if ! echo "$lipo_output" | grep -q "$expected_cpus"; then
echo "error: binary $binary does not contain CPU $CPU, got: '$lipo_output"
exit 1
fi