Add new testcases with cc65 support
Some checks failed
Cargo Build & Test / Rust project - latest (stable) (push) Failing after 8s

This commit is contained in:
2025-12-22 02:13:10 -06:00
parent c8d441297e
commit c535e4e76d
30 changed files with 3057 additions and 61 deletions

View File

@@ -1,15 +1,18 @@
use crate::{NES, hex_view::Memory};
mod cpu_reset_ram;
mod instr_test_v3;
use crate::hex_view::Memory;
macro_rules! rom_test {
($name:ident, $rom:literal, |$nes:ident| $eval:expr) => {
rom_test!($name, $rom, timeout = 10000000, |$nes| $eval);
rom_test!($name, $rom, timeout = 10000000, |$nes| $eval);
};
($name:ident, $rom:literal, timeout = $timeout:expr, |$nes:ident| $eval:expr) => {
#[test]
fn $name() {
let rom_file = concat!(env!("ROM_DIR"), "/", $rom);
println!("{}: {}", stringify!($name), rom_file);
let mut $nes = NES::load_nes_file(rom_file).expect("Failed to create nes object");
let mut $nes = crate::NES::load_nes_file(rom_file).expect("Failed to create nes object");
$nes.reset_and_run_with_timeout($timeout);
println!("Final: {:?}", $nes);
$eval
@@ -23,7 +26,7 @@ macro_rules! rom_test {
fn $name() {
let rom_file = $rom;
println!("{}: {}", stringify!($name), rom_file);
let mut $nes = NES::load_nes_file(rom_file).expect("Failed to create nes object");
let mut $nes = crate::NES::load_nes_file(rom_file).expect("Failed to create nes object");
$nes.reset_and_run_with_timeout($timeout);
println!("Final: {:?}", $nes);
$eval
@@ -31,6 +34,8 @@ macro_rules! rom_test {
};
}
pub(crate) use rom_test;
rom_test!(basic_cpu, "basic-cpu.nes", |nes| {
assert_eq!(nes.last_instruction, "0x8001 HLT :2 []");
// Off by one from Mesen, since Mesen doesn't count the clock cycle attempting to execute the 'invalid' opcode