diff --git a/tests/game_sim/CMakeLists.txt b/tests/game_sim/CMakeLists.txt new file mode 100644 index 0000000..8183227 --- /dev/null +++ b/tests/game_sim/CMakeLists.txt @@ -0,0 +1,13 @@ +# game/sim tests: four hand-computed suites + a real-save smoke test (skips unless SOTS_SAVES_JSON). +foreach(_t economy research colony movement) + add_executable(game_sim_test_${_t} test_${_t}.cpp) + target_link_libraries(game_sim_test_${_t} PRIVATE sots_game_sim) + target_include_directories(game_sim_test_${_t} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) + target_compile_options(game_sim_test_${_t} PRIVATE -Wall -Wextra -pedantic) + add_test(NAME game_sim_${_t} COMMAND game_sim_test_${_t}) +endforeach() + +add_executable(game_sim_smoke_real_save smoke_real_save.cpp) +target_link_libraries(game_sim_smoke_real_save PRIVATE sots_game_sim) +target_include_directories(game_sim_smoke_real_save PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +add_test(NAME game_sim_smoke_real_save COMMAND game_sim_smoke_real_save) diff --git a/tests/mars_parse/CMakeLists.txt b/tests/mars_parse/CMakeLists.txt new file mode 100644 index 0000000..aef47d9 --- /dev/null +++ b/tests/mars_parse/CMakeLists.txt @@ -0,0 +1,17 @@ +# mars_parse tests: unit suite always; real-data oracle check only when SOTS_DATA_DIR is set +# at configure time (it needs the owner's extracted game data; never committed). +add_executable(mars_parse_unit_tests + canon.cpp test_main.cpp test_value.cpp test_blocks.cpp test_effect.cpp) +target_link_libraries(mars_parse_unit_tests PRIVATE mars_parse) +target_include_directories(mars_parse_unit_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +target_compile_options(mars_parse_unit_tests PRIVATE -Wall -Wextra -Wpedantic) +add_test(NAME mars_parse_unit COMMAND mars_parse_unit_tests) + +add_executable(mars_parse_oracle_check canon.cpp oracle_check.cpp) +target_link_libraries(mars_parse_oracle_check PRIVATE mars_parse) +target_include_directories(mars_parse_oracle_check PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) +if(DEFINED ENV{SOTS_DATA_DIR}) + # Parses every brace-block/.effect file under the data root (no Python cross-check here; + # run tests/mars_parse/build_and_run.sh for the full oracle comparison). + add_test(NAME mars_parse_realdata COMMAND mars_parse_oracle_check "$ENV{SOTS_DATA_DIR}") +endif()