Oregami
Repositories/oxedyne/fe2o3

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.
5D=$(cd "$(dirname "$0")" && pwd)
6P=$D/../heap_probe.mjs
7bad=0
8# file exit text the output must carry
9while 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
19done <<'CASES'
20r061.json 0 R = H_A(300)/H_T(300) = 0.610
21r062.json 0 R = H_A(300)/H_T(300) = 0.620
22r063.json 1 R = H_A(300)/H_T(300) = 0.630
23g047.json 1 = 0.470 MiB a page over 700 pages
24g_per_page_produced.json 1 = 0.470 MiB a page over 650 pages
25incomplete.json 2 gate INCOMPLETE: no measurement for austenite/1000
26CASES
27exit $bad