From d790f88554897d06383ca8d78eb9e64d5bb7519d Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 18 Jul 2026 22:37:47 +0200 Subject: scripts/check.sh: Improve UX --- scripts/check.sh | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) (limited to 'scripts/check.sh') diff --git a/scripts/check.sh b/scripts/check.sh index aa21f1e..dbfa67d 100755 --- a/scripts/check.sh +++ b/scripts/check.sh @@ -6,13 +6,33 @@ fmt_check() { echo ".#checks.x86_64-linux.$1" } -nix eval \ - --file "$git_root/scripts/check_get_tests.nix" \ - --raw | while read -r test; do +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'..." - test="$(fmt_check "$test")" - nix build \ + fmt_test="$(fmt_check "$test")" + + if ! nix build \ --option max-jobs 1 \ - --print-out-paths --no-link \ - "$test" + --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 -- cgit v1.3.1