#[cfg(test)]
mod tests {
    use crate::{setup_rom_console_test, setup_rom_test};

    // apu_reset
    setup_rom_test!(
        test_4015_cleared,
        "roms/nes/automated_tests/apu_reset/4015_cleared.nes"
    );
    setup_rom_test!(
        test_4017_timing,
        "roms/nes/automated_tests/apu_reset/4017_timing.nes"
    );
    setup_rom_test!(
        test_4017_written,
        "roms/nes/automated_tests/apu_reset/4017_written.nes"
    );
    setup_rom_test!(
        test_irq_flag_cleared,
        "roms/nes/automated_tests/apu_reset/irq_flag_cleared.nes"
    );
    setup_rom_test!(
        test_len_ctrs_enabled,
        "roms/nes/automated_tests/apu_reset/len_ctrs_enabled.nes"
    );
    setup_rom_test!(
        test_works_immediately,
        "roms/nes/automated_tests/apu_reset/works_immediately.nes"
    );

    // apu_test
    // setup_rom_test!(
    //     test_apu_test,
    //     "roms/nes/automated_tests/apu_test/apu_test.nes"
    // );
    setup_rom_test!(
        test_apu_test_1,
        "roms/nes/automated_tests/apu_test/rom_singles/1-len_ctr.nes"
    );
    setup_rom_test!(
        test_apu_test_2,
        "roms/nes/automated_tests/apu_test/rom_singles/2-len_table.nes"
    );
    setup_rom_test!(
        test_apu_test_3,
        "roms/nes/automated_tests/apu_test/rom_singles/3-irq_flag.nes"
    );
    setup_rom_test!(
        test_apu_test_4,
        "roms/nes/automated_tests/apu_test/rom_singles/4-jitter.nes"
    );
    setup_rom_test!(
        test_apu_test_5,
        "roms/nes/automated_tests/apu_test/rom_singles/5-len_timing.nes"
    );
    setup_rom_test!(
        test_apu_test_6,
        "roms/nes/automated_tests/apu_test/rom_singles/6-irq_flag_timing.nes"
    );
    setup_rom_test!(
        test_apu_test_7,
        "roms/nes/automated_tests/apu_test/rom_singles/7-dmc_basics.nes"
    );
    setup_rom_test!(
        test_apu_test_8,
        "roms/nes/automated_tests/apu_test/rom_singles/8-dmc_rates.nes"
    );

    // blargg_apu_2005.07.30
    setup_rom_console_test!(
        test_blargg_apu_01,
        "roms/nes/automated_tests/blargg_apu_2005.07.30/01.len_ctr.nes",
        "$01"
    );
    setup_rom_console_test!(
        test_blargg_apu_02,
        "roms/nes/automated_tests/blargg_apu_2005.07.30/02.len_table.nes",
        "$01"
    );
    setup_rom_console_test!(
        test_blargg_apu_03,
        "roms/nes/automated_tests/blargg_apu_2005.07.30/03.irq_flag.nes",
        "$01"
    );
    setup_rom_console_test!(
        test_blargg_apu_04,
        "roms/nes/automated_tests/blargg_apu_2005.07.30/04.clock_jitter.nes",
        "$01"
    );
    setup_rom_console_test!(
        test_blargg_apu_05,
        "roms/nes/automated_tests/blargg_apu_2005.07.30/05.len_timing_mode0.nes",
        "$01"
    );
    setup_rom_console_test!(
        test_blargg_apu_06,
        "roms/nes/automated_tests/blargg_apu_2005.07.30/06.len_timing_mode1.nes",
        "$01"
    );
    setup_rom_console_test!(
        test_blargg_apu_07,
        "roms/nes/automated_tests/blargg_apu_2005.07.30/07.irq_flag_timing.nes",
        "$01"
    );
    setup_rom_console_test!(
        test_blargg_apu_08,
        "roms/nes/automated_tests/blargg_apu_2005.07.30/08.irq_timing.nes",
        "$01"
    );
    setup_rom_console_test!(
        test_blargg_apu_09,
        "roms/nes/automated_tests/blargg_apu_2005.07.30/09.reset_timing.nes",
        "$01"
    );
    setup_rom_console_test!(
        test_blargg_apu_10,
        "roms/nes/automated_tests/blargg_apu_2005.07.30/10.len_halt_timing.nes",
        "$01"
    );
    setup_rom_console_test!(
        test_blargg_apu_11,
        "roms/nes/automated_tests/blargg_apu_2005.07.30/11.len_reload_timing.nes",
        "$01"
    );

    // pal_apu_tests
    setup_rom_console_test!(
        test_pal_apu_tests_1,
        "roms/nes/automated_tests/pal_apu_tests/01.len_ctr.nes",
        "PASSED",
        crate::nes::console::TimingMode::Pal
    );
    setup_rom_console_test!(
        test_pal_apu_tests_2,
        "roms/nes/automated_tests/pal_apu_tests/02.len_table.nes",
        "PASSED",
        crate::nes::console::TimingMode::Pal
    );
    setup_rom_console_test!(
        test_pal_apu_tests_3,
        "roms/nes/automated_tests/pal_apu_tests/03.irq_flag.nes",
        "PASSED",
        crate::nes::console::TimingMode::Pal
    );
    setup_rom_console_test!(
        test_pal_apu_tests_4,
        "roms/nes/automated_tests/pal_apu_tests/04.clock_jitter.nes",
        "PASSED",
        crate::nes::console::TimingMode::Pal
    );
    setup_rom_console_test!(
        test_pal_apu_tests_5,
        "roms/nes/automated_tests/pal_apu_tests/05.len_timing_mode0.nes",
        "PASSED",
        crate::nes::console::TimingMode::Pal
    );
    setup_rom_console_test!(
        test_pal_apu_tests_6,
        "roms/nes/automated_tests/pal_apu_tests/06.len_timing_mode1.nes",
        "PASSED",
        crate::nes::console::TimingMode::Pal
    );
    setup_rom_console_test!(
        test_pal_apu_tests_7,
        "roms/nes/automated_tests/pal_apu_tests/07.irq_flag_timing.nes",
        "PASSED",
        crate::nes::console::TimingMode::Pal
    );
    setup_rom_console_test!(
        test_pal_apu_tests_8,
        "roms/nes/automated_tests/pal_apu_tests/08.irq_timing.nes",
        "PASSED",
        crate::nes::console::TimingMode::Pal
    );
    setup_rom_console_test!(
        test_pal_apu_tests_10,
        "roms/nes/automated_tests/pal_apu_tests/10.len_halt_timing.nes",
        "PASSED",
        crate::nes::console::TimingMode::Pal
    );
    setup_rom_console_test!(
        test_pal_apu_tests_11,
        "roms/nes/automated_tests/pal_apu_tests/11.len_reload_timing.nes",
        "PASSED",
        crate::nes::console::TimingMode::Pal
    );

    setup_rom_console_test!(
        test_apu_2_test_1,
        "roms/nes/automated_tests/test_apu_2/test_1.nes"
    );
    setup_rom_console_test!(
        test_apu_2_test_2,
        "roms/nes/automated_tests/test_apu_2/test_2.nes"
    );
    setup_rom_console_test!(
        test_apu_2_test_3,
        "roms/nes/automated_tests/test_apu_2/test_3.nes"
    );
    setup_rom_console_test!(
        test_apu_2_test_4,
        "roms/nes/automated_tests/test_apu_2/test_4.nes"
    );
    setup_rom_console_test!(
        test_apu_2_test_5,
        "roms/nes/automated_tests/test_apu_2/test_5.nes"
    );
    setup_rom_console_test!(
        test_apu_2_test_6,
        "roms/nes/automated_tests/test_apu_2/test_6.nes"
    );
    setup_rom_console_test!(
        test_apu_2_test_7,
        "roms/nes/automated_tests/test_apu_2/test_7.nes"
    );
    setup_rom_console_test!(
        test_apu_2_test_8,
        "roms/nes/automated_tests/test_apu_2/test_8.nes"
    );
    setup_rom_console_test!(
        test_apu_2_test_9,
        "roms/nes/automated_tests/test_apu_2/test_9.nes"
    );
    setup_rom_console_test!(
        test_apu_2_test_10,
        "roms/nes/automated_tests/test_apu_2/test_10.nes"
    );

    // test_amu_m
    setup_rom_console_test!(
        test_apu_m_test_9,
        "roms/nes/automated_tests/test_apu_m/test_9.nes"
    );
    setup_rom_console_test!(
        test_apu_m_test_10,
        "roms/nes/automated_tests/test_apu_m/test_10.nes"
    );
    setup_rom_console_test!(
        test_apu_m_test_11,
        "roms/nes/automated_tests/test_apu_m/test_11.nes"
    );
}
