#!/bin/bash cd "$(dirname "$0")"; export PATH="$HOME/.cargo/bin:$PATH" M="--manifest-path jouleclaw/jouleclaw-rs/Cargo.toml -p jouleclaw-omni" echo "=== metal ===" timeout 3000 cargo check $M --features metal --keep-going --message-format=json -j 6 >/tmp/m5.json 2>/dev/null python3 -c " import json,collections c=collections.Counter(); f=collections.Counter(); t=0 for l in open('/tmp/m5.json'): try: m=json.loads(l) except Exception: continue if m.get('reason')!='compiler-message': continue msg=m.get('message') or {} if msg.get('level')!='error': continue t+=1; c[(msg.get('code') or {}).get('code') or '?']+=1 sp=msg.get('spans') or [] if sp: f[sp[0]['file_name'].split('/')[-1]]+=1 print(f' errors={t} (3063 -> 286 -> 117 -> now)') print(' by code:', dict(c.most_common(9))) print(' worst:', dict(f.most_common(6)))" echo "=== default must stay clean ===" timeout 3000 cargo check $M --keep-going --message-format=json -j 6 >/tmp/d5.json 2>/dev/null python3 -c " import json e=w=0 for l in open('/tmp/d5.json'): try: m=json.loads(l) except Exception: continue if m.get('reason')!='compiler-message': continue lvl=(m.get('message') or {}).get('level') if lvl=='error': e+=1 elif lvl=='warning': w+=1 print(f' errors={e} warnings={w}')" echo "=== tests ===" timeout 3000 cargo test $M -j 6 >/tmp/t5.log 2>&1 && echo " PASS $(grep -m1 'test result:' /tmp/t5.log)" || echo " FAIL"