#!/bin/sh # Replays every scenario under packages/core/test/scenarios in the Swift core # and writes the reference result next to it (.swift.json). # Needs Docker; the TypeScript tests only read the written files. set -eu here="$(cd "$(dirname "$0")" && pwd)" root="$(cd "$here/../.." && pwd)" [ -d "$here/Sources/FiliusCore" ] || "$here/fetch-upstream.sh" # A failed build must stop here: a stale binary would write stale references. docker run --rm -v "$root:/work" -w /work/tools/swift-oracle swift:6.1-jammy sh -c ' set -e swift build -q .build/debug/Oracle /work/packages/core/test/scenarios .build/debug/Oracle --corpus /work/corpus /work/corpus/corpus.swift.json'