Something went wrong. Try again.
An auto tiler for macOS
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233#!/bin/bashset -euo pipefailcd "$(dirname "$0")/.."bin=${1:?Pass the built test directory.}shifthelper="$(dirname "$(xcrun --find swift)")/../libexec/swift/pm/swiftpm-testing-helper"test_bundle="$bin/ParcelPackageTests.xctest/Contents/MacOS/ParcelPackageTests"[[ -x $helper && -f $test_bundle ]] || { printf 'Native test host requires the selected toolchain helper and built test bundle.\n' >&2; exit 2; }mkdir -p .buildwork=$(mktemp -d "$PWD/.build/native-test-host.XXXXXX")trap 'rm -rf "$work"' EXIThost="$work/NativeTests.app/Contents"mkdir -p "$host/MacOS"cp "$helper" "$host/MacOS/swiftpm-testing-helper"cp Scripts/NativeTestHost.plist "$host/Info.plist"frameworks="$(xcrun --show-sdk-platform-path)/Developer/Library/Frameworks${DYLD_FRAMEWORK_PATH:+:$DYLD_FRAMEWORK_PATH}"# Swift Testing loads the test bundle into this helper, not the generated bundle's main executable.command=(env "DYLD_FRAMEWORK_PATH=$frameworks" "$host/MacOS/swiftpm-testing-helper" --test-bundle-path "$test_bundle" "$@" "$test_bundle" --testing-library swift-testing)language=${PARCEL_LOCALIZATION_LANGUAGE:-}if [[ ${PARCEL_PSEUDO_LOCALIZATION:-0} == 1 ]]; then language=en-XA; fiif [[ -n $language ]]; then case "$language" in en|es|fr|de|ja|zh-Hans|ko|pt-BR|en-XA) command+=(-AppleLanguages "($language)") ;; *) printf 'Unsupported native-test language: %s\n' "$language" >&2; exit 2 ;; esacfiif [[ -n ${PARCEL_HEAVY_LOCK_HELD:-} ]]; then "${command[@]}"else printf 'parcel: waiting for the shared build/test lock (/tmp/parcel-heavy.lock)\n' >&2 PARCEL_HEAVY_LOCK_HELD=$$ /usr/bin/lockf -k /tmp/parcel-heavy.lock "${command[@]}"fi