Make xfail compare the diagnostic, not just the failure
The Test Manual said an xfail test records the assembler's refusal message and so catches both an error that stops being detected and a message that changes without anybody meaning it to. It did not. run.sh checked only that the assembler exited non zero, printed the first line for a person to read, and compared nothing; --bless recorded nothing for these sixteen tests at all. So an xfail passed four different ways that look identical from outside: the intended error fired, an unrelated error fired, the message changed, or the assembler fell over on its way to the point. That is the documentation describing behaviour the code does not have, which is the exact failure Tests/docs.sh exists to prevent, in the manual that argues for knowing what your evidence is worth. The diagnostic is now stripped of colour, given the same [exit N] line every other recorded result carries, and compared through check() like anything else. Sixteen results recorded; every existing one is byte for byte unchanged. Verified the way the manual asks: one diagnostic was broken on purpose, its test failed with the changed line in the diff, and its neighbour passed. Found by ChatGPT reviewing the manual. 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
999451e935
commit
8fbbeb6ec9
@@ -0,0 +1,4 @@
|
||||
Error: #Align outside the Program or Data Segment.
|
||||
There is nothing there for it to move along.
|
||||
File: testPrograms/diagnostics/alignOutside.asm at line 6.
|
||||
[exit 1]
|
||||
@@ -0,0 +1,3 @@
|
||||
Error: #Align without a number.
|
||||
File: testPrograms/diagnostics/bareAlign.asm at line 11.
|
||||
[exit 1]
|
||||
@@ -0,0 +1,3 @@
|
||||
Error: #Include without a file name.
|
||||
File: testPrograms/diagnostics/bareInclude.asm at line 11.
|
||||
[exit 1]
|
||||
@@ -0,0 +1,4 @@
|
||||
Error: SWI without a vector to go to.
|
||||
File: testPrograms/diagnostics/bareSWI.asm at line 9.
|
||||
Token: SWI
|
||||
[exit 1]
|
||||
@@ -0,0 +1,3 @@
|
||||
Error: Label "twice" is defined more than once.
|
||||
File: testPrograms/diagnostics/duplicateLabel.asm at line 13.
|
||||
[exit 1]
|
||||
@@ -0,0 +1,3 @@
|
||||
Error: That vector already has a handler.
|
||||
File: testPrograms/diagnostics/duplicateVector.asm at line 20.
|
||||
[exit 1]
|
||||
@@ -0,0 +1,6 @@
|
||||
Error: 100 is not a vector number that can be given.
|
||||
Numbers below 16 belong to the machine, and 64 and up are
|
||||
handed out by the assembler. A vector two programs have to
|
||||
agree about takes one from 16 to 63.
|
||||
File: testPrograms/diagnostics/pinnedVectorRange.asm at line 19.
|
||||
[exit 1]
|
||||
@@ -0,0 +1,4 @@
|
||||
Error: Another vector already has that number.
|
||||
File: testPrograms/diagnostics/pinnedVectorTaken.asm at line 28.
|
||||
Token: second
|
||||
[exit 1]
|
||||
@@ -0,0 +1,8 @@
|
||||
Error: A string cannot go in the Program Segment.
|
||||
Strings live in Data Memory, which is the only memory an instruction
|
||||
can read. A string in Program Memory could not be reached even by the
|
||||
program holding it, except through the memory controller.
|
||||
File: testPrograms/diagnostics/stringInProgram.asm at line 19.
|
||||
The string: "this is not where this goes"
|
||||
Move it below a #Data line.
|
||||
[exit 1]
|
||||
@@ -0,0 +1,6 @@
|
||||
Error: The Program Segment is based at 0x2000, but the Data Segment
|
||||
has 1 byte at 0x0000 and was never given a #Base.
|
||||
Half a program loaded at zero lands on whatever is already there.
|
||||
File: testPrograms/diagnostics/unbasedSegment.asm
|
||||
Say "#Base 0x0000" in the Data Segment if that is what you meant.
|
||||
[exit 1]
|
||||
@@ -0,0 +1,4 @@
|
||||
Error: "neverDeclared" is not a vector.
|
||||
Names used with SWI have to be given a handler in a #Vectors section.
|
||||
File: testPrograms/diagnostics/unknownVector.asm at line 9.
|
||||
[exit 1]
|
||||
@@ -0,0 +1,3 @@
|
||||
Error: Undefined label "start".
|
||||
File: Libraries/print.asm at line 8.
|
||||
[exit 1]
|
||||
@@ -0,0 +1,3 @@
|
||||
Error: Undefined label "printByteDecimal".
|
||||
File: testPrograms/printDecimalTest.asm at line 9.
|
||||
[exit 1]
|
||||
@@ -0,0 +1,3 @@
|
||||
Error: Undefined label "printDecimalDigit".
|
||||
File: testPrograms/printDigitTest.asm at line 6.
|
||||
[exit 1]
|
||||
@@ -0,0 +1,3 @@
|
||||
Error: Undefined label "printByteHex".
|
||||
File: testPrograms/printHexTest.asm at line 8.
|
||||
[exit 1]
|
||||
@@ -0,0 +1,3 @@
|
||||
Error: Undefined label "printDecimal".
|
||||
File: testPrograms/shiftTest.asm at line 12.
|
||||
[exit 1]
|
||||
Reference in New Issue
Block a user