aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/check.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xscripts/check.sh34
1 files changed, 27 insertions, 7 deletions
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