oxedyne/fe2o3/fe2o3_austenite/tools/heap_gate/check.sh
1.0 KiB, 1 run, executable
created by r1870400018:66280, which is this file's identity for as long as the history lasts, whatever it is later renamed to
download · who wrote it · its history
| 1 | #!/bin/bash |
| 2 | # check.sh -- the memory gate's own check: heap_probe.mjs --gate-file on synthetic measurements whose |
| 3 | # median ratio and growth are known, each with the exit status and the ratio it must give. Run it from |
| 4 | # anywhere; it needs only node. Exit status 0 when every case behaves. |
| 5 | D=$(cd "$(dirname "$0")" && pwd) |
| 6 | P=$D/../heap_probe.mjs |
| 7 | bad=0 |
| 8 | # file exit text the output must carry |
| 9 | while read -r f want text; do |
| 10 | out=$(node "$P" --gate-file "$D/$f" 2>&1) |
| 11 | got=$? |
| 12 | if [ "$got" != "$want" ] || ! grep -qF -- "$text" <<<"$out"; then |
| 13 | echo "RED $f: exit $got (wanted $want), wanted the text '$text'" |
| 14 | echo "$out" | sed 's/^/ /' |
| 15 | bad=1 |
| 16 | else |
| 17 | echo "ok $f: exit $got, '$text'" |
| 18 | fi |
| 19 | done <<'CASES' |
| 20 | r061.json 0 R = H_A(300)/H_T(300) = 0.610 |
| 21 | r062.json 0 R = H_A(300)/H_T(300) = 0.620 |
| 22 | r063.json 1 R = H_A(300)/H_T(300) = 0.630 |
| 23 | g047.json 1 = 0.470 MiB a page over 700 pages |
| 24 | g_per_page_produced.json 1 = 0.470 MiB a page over 650 pages |
| 25 | incomplete.json 2 gate INCOMPLETE: no measurement for austenite/1000 |
| 26 | CASES |
| 27 | exit $bad |