18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-21 19:05:00 +01:00

test: scenario tests that run the simulator and check a vehicle's physicslog

tests/scenarios/run.py builds a test scenery from a game install's scenery
(own trainsets removed, case fragment added), runs eu07 in ghostview with
physicslog on, and checks what the vehicle did: starts, max speed, brakes,
stops. First case: EU07 on td.scn driven by AI on the td/rozklad timetable,
with the Stacja1 exit route set by an event launcher instead of shift+4.

eu07 gets a -ini <file> option: an extra settings file read after eu07.ini,
so a test run can switch to a window and turn on physicslog without touching
the user's config.

Local only: scenery and vehicle data are not in the repo.
This commit is contained in:
jerrrrycho
2026-09-30 19:16:46 +02:00
parent 939e42b611
commit 798fd89dd0
6 changed files with 435 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
{
"description": "EU07 on td.scn, AI driver on the td/rozklad timetable: starts from Stacja1, keeps to the speed limit, brakes to a stop at Przystanek.",
"base_scenery": "td.scn",
"time": "10:34",
"fragment": "eu07_td_timetable.scn",
"vehicle": "autotest_eu07",
"duration": 240,
"timeout": 600,
"checks": [
{ "type": "starts", "min_speed": 20, "within": 150 },
{ "type": "max_speed", "limit": 90, "tolerance": 3 },
{ "type": "brakes", "min_pressure": 0.5 },
{ "type": "stops", "moving_speed": 20, "stop_speed": 0.5, "hold": 5 }
]
}