1# m68000-test-runner 2 3Test harness for testing `m68000-emu` against the 68000 test suite in [TomHarte's CPU tests](https://github.com/TomHarte/ProcessorTests/). 4 5This test harness also compares cycle counts, though any test cases that trigger address errors are ignored for cycle count testing purposes. Test cases that trigger address errors are still run when checking correctness. 6 7To run against a single test: 8``` 9cargo run --release --bin m68000-test-runner -- -f /path/to/test.json.gz 10``` 11 12To run against the full directory of tests: 13``` 14cargo run --release --bin m68000-test-runner -- -d /path/to/ProcessorTests/680x0/68000/v1/ 15``` 16 17Sample output (single test): 18``` 19[2023-09-16T01:49:56Z INFO m68000_test_runner] Loaded 8065 tests 20[2023-09-16T01:49:56Z INFO m68000_test_runner] 0 failed out of 8065 tests in ../ProcessorTests/680x0/68000/v1/MOVEM.w.json.gz 21[2023-09-16T01:49:56Z INFO m68000_test_runner] 0 timing mismatches out of 4281 tests in ../ProcessorTests/680x0/68000/v1/MOVEM.w.json.gz 22``` 23 24## Known Failures 25 26* `ADD.l` / `SUB.l`: The test suite seems to expect `ADDQ.l #<d>, An` and `SUBQ.l #<d>, An` to take 6 cycles, when all documentation I can find suggests that these should take 8 cycles (same as `ADDQ.w` and `SUBQ.w` with an address direct destination) 27* `ASL.b` / `ASR.b` / `ASR.w` / `ASR.l`: The test cases have incorrect flag values, see https://github.com/TomHarte/ProcessorTests/issues/21 28* `DIVS`: The test cases that trigger signed overflow have incorrect cycle counts compared to tests verified on actual hardware (e.g. https://gendev.spritesmind.net/forum/viewtopic.php?f=8&t=3321) 29* `DIVU`: The one test case that triggers a divide by zero exception pushes the wrong PC value onto the stack compared to actual hardware; matching the test case breaks After Burner Complete (32X)