Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/interplane-forge/blob/main/collab/tests/receipt-mutants.sh # interplane-forge INTERPLANE Forge Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `interplane-forge / collab / tests / receipt-mutants.sh` 22 lines ยท 1395 bytes Raw Blame History 1 #!/bin/bash 2 # collab/tests/receipt-mutants.sh: negative controls for receipt.sh and links.sh. Each mutant is one sed 3 # expression on the test build (MUTX); the test must FAIL with it. Prints KILLED or SURVIVED per mutant 4 # and exits nonzero when any mutant survives. Usage: collab/tests/receipt-mutants.sh (CORES default 14) 5 set -u 6 H=$(cd "$(dirname "$0")" && pwd) 7 # A mutant that fails to build is counted SURVIVED: only a failing check kills it. 8 S=0 9 run() { # TEST NAME SED 10 o=$(MUTX=$3 "$H/$1" 2>&1) 11 if [ $? = 0 ] || printf '%s\n' "$o" | grep -q 'BUILD FAILED'; then S=$((S+1)); echo "SURVIVED $1 $2" 12 else echo "KILLED $1 $2: $(printf '%s\n' "$o" | grep '^FAIL' | head -2 | cut -c1-120 | tr '\n' ' ')"; fi 13 } 14 run receipt.sh "negctl_rc 0 not held" 's/^if eq get gcdg 9 0$/if eq get gcdg 9 999/' 15 run receipt.sh "receipt clone checked against the verdict head, not the revision head" 's/^if eq cdhed r get gcdg 7 false$/if eq cdhed r get gcdg 4 false/' 16 run receipt.sh "symlinks followed (no O_NOFOLLOW)" 's/559104/526336/' 17 run receipt.sh "ambiguity scan off" 's/^if lt k 2$/if lt k 99/' 18 run receipt.sh "receipt values shown without the receipt checks" 's/^if eq rc 0$/if true/' 19 run links.sh "letter before issue/ allowed" 's/^ret not and ge c 97 le c 122$/ret true/' 20 run links.sh "6-digit prefixes link" 's/^if or lt n 7 gt n 40$/if or lt n 6 gt n 40/' 21 echo "mutants survived: $S" 22 [ "$S" = 0 ]