The engine has modelled the event log since lane E, but the standalone never wrote any of it into the save it produces. This wires the two together for the one event on the reference pair the standalone can compute, and corrects the condition. What a turn actually posts, measured over all eleven saves: two events on turn1 -> turn2 and three on turn2 -> turn3, and only two players in the whole corpus ever hold an event at all. Order is readable off the ids -- the build pass posts before the research pass. See docs/EV-events.md section 1. The condition had two of the original's three tests. The missing one is "no tech finished on this turn or later", and it is what keeps the event off the turn a tech lands; zuul-turn23 exercises it. The third input, whether the player holds a target at the moment of the check, is not on the wire -- three of the four real players acquire one during the turn, which is AI research selection -- so the operator's --ai-player roster stands in for it as a stated hypothesis and the phase stays blocked without it. No prose in the engine: the record's text is resolved through a caller-supplied lookup over the operator's own installed string table, and a run without a data root posts nothing rather than writing a record it cannot fill. Measured (CT111 host build, real data root), closed and regressed never netted: turn1 -> turn2 209 -> 127 closed 82 (+4 this lane), regressed 0 turn2 -> turn3 108 -> 69 closed 39 (+3 this lane), regressed 0 The posted record agrees with the oracle on all eight of its fields. Controls: with the roster withheld the phase over-fires and regresses 16 leaves on pair 1; with the string table withheld it posts nothing and regresses none. Gates run separately: tools/clean_room_check.sh OK; host ctest 50/50; CT111 shim cross-build OK (exports 66 names identical to binkw32.dll, staged in /srv/re-lab/shim/dist-ev); CT111 host ctest 50/50.
48 lines
2.4 KiB
CMake
48 lines
2.4 KiB
CMake
# Standalone turn-driver tests.
|
|
#
|
|
# test_catalog needs nothing but the catalog and always runs.
|
|
# test_turn reads the owner's saves via SOTS_SAVES_DIR at run time and skips cleanly when it
|
|
# is unset -- no .sav ever enters this repo.
|
|
add_executable(app_test_catalog test_catalog.cpp)
|
|
target_link_libraries(app_test_catalog PRIVATE sots_app)
|
|
add_test(NAME app_catalog COMMAND app_test_catalog)
|
|
|
|
add_executable(app_test_turn test_turn.cpp)
|
|
target_link_libraries(app_test_turn PRIVATE sots_app)
|
|
add_test(NAME app_turn COMMAND app_test_turn)
|
|
|
|
# The trade-raid word count is pinned against a scripted generator, so it always runs.
|
|
add_executable(app_test_trade_raid test_trade_raid.cpp)
|
|
target_link_libraries(app_test_trade_raid PRIVATE sots_app)
|
|
add_test(NAME app_trade_raid COMMAND app_test_trade_raid)
|
|
|
|
# The alliance mask, as a rule. Pins the three things the corpus cannot separate -- the bit
|
|
# index, the OR, and the guard -- so it always runs.
|
|
add_executable(app_test_alliance test_alliance.cpp)
|
|
target_link_libraries(app_test_alliance PRIVATE sots_app)
|
|
add_test(NAME app_alliance COMMAND app_test_alliance)
|
|
|
|
# The treaty-turn stamp, as a rule. Pins the five things the corpus cannot separate -- the
|
|
# relation codes, the bit's source, the missing alliance-id guard, the -1 initialiser and the
|
|
# append order -- so it always runs.
|
|
add_executable(app_test_treaty test_treaty.cpp)
|
|
target_link_libraries(app_test_treaty PRIVATE sots_app)
|
|
add_test(NAME app_treaty COMMAND app_test_treaty)
|
|
|
|
# The no-research event, as a rule. Pins what the corpus cannot separate -- the
|
|
# researched-this-turn test, the state-2 reading, the FLT_MAX sentinel, EvAct=1 and the id
|
|
# sequence from a fresh EvNxID -- so it always runs.
|
|
add_executable(app_test_event_phase test_event_phase.cpp)
|
|
target_link_libraries(app_test_event_phase PRIVATE sots_app)
|
|
add_test(NAME app_event_phase COMMAND app_test_event_phase)
|
|
|
|
# The turn-record model against the record the game itself archived; needs the owner's saves.
|
|
add_executable(app_test_turn_record test_turn_record.cpp)
|
|
target_link_libraries(app_test_turn_record PRIVATE sots_app)
|
|
add_test(NAME app_turn_record COMMAND app_test_turn_record)
|
|
|
|
foreach(_t app_test_catalog app_test_turn app_test_trade_raid app_test_alliance
|
|
app_test_treaty app_test_event_phase app_test_turn_record)
|
|
target_include_directories(${_t} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
target_compile_options(${_t} PRIVATE -Wall -Wextra -Wpedantic)
|
|
endforeach()
|