# mars/stream + mars/rng tests. test_save reads the owner's saves via SOTS_SAVES_DIR at run time
# and skips cleanly when it is unset (saves never enter the repo).
add_executable(mars_stream_test_rng test_rng.cpp)
target_link_libraries(mars_stream_test_rng PRIVATE mars_rng)
add_test(NAME mars_rng_unit COMMAND mars_stream_test_rng)

add_executable(mars_stream_test_stream test_stream.cpp)
target_link_libraries(mars_stream_test_stream PRIVATE mars_stream)
add_test(NAME mars_stream_unit COMMAND mars_stream_test_stream)

add_executable(mars_stream_test_save test_save.cpp)
target_link_libraries(mars_stream_test_save PRIVATE mars_stream mars_rng)
add_test(NAME mars_stream_save COMMAND mars_stream_test_save)

foreach(_t mars_stream_test_rng mars_stream_test_stream mars_stream_test_save)
  target_include_directories(${_t} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
  target_compile_options(${_t} PRIVATE -Wall -Wextra -Wpedantic)
endforeach()

# Conformance of the typed shapes against the wire schema recovered from the game's
# serializers (include/generated/sots_stream_schema.h).  No game data: the generated
# table plus shapes.h, so this one always runs.
add_executable(mars_stream_test_wire_schema test_wire_schema.cpp)
target_link_libraries(mars_stream_test_wire_schema PRIVATE mars_stream sots_addresses)
add_test(NAME mars_stream_wire_schema COMMAND mars_stream_test_wire_schema)
target_include_directories(mars_stream_test_wire_schema PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_options(mars_stream_test_wire_schema PRIVATE -Wall -Wextra -Wpedantic)
