feat: add macOS native targets (macosX64, macosArm64) to quartz

- Declare macosX64() and macosArm64() KMP targets in build.gradle.kts
- Wire macosMain/macosTest source sets through appleMain/appleTest
- Move Secp256k1NativeBenchmark from linuxX64Test to nativeTest so it
  runs on all native targets (Linux, macOS, iOS)
- Use platform() for dynamic labels instead of hardcoded "linuxX64"
- Update run_all.sh to pick the correct native target per OS/arch

https://claude.ai/code/session_01WSNE6QKiYM2ZutQD2UihCW
This commit is contained in:
Claude
2026-04-09 23:23:11 +00:00
parent dee050c6d8
commit 09001bbe98
3 changed files with 56 additions and 15 deletions
+20 -12
View File
@@ -82,21 +82,29 @@ fi
echo ""
# ============================================================================
# 2. Kotlin/Native benchmark (Linux only — only linuxX64 target exists)
# 2. Kotlin/Native benchmark (Linux and macOS)
# ============================================================================
if [ "$OS_NAME" = "Linux" ]; then
echo "=== Running Kotlin/Native benchmark ==="
"$ROOT/gradlew" -p "$ROOT" :quartz:linuxX64Test --tests "*.Secp256k1NativeBenchmark" \
2>/dev/null || true
echo "=== Running Kotlin/Native benchmark ==="
case "$OS_NAME" in
Linux)
KN_TARGET="linuxX64Test"
;;
Darwin)
case "$ARCH" in
arm64) KN_TARGET="macosArm64Test" ;;
*) KN_TARGET="macosX64Test" ;;
esac
;;
esac
KN_XML="$ROOT/quartz/build/test-results/linuxX64Test/TEST-linuxX64Test.com.vitorpamplona.quartz.utils.secp256k1.Secp256k1NativeBenchmark.xml"
if [ -f "$KN_XML" ]; then
sed -n '/<!\[CDATA\[/,/\]\]>/p' "$KN_XML" | grep -v 'CDATA\|]]>'
else
echo "K/Native benchmark XML not found."
fi
"$ROOT/gradlew" -p "$ROOT" ":quartz:$KN_TARGET" --tests "*.Secp256k1NativeBenchmark" \
2>/dev/null || true
KN_XML="$ROOT/quartz/build/test-results/$KN_TARGET/TEST-${KN_TARGET}.com.vitorpamplona.quartz.utils.secp256k1.Secp256k1NativeBenchmark.xml"
if [ -f "$KN_XML" ]; then
sed -n '/<!\[CDATA\[/,/\]\]>/p' "$KN_XML" | grep -v 'CDATA\|]]>'
else
echo "=== Skipping Kotlin/Native benchmark (only linuxX64 target available) ==="
echo "K/Native benchmark XML not found."
fi
echo ""