#! /usr/bin/env sh git_root="$(git rev-parse --show-toplevel)" fmt_check() { echo ".#checks.x86_64-linux.$1" } failed="$(mktemp -t server_check_XXXXX)" trap 'rm -f "$failed"' EXIT trap 'exit 4' HUP INT QUIT TERM # We want word-splitting for the arg # shellcheck disable=SC2046 set -- $(nix eval --file "$git_root/scripts/check_get_tests.nix" --raw) while [ "$#" -ne 0 ]; do test="$1" shift 1 echo "Building test '$test'..." fmt_test="$(fmt_check "$test")" if ! nix build \ --option max-jobs 1 \ --print-out-paths \ --no-link \ "$fmt_test"; then echo "$test" >>"$failed" fi done if [ "$(cat "$failed" | wc -l)" -ne 0 ]; then echo "Failed tests:" while read -r test; do echo " - $test" done <"$failed" fi