# SplitBit test manifest
# Written by Anachronaut
#
# One test per line, fields separated by '|'. Blank lines and lines starting
# with '#' are ignored.
#
#   name | source | mode | stdin | limit
#
# source is relative to Programs/. Everything assembles from there with
# Libraries/ on the include path, and the binary is written into Tests/build.
#
# Modes:
#   run       Assemble, execute, compare all output against Tests/expected/<name>.out
#   assemble  Assemble only. For library files that have no entry point to run
#   xfail     Assembly is expected to fail. Records a known breakage so that
#             fixing one is noticed, and so an accidental new one is too
#
# limit is a cycle count, for programs that never halt on their own. It is passed
# to the emulator as --cycles, which bounds the run by cycles rather than by wall
# clock time and so keeps the recorded output identical from one run to the next.
# Every program is run with --fast, since the emulated cycle rate has no bearing
# on what a program prints.

# ---- Programs that halt on their own ----
hello                | hello.asm                          | run      | -                  | -
printHello           | printHello.asm                     | run      | -                  | -
8bitFibonacci        | Fibonacci/8bitFibonacci.asm        | run      | -                  | -
16bitFibonacci       | Fibonacci/16bitFibonacci.asm       | run      | -                  | -
32bitFibonacci       | Fibonacci/32bitFibonacci.asm       | run      | -                  | -
8bitSieve            | primeSieve/8bitSieve.asm           | run      | -                  | -
16bitSegmentedSieve  | primeSieve/16bitSegmentedSieve.asm | run      | -                  | -
# The four pointer rewrite. It emits exactly the same primes as the line above, which
# is the whole point of keeping both: the pair is a direct before and after.
16bitSegmentedSieveModern | primeSieve/16bitSegmentedSieveModern.asm | run | -        | -
mathTest             | testPrograms/mathTest.asm          | run      | -                  | -
printTest            | testPrograms/printTest.asm         | run      | -                  | -
int16print           | Libraries/int16print.asm           | run      | -                  | -

# ---- The multiple Data Pointer behaviour, which nothing else exercises ----
dataPointerTest      | testPrograms/dataPointerTest.asm   | run      | -                  | -
twoPointerCopy       | testPrograms/twoPointerCopy.asm    | run      | -                  | -
pointerTableTest     | testPrograms/pointerTableTest.asm  | run      | -                  | -
staticTableTest      | testPrograms/staticTableTest.asm   | run      | -                  | -
dispatchTest         | testPrograms/dispatchTest.asm      | run      | -                  | -

# ---- Moving an ALU result back into an operand register ----
moveQTest            | testPrograms/moveQTest.asm         | run      | -                  | -

# ---- The memory controller ----
# Reading and writing Program Memory, which the instruction set deliberately cannot do,
# and the bank table that says what is reachable.
controllerReadTest   | testPrograms/controllerReadTest.asm | run     | -                  | -
controllerWriteTest  | testPrograms/controllerWriteTest.asm | run    | -                  | -
# Block transfers: between banks, within one, overlapping, and one that is refused.
blitTest             | testPrograms/blitTest.asm          | run      | -                  | -
# A program that loads a program: blits code into Program Memory, installs a vector at
# run time, and calls it. If the vector install ever silently failed, the SWI would fault
# with "no handler" rather than printing, so this test cannot pass by accident.
loaderTest           | testPrograms/loaderTest.asm        | run      | -                  | -

# Giving a bank number to a device's memory, which is what an OS does at boot.
registerBankTest     | testPrograms/registerBankTest.asm  | run      | -                  | -
# The fence: raised, walked into, clipped by a blit, read through, and lowered again.
fenceTest            | testPrograms/fenceTest.asm         | run      | -                  | -
# Meant to fault: a bank knows how big it is.
bankBoundsTest       | testPrograms/bankBoundsTest.asm    | run      | -                  | -

# ---- A device saying no ----
# Refusing is not interrupting: it stops the instruction that asked, rather than asking
# for attention later. The device on port 0x11 refuses everything so this path stays
# tested before the memory controller becomes its only real user.
refusalTest          | testPrograms/refusalTest.asm       | run      | -                  | -
# The same, with nothing installed to catch it. Meant to fault.
refusalFaultTest     | testPrograms/refusalFaultTest.asm  | run      | -                  | -

# ---- Asking the machine what it is made of ----
registryTest         | testPrograms/registryTest.asm      | run      | -                  | -

# ---- Moving the cursor along ----
paddingTest          | testPrograms/paddingTest.asm       | run      | -                  | -

# ---- Finding the Stack ----
stackPointerTest     | testPrograms/stackPointerTest.asm  | run      | -                  | -

