Failure handling (CI)

This commit is contained in:
2026-04-10 18:27:57 +01:00
parent f0019619b3
commit ae419e5e0e
2 changed files with 26 additions and 6 deletions

View File

@@ -41,17 +41,24 @@ check_gen() {
local tmpfile
tmpfile=$(mktemp /tmp/reactics_gen_XXXXXX.drs)
eval "$gen_cmd" > "$tmpfile" 2>&1
if ! eval "$gen_cmd" > "$tmpfile" 2>&1; then
echo " FAIL: $name (generator crashed)"
gen_fail=$((gen_fail + 1))
failed=1
rm -f "$tmpfile"
return
fi
local result
result=$("$REACTICS" -c "$property" "$tmpfile" 2>&1 | grep -oE "(holds|does not hold)" || true)
rm -f "$tmpfile"
if [[ "$result" == "$expected" ]]; then
echo " PASS: $name"
((gen_pass++))
gen_pass=$((gen_pass + 1))
else
echo " FAIL: $name (expected '$expected', got '$result')"
((gen_fail++))
gen_fail=$((gen_fail + 1))
failed=1
fi
}