melonds-ds/test
Jesse Talavera-Greenberg f042dd2115 Update melonDS
- The threaded software renderer is now available
2024-01-07 19:24:59 -05:00
..
cmake Add some more test cases 2023-12-21 08:37:26 -05:00
lua Add some more test cases 2023-12-21 08:37:26 -05:00
python Add some comments for later 2023-09-20 20:55:42 -04:00
CMakeLists.txt Update melonDS 2024-01-07 19:24:59 -05:00
README.md Fix a typo in the docs 2023-11-27 10:36:50 -05:00

melonDS DS Test Suite

melonDS DS features a suite of regression tests that reduce the chance of changes breaking things.

This document describes how to use the test suite.

Usage

Prerequisites

Before you can run the test suite, you must be able to build melonDS DS through the steps described in the main README.

Extra Dependencies

Once you do that, you'll need to obtain the following dependencies:

Configuring the Tests

Once you have all of the above, you'll need to run cmake on the project with the following variables defined on the command line:

  • BUILD_TESTING: Set to ON to enable the test suite.
  • ARM7_BIOS: Set to the location of your NDS ARM7 BIOS image.
  • ARM9_BIOS: Set to the location of your NDS ARM9 BIOS image.
  • ARM7_DSI_BIOS: Set to the location of your DSi ARM7 BIOS image.
  • ARM9_DSI_BIOS: Set to the location of your DSi ARM9 BIOS image.
  • NDS_FIRMWARE: Set to the location of your NDS firmware image.
  • DSI_FIRMWARE: Set to the location of your DSi firmware image.
  • DSI_NAND: Set to the location of your DSi NAND image.
  • NDS_ROM: Set to the location of your NDS ROM image.
  • RETROARCH: Set to the location of the RetroArch executable. Not necessary if it's on your PATH.
  • EMU_TEST: Set to the location of the Emutest executable. Not necessary if it's on your PATH.

Note

The test suite will not modify these files; they will be copied into appropriate directories before each test.

Here's an example:


cmake -B build \
    -DBUILD_TESTING=ON \
    -DARM7_BIOS="$SYSTEM_PATH/bios7.bin" \
    -DARM9_BIOS="$SYSTEM_PATH/bios9.bin" \
    -DARM7_DSI_BIOS="$SYSTEM_PATH/dsi_bios7.bin" \
    -DARM9_DSI_BIOS="$SYSTEM_PATH/dsi_bios9.bin" \
    -DNDS_FIRMWARE="$SYSTEM_PATH/firmware.bin" \
    -DDSI_FIRMWARE="$SYSTEM_PATH/dsi_firmware.bin" \
    -DDSI_NAND="$SYSTEM_PATH/dsi_nand.bin" \
    -DNDS_ROM="$ROM_PATH/your_nds_rom.nds" \
    -DRETROARCH="$RETROARCH_PATH/retroarch" \
    -DEMU_TEST="$EMUTEST_PATH/emutest"

You may want to put these variables in a script or an IDE configuration.

Running the Tests

Build melonDS DS as usual. After that finishes, call ctest from within the CMake build directory to run the test suite.

git clone https://github.com/JesseTG/melonds-ds
cd melonds-ds
cmake -B build # Generate the build system
cmake --build build # Build the project
ctest --test-dir build # Run the tests. (CTest is included with CMake)

Warning

There are different revisions of the DS and DSi's system files. The test suite itself doesn't care which ones you use, but certain bugs may only appear with particular firmware revisions. If you can't reproduce a bug that should cause a test to fail, try a different firmware image.