A fresh disk for every test, fixtures included
A fixture built by makedisks.sh was handed to each test where it lay. Twenty four tests name disks/cosmos.img and several of them write to one, so a test could hand the next one a disk with its leavings on. romBoot is what found it. Its recorded output described a directory that selfBoot had made earlier in the same run, so it passed in a full run and failed on its own - which is the worst way round for a test to be wrong, because the form nobody runs is the one telling the truth. Its recording now says "made" like selfBoot's, which is what running the same input on the same disk should always have said. Fixed as a class rather than as an instance: run.sh copies a fixture before attaching it, the same way it already removed a scratch image. Then every one of the 138 run and rom tests was run on its own to see whether anything else was leaning on what ran before it. Nothing was, before or after. Also, cosmosEditKeys.in was written by Python's write_text, which encodes as UTF-8, so every key byte was 0xC2 and then the key. The test passed anyway, because the shell ignores a byte it has no use for - a fixture working for a reason it was not built on, which is exactly the thing that stops working without anybody touching it. Written as bytes now; the recording is unchanged, which is the proof the stray bytes were being ignored. docs.sh is what caught that, and it turns out to draw the line in the right place by construction: a deliberately binary fixture does not decode as UTF-8 and is skipped, while one that is accidentally UTF-8 decodes and is reported. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E2JrLzFvuFX9fgi1LDRjrW
This commit is contained in:
co-authored by
Claude Opus 5
parent
736037462e
commit
373454ec00
@@ -9,7 +9,7 @@ deleted it
|
||||
and it is gone
|
||||
finished
|
||||
> mkdir Notes
|
||||
cannot make that: check the path, the name, and whether it is taken
|
||||
made
|
||||
> cd Notes
|
||||
/Notes> dir
|
||||
0 files
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
eco okh
|
||||
Xecho ok
|
||||
echo o
k
|
||||
eco ok„��h
|
||||
Xecho ok„†
|
||||
echo o„…k
|
||||
echo okX
|
||||
echo ko
|
||||
Xecho aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
!
|
||||
echo k‚o
|
||||
Xecho aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa„†…!
|
||||
exit
|
||||
|
||||
+20
-8
@@ -248,9 +248,9 @@ while IFS='|' read -r name src mode stdin limit disk keys; do
|
||||
EMUARGS+=(--keyboard "$INPUT/$keys")
|
||||
fi
|
||||
[ "$limit" != "-" ] && EMUARGS+=(--cycles "$limit")
|
||||
# A disk starts fresh for every run, so a test cannot pass because of what a
|
||||
# previous one left lying on it. The emulator makes the image if it is
|
||||
# missing, which is what removing it first arranges for.
|
||||
# A disk starts fresh for every test, so a test cannot pass because of what a
|
||||
# previous one left lying on it. How that is arranged differs between a scratch
|
||||
# image and a built fixture, and both are below.
|
||||
# ---- More than one, separated by a plus ----
|
||||
#
|
||||
# The machine has four drives, so a test may name up to four images and they
|
||||
@@ -277,12 +277,24 @@ while IFS='|' read -r name src mode stdin limit disk keys; do
|
||||
case "$DISKFILE" in
|
||||
*@*) DISKWAIT="${DISKFILE##*@}"; DISKFILE="${DISKFILE%@*}" ;;
|
||||
esac
|
||||
# A name with a directory in it is one of the images makedisks.sh built,
|
||||
# and is used as it stands. A bare name is scratch: it is removed first so
|
||||
# that nothing a test writes can be seen by the next one, and the emulator
|
||||
# makes a blank image in its place.
|
||||
# ---- A fresh disk for every test, whichever kind it is ----
|
||||
#
|
||||
# A bare name is scratch: it is removed, and the emulator makes a blank image
|
||||
# in its place.
|
||||
#
|
||||
# A name with a directory in it is one of the images makedisks.sh built, and
|
||||
# it is COPIED rather than used where it lies. Twenty four tests name
|
||||
# disks/cosmos.img and several of them write to it, so a test used to be able
|
||||
# to hand the next one a disk with its leavings on. That is not hypothetical:
|
||||
# romBoot's recorded output described a directory that selfBoot had made, so
|
||||
# it passed in a full run and failed on its own, which is the worst way round
|
||||
# for a test to be wrong.
|
||||
case "$DISKFILE" in
|
||||
*/*) ;;
|
||||
*/*)
|
||||
mkdir -p "$BUILD/.fixture"
|
||||
cp "$BUILD/$DISKFILE" "$BUILD/.fixture/${DISKFILE##*/}"
|
||||
DISKFILE=".fixture/${DISKFILE##*/}"
|
||||
;;
|
||||
*) rm -f "$BUILD/$DISKFILE" ;;
|
||||
esac
|
||||
EMUARGS+=(--disk "$BUILD/$DISKFILE")
|
||||
|
||||
Reference in New Issue
Block a user