#!/bin/bash # # test.sh # Zyquo Atlas # # Author: Simon-Pierre Boucher # Mail: contact@spboucher.ai # # Runs the test suite. Works with Command Line Tools only (no Xcode): CLT's # Testing.framework isn't on the test bundle's runtime search path, so it is # symlinked into the build products dir before running. # set -euo pipefail cd "$(dirname "$0")/.." CLT="/Library/Developer/CommandLineTools" # See Makefile: the default SDK's SwiftUI macros need Xcode; pin to SDK 26. export SDKROOT="$CLT/SDKs/MacOSX26.sdk" CLT_FRAMEWORKS="$CLT/Library/Developer/Frameworks" TESTING_PLUGINS="$CLT/usr/lib/swift/host/plugins/testing" swift build --build-tests -Xswiftc -plugin-path -Xswiftc "$TESTING_PLUGINS" for products in .build/out/Products/Debug .build/debug; do if [ -d "$products" ]; then mkdir -p "$products/PackageFrameworks" for fw in "$CLT_FRAMEWORKS"/*.framework; do name="$(basename "$fw")" ln -sfn "$fw" "$products/PackageFrameworks/$name" done ln -sfn "$CLT/Library/Developer/usr/lib/lib_TestingInterop.dylib" \ "$products/PackageFrameworks/lib_TestingInterop.dylib" fi done swift test --skip-build "$@"