test: combined.ww freshness gate in phase-2 (#110)

This commit is contained in:
2026-05-26 01:07:58 +09:00
parent 529eb51af3
commit 68dbb77d6c

View File

@@ -72,6 +72,25 @@ if [ "${UNIT:-0}" != "1" ]; then
name=${t##*/}; name=${name%.c}
"$0" --one "$RESULTS/$name" "$t" || true
done
# combined.ww freshness gate (#110): 990/995 above unconditionally
# regenerate every tracked combined.ww amalgamation, so a diff vs HEAD
# here means an embedded source changed without its derived artifact
# being regenerated + committed (the #28 staleness hole the per-file
# byte-id gates were blind to). git ls-files keeps new combined.ww
# auto-covered (rule-13 SSoT). Lives inside the UNIT guard because
# test-unit skips 990/995 and thus the regen.
name=combined_ww_fresh
if git diff --exit-code -- $(git ls-files '*.combined.ww') > /dev/null 2>&1; then
printf 'ok %s\n' "$name" > "$RESULTS/$name.status"
else
{
printf 'FAIL %s (stale; regen + commit the derived amalgamation)\n' "$name"
echo '--- stale combined.ww ---'
git diff --name-only -- $(git ls-files '*.combined.ww')
} > "$RESULTS/$name.status"
: > "$RESULTS/$name.fail"
fi
fi
fail=0