plum

#treesitter#compiler#wasm

git clone https://git.pyrossh.dev/plum

A statically typed, imperative programming language inspired by rust, python


b29ed38 — Peter John 2026-11-10T10:21:32+05:30
test-all: a failed sweep lists its failed tests, panics and errors under their file
Files changed (1) hide show
  1. compiler/scripts/test-all.sh +18 -1
compiler/scripts/test-all.sh CHANGED
@@ -50,6 +50,23 @@ $(grep -E '^test .* FAILED$' "$tmp/$n.out")"
50
50
  fi
51
51
  done < "$tmp/list"
52
52
 
53
+ # A failed sweep's report: each failed test (`✘`, with the assert report indented under it), each
54
+ # `PANIC` and `error:` line, under the `=== file ===` header it belongs to. Summary lines
55
+ # ("N passed, 0 failed") are left out.
56
+ failureLines() {
57
+ awk '
58
+ /^=== .* ===$/ { header = $0; shown = 0; report = 0; next }
59
+ /✘|PANIC|error:/ {
60
+ if (!shown) { print header; shown = 1 }
61
+ print
62
+ report = ($0 ~ /✘/)
63
+ next
64
+ }
65
+ report && /^(│| )/ { print; next }
66
+ { report = 0 }
67
+ '
68
+ }
69
+
53
70
  for flag in "" --no-fbip --no-fusion; do
54
71
  # shellcheck disable=SC2086
55
72
  out=$(target/debug/plum test $flag std examples tests 2>&1)
@@ -59,7 +76,7 @@ for flag in "" --no-fbip --no-fusion; do
59
76
  echo "FAIL sweep ${flag:-default}"
60
77
  fail=$((fail + 1))
61
78
  failed_names="$failed_names
62
- $(echo "$out" | grep -iE 'fail' | head -20)"
79
+ $(echo "$out" | failureLines | head -80)"
63
80
  fi
64
81
  done
65
82