#!/bin/sh
# Integration test script for MUSL builds with extended tests
# This runs inside Alpine Linux container with Bun support
set -e
EXECUTABLE=$1
TARGET=$2
WORKSPACE_DIR=$(dirname $(dirname $(dirname $(readlink -f "$0"))))
echo "๐งช Running MUSL integration tests for $TARGET"
echo "๐ฆ Executable: $EXECUTABLE"
echo "๐ Workspace: $WORKSPACE_DIR"
# Verify Bun is available (should be pre-installed in Docker image)
if ! command -v bun >/dev/null 2>&1; then
echo "โ Bun not found! Please ensure the Docker image has Bun installed."
exit 1
fi
echo "โ Bun version: $(bun --version)"
# Change to workspace directory
cd "$WORKSPACE_DIR"
# Install dependencies
echo "๐ฆ Installing dependencies..."
bun install --frozen-lockfile
# Run the full TypeScript test suite with --musl flag
echo "๐งช Running full integration test suite..."
bun test/integration/test-binary.ts "$EXECUTABLE" "$TARGET" --musl
echo -e "\nโ All MUSL integration tests passed for $TARGET"