18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-19 18:05:01 +01:00
Files
maszyna/tests/scenarios/cases/test_mode_signal_passed_at_danger.json
jerrrrycho 6a538d202b test: scenario tests run in the simulator's test mode and check its exit code
run.py starts eu07 with --test (and --test-timeout <duration> for cases that
record a fixed time) and compares the result from the exit code with the
case's expect key, before the physicslog checks. The 14 cases take about 30 s
with -j 4 instead of minutes. --watch keeps the old windowed run.

New case keys: expect, test_config (lines of a config block), track_events
(lines added to a track of the base scenery, e.g. event0 test_pass). New cases
show each end of the test mode: test_mode_pass, _signal_passed_at_danger,
_timeout and _standstill. The slippery rail cases slide past the red signal,
which now ends a test, so they set test.fail_if_stop_overran no.

README documents the test mode for scenery authors.
2026-11-07 16:20:42 +01:00

23 lines
691 B
JSON

{
"description": "Test mode, signal passed at danger: EU07 on td.scn with no route set starts at 60 km/h about 150 m before the exit signal stacja1_j at stop. Its AI driver is still preparing the engine and doesn't brake, and the run ends when the train passes the signal.",
"base_scenery": "td.scn",
"time": "10:34",
"fragment": "td_red_signal_moving.scn",
"vars": {
"velocity": "60",
"consist": "node -1 0 {{vehicle}} dynamic pkp\\4e_v1 4e-004 4e 0 headdriver 0 0 enddynamic"
},
"expect": "signal_passed_at_danger",
"timeout": 600,
"checks": [
{
"type": "max_speed",
"limit": 61
},
{
"type": "distance",
"min": 140
}
]
}