#!/usr/bin/env bash # Fetch the official YAML test-suite (the canonical YAML 1.2 conformance corpus) into a gitignored # location for the opt-in conformance run. The data is not vendored, keeping the package free of # external content; this script puts it under .build/ (ignored) like the other fetched corpora. # # Usage: # bash scripts/fetch-yaml-test-suite.sh # PUREYAML_RUN_YAML_TEST_SUITE=1 swift test --filter YAMLTestSuiteConformanceTests set -euo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" DEST="$ROOT_DIR/.build/yaml-test-suite" if [ -d "$DEST/.git" ]; then git -C "$DEST" fetch --quiet --depth 1 origin data git -C "$DEST" reset --hard --quiet FETCH_HEAD else rm -rf "$DEST" git clone --quiet --depth 1 --branch data https://github.com/yaml/yaml-test-suite "$DEST" fi cases="$(find "$DEST" -maxdepth 2 -name in.yaml | wc -l | tr -d ' ')" echo "yaml-test-suite ready at $DEST ($cases cases)"