Branchwell

Voxley / app · voxley.si / Scripts / test-app.sh

1#!/bin/bash
2set -euo pipefail
3root="$(cd "$(dirname "$0")/.." && pwd)"
4output="/Volumes/Expand/Projects/Voxley/app-work"
5[[ -d /Volumes/Expand ]] || { echo 'Mount Expand before testing Voxley.' >&2; exit 1; }
6mkdir -p "$output/Build/tmp" "$output/Build/modules" "$output/Build/cache"
7export TMPDIR="$output/Build/tmp/"
8export CLANG_MODULE_CACHE_PATH="$output/Build/modules"
9export SWIFTPM_MODULECACHE_OVERRIDE="$output/Build/modules"
10if [[ "${1:-}" == --with-models ]]; then
11 export VOXLEY_TEST_AUDIO="$output/Build/tmp/apple-model-test.aiff"
12 /usr/bin/say -v Samantha -o "$VOXLEY_TEST_AUDIO" 'Please bring the purple elephant sketch to the meeting.'
13fi
14xcrun swift test --no-parallel --package-path "$root" --scratch-path "$output/Build/swiftpm" --cache-path "$output/Build/cache"