# ---- The Interrupt Flag ----
# Nothing reads the flag yet. This checks that setting and clearing it leaves
# the registers and the Carry Flag it shares a byte with untouched.
interruptFlagTest    | testPrograms/interruptFlagTest.asm | run      | -                  | -

# ---- Vectors laid down by the assembler ----
# These are the interrupt path end to end. Until #Vectors existed, none of them could
# be written as a source file at all, because nothing could install a handler.
vectorTest           | testPrograms/vectorTest.asm        | run      | -                  | -
deviceTest           | testPrograms/deviceTest.asm        | run      | -                  | -
faultResumeTest      | testPrograms/faultResumeTest.asm   | run      | -                  | -
# The worked example out of the Assembler Manual, so the manual cannot go stale.
interruptExample     | testPrograms/interruptExample.asm  | run      | -                  | -

# ---- Holding a device off, and then letting it through ----
# Faults on purpose. The fault is the proof that the line was answered, and where it
# lands in the output is the proof of when.
maskTest             | testPrograms/maskTest.asm          | run      | -                  | -

# ---- Dispatching through a vector with nothing in it ----
# Also meant to fault. Until the assembler can lay a vector table down, every entry
# reads as zero, so this is the only half of the interrupt path a source file can
# reach on its own. The round trip through a handler is covered by hand built
# binaries until #Vectors arrives.
swiFaultTest         | testPrograms/swiFaultTest.asm      | run      | -                  | -

# ---- Meeting a byte that is not an instruction ----
# This one is meant to fault. It checks the CPU stops, says what it found and
# where, and exits non zero, rather than stepping over it and carrying on.
faultTest            | testPrograms/faultTest.asm         | run      | -                  | -

# ---- Programs driven by console input ----
inputTest            | inputTest.asm                      | run      | inputTest.in       | -
inputTestOld         | testPrograms/inputTest.asm         | run      | inputTest.in       | -
replCalculator       | replCalculator.asm                 | run      | replCalculator.in  | -

# ---- Programs that run forever by design, bounded by a cycle count ----
# 3,000,000 cycles is about fourteen generations of the glider, which puts
# evolveBoard and its pointer juggling through its paces many times over.
16x16Life            | gameOfLife/16x16Life.asm           | run      | -                  | 3000000
# The four pointer rewrite, on the same budget so the two can be compared directly.
# Note that this cannot show a speed difference: frameDelay is 255 by 255 and swamps
# the simulation, so both versions render the same fourteen generations and produce
# identical bytes. What it checks is that the rewrite still evolves the board the same
# way, which is what a regression test is for.
16x16LifeModern      | gameOfLife/16x16LifeModern.asm     | run      | -                  | 3000000

# ---- Libraries: no entry point, so only check that they assemble ----
lib-int8             | Libraries/int8.asm                 | assemble | -                  | -
lib-int16            | Libraries/int16.asm                | assemble | -                  | -
lib-int32            | Libraries/int32.asm                | assemble | -                  | -
lib-math             | Libraries/math.asm                 | assemble | -                  | -

# ---- Deliberately broken, to check the assembler still diagnoses them ----
# These are not programs anyone meant to run. Each one contains a single mistake
# that the assembler used to accept quietly, and is here so that it cannot start
# being accepted quietly again.
diagDuplicateLabel   | testPrograms/diagnostics/duplicateLabel.asm | xfail | -       | -
diagBareInclude      | testPrograms/diagnostics/bareInclude.asm    | xfail | -       | -
diagUnknownVector    | testPrograms/diagnostics/unknownVector.asm  | xfail | -       | -
diagDuplicateVector  | testPrograms/diagnostics/duplicateVector.asm | xfail | -      | -
diagBareSWI          | testPrograms/diagnostics/bareSWI.asm        | xfail | -       | -
diagAlignOutside     | testPrograms/diagnostics/alignOutside.asm   | xfail | -       | -
diagBareAlign        | testPrograms/diagnostics/bareAlign.asm      | xfail | -       | -

# ---- Known breakages, recorded rather than ignored ----
# print.asm branches to 'start', which only the including program defines.
lib-print            | Libraries/print.asm                | xfail    | -                  | -
# These three call print.asm routines but have no #Include line at all. They are
# only ever pulled in by printTest.asm, so they are not standalone programs.
printDecimalTest     | testPrograms/printDecimalTest.asm  | xfail    | -                  | -
printDigitTest       | testPrograms/printDigitTest.asm    | xfail    | -                  | -
printHexTest         | testPrograms/printHexTest.asm      | xfail    | -                  | -
# shiftTest calls printDecimal, which print.asm does not have. It looks like the
# routine was renamed and this caller was never updated.
shiftTest            | testPrograms/shiftTest.asm         | xfail    | -                  | -
