Add comprehensive tests for collision detection, entity dispatch, file system, isometric controls, map rendering, and sorting

- Implemented collision tests to verify overlap and movement logic for collision bodies.
- Enhanced entity dispatch entry tests to cover initialization, group ID management, and process handling.
- Expanded file system tests to include crash diagnostics and ensure proper game data root detection.
- Created isometric controls tests to validate movement requests and screen projection calculations.
- Added map renderer tests to check fixed map loading and rendering functionality.
- Introduced map sorter tests to confirm correct rendering order for various items.
This commit is contained in:
Maddo 2026-09-25 21:41:20 +02:00
commit 202679f857
27 changed files with 3530 additions and 81 deletions

View file

@ -3,13 +3,16 @@ cmake_minimum_required(VERSION 3.20)
project(remorse_rebuild LANGUAGES CXX)
add_library(remorse_core
src/animation_archive.cpp
src/combat_tactics.cpp
src/collision.cpp
src/entity_dispatch_entry.cpp
src/file_system.cpp
src/flex_archive.cpp
src/fixed_map.cpp
src/glob_archive.cpp
src/map_renderer.cpp
src/map_sorter.cpp
src/palette.cpp
src/runtime.cpp
src/shape_archive.cpp
@ -31,6 +34,13 @@ add_executable(remorse_map_preview
target_link_libraries(remorse_map_preview PRIVATE remorse_core)
if(WIN32)
add_executable(remorse_game WIN32
src/windowed_game_main.cpp
)
target_link_libraries(remorse_game PRIVATE remorse_core user32 gdi32)
endif()
enable_testing()
add_executable(entity_dispatch_entry_tests
@ -105,6 +115,38 @@ target_link_libraries(map_renderer_tests PRIVATE remorse_core)
add_test(NAME map_renderer_tests COMMAND map_renderer_tests)
add_executable(map_sorter_tests
tests/map_sorter_tests.cpp
)
target_link_libraries(map_sorter_tests PRIVATE remorse_core)
add_test(NAME map_sorter_tests COMMAND map_sorter_tests)
add_executable(isometric_controls_tests
tests/isometric_controls_tests.cpp
)
target_link_libraries(isometric_controls_tests PRIVATE remorse_core)
add_test(NAME isometric_controls_tests COMMAND isometric_controls_tests)
add_executable(animation_archive_tests
tests/animation_archive_tests.cpp
)
target_link_libraries(animation_archive_tests PRIVATE remorse_core)
add_test(NAME animation_archive_tests COMMAND animation_archive_tests)
add_executable(collision_tests
tests/collision_tests.cpp
)
target_link_libraries(collision_tests PRIVATE remorse_core)
add_test(NAME collision_tests COMMAND collision_tests)
add_executable(combat_tactics_tests
tests/combat_tactics_tests.cpp
)
@ -117,7 +159,14 @@ if(MSVC)
target_compile_options(remorse_core PRIVATE /W4 /permissive-)
target_compile_options(combat_tactics_tests PRIVATE /W4 /permissive-)
target_compile_options(map_renderer_tests PRIVATE /W4 /permissive-)
target_compile_options(map_sorter_tests PRIVATE /W4 /permissive-)
target_compile_options(isometric_controls_tests PRIVATE /W4 /permissive-)
target_compile_options(animation_archive_tests PRIVATE /W4 /permissive-)
target_compile_options(collision_tests PRIVATE /W4 /permissive-)
target_compile_options(remorse_map_preview PRIVATE /W4 /permissive-)
if(WIN32)
target_compile_options(remorse_game PRIVATE /W4 /permissive-)
endif()
target_compile_options(remorse_rebuild PRIVATE /W4 /permissive-)
target_compile_options(entity_dispatch_entry_tests PRIVATE /W4 /permissive-)
target_compile_options(file_system_tests PRIVATE /W4 /permissive-)
@ -131,7 +180,14 @@ else()
target_compile_options(remorse_core PRIVATE -Wall -Wextra -Wpedantic)
target_compile_options(combat_tactics_tests PRIVATE -Wall -Wextra -Wpedantic)
target_compile_options(map_renderer_tests PRIVATE -Wall -Wextra -Wpedantic)
target_compile_options(map_sorter_tests PRIVATE -Wall -Wextra -Wpedantic)
target_compile_options(isometric_controls_tests PRIVATE -Wall -Wextra -Wpedantic)
target_compile_options(animation_archive_tests PRIVATE -Wall -Wextra -Wpedantic)
target_compile_options(collision_tests PRIVATE -Wall -Wextra -Wpedantic)
target_compile_options(remorse_map_preview PRIVATE -Wall -Wextra -Wpedantic)
if(WIN32)
target_compile_options(remorse_game PRIVATE -Wall -Wextra -Wpedantic)
endif()
target_compile_options(remorse_rebuild PRIVATE -Wall -Wextra -Wpedantic)
target_compile_options(entity_dispatch_entry_tests PRIVATE -Wall -Wextra -Wpedantic)
target_compile_options(file_system_tests PRIVATE -Wall -Wextra -Wpedantic)