add_executable(test_common test_common.cpp)
target_link_libraries(test_common PRIVATE ntr_common)
add_test(NAME common COMMAND test_common)

# AES and the Wii disc reader, against the published test vectors and a disc made up in the test (no game data).
add_executable(test_wii_disc test_wii_disc.cpp)
target_link_libraries(test_wii_disc PRIVATE ntr_common)
add_test(NAME wii_disc COMMAND test_wii_disc)

# Frame interpolation's stream matching and blending (no melonDS or game data needed).
add_executable(test_gx test_gx.cpp ${PROJECT_SOURCE_DIR}/runtime/src/gx_match.cpp)
target_include_directories(test_gx PRIVATE ${PROJECT_SOURCE_DIR}/runtime/src)
add_test(NAME gx COMMAND test_gx)

# What the DS sees of the host's buttons (taps, mashing) against a game that reads them every second frame.
add_executable(test_input test_input.cpp)
target_include_directories(test_input PRIVATE ${PROJECT_SOURCE_DIR}/runtime/src)
add_test(NAME input COMMAND test_input)

# settings.ini round trip and the controls window's binding rules.
add_executable(test_settings test_settings.cpp ${PROJECT_SOURCE_DIR}/game/src/settings.cpp ${PROJECT_SOURCE_DIR}/game/src/input.cpp)
target_include_directories(test_settings PRIVATE ${PROJECT_SOURCE_DIR}/game/src)
target_link_libraries(test_settings PRIVATE ntr_runtime ntr_common SDL3::SDL3-static)
add_test(NAME settings COMMAND test_settings)

# The UI on its own: first run, prelaunch and the settings tabs; any "ui:" warning fails it (tests/ui_smoke.cmake).
if(TARGET ffcc)
  add_test(NAME ui_smoke COMMAND ${CMAKE_COMMAND} -DFFCC=$<TARGET_FILE:ffcc> -DSCRIPT=${CMAKE_CURRENT_SOURCE_DIR}/ui_smoke.txt
                  -P ${CMAKE_CURRENT_SOURCE_DIR}/ui_smoke.cmake)
endif()

# The game's icon: the banner's picture and the .ico written into the exe (made-up banner, no game data).
add_executable(test_icon test_icon.cpp ${PROJECT_SOURCE_DIR}/game/src/app_icon.cpp)
target_include_directories(test_icon PRIVATE ${PROJECT_SOURCE_DIR}/game/src)
target_link_libraries(test_icon PRIVATE SDL3::SDL3-static)
if(WIN32)
  target_link_libraries(test_icon PRIVATE user32 shell32)
endif()
add_test(NAME icon COMMAND test_icon)

# Scripted input and its recorder: the recording round trip, marks, and the settings a recording requires.
add_executable(test_input_script test_input_script.cpp ${PROJECT_SOURCE_DIR}/game/src/input_script.cpp)
target_include_directories(test_input_script PRIVATE ${PROJECT_SOURCE_DIR}/game/src)
target_link_libraries(test_input_script PRIVATE ntr_runtime ntr_common)
add_test(NAME input_script COMMAND test_input_script)

# The spell radial's sector picking (no SDL or game data needed).
add_executable(test_spell_ring test_spell_ring.cpp ${PROJECT_SOURCE_DIR}/game/src/spell_ring.cpp)
target_include_directories(test_spell_ring PRIVATE ${PROJECT_SOURCE_DIR}/game/src)
add_test(NAME spell_ring COMMAND test_spell_ring)

# The update check's release list, version comparison and notes (no network needed).
add_executable(test_release_info test_release_info.cpp ${PROJECT_SOURCE_DIR}/game/src/release_info.cpp)
target_include_directories(test_release_info PRIVATE ${PROJECT_SOURCE_DIR}/game/src)
add_test(NAME release_info COMMAND test_release_info)
