mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-21 13:15:02 +01:00
feat(simulation): the pass and the standstill wait for the train under test only
Both waited for every vehicle of the scenery to stand still, so on a scenery with AI traffic a test could pass only when the traffic happened to stand too, and the standstill end hardly ever came. A test scenery names the train under test with test.vehicle <name> in its config block (once for each train, if several): the pass and the standstill wait for the consists of these vehicles as they are at the moment, so a train the tested one couples to counts with it. A name the scenery doesn't have ends the test with the error code. Without test.vehicle every vehicle counts, as before. A signal passed at danger counts for every train either way. run.py puts the case's lead vehicle into test.vehicle. test_mode_standstill_traffic has the train under test standing on track 2 of Stacja1 while AI traffic leaves track 1 on the timetable: it ends on its 100 s standstill, where counting every vehicle runs into the 300 s timeout. Physicslogs of the other trains of a case (<something>_<vehicle>) are moved out of the game dir too.
This commit is contained in:
13
tests/scenarios/cases/td_traffic.scn
Normal file
13
tests/scenarios/cases/td_traffic.scn
Normal file
@@ -0,0 +1,13 @@
|
||||
// added by tests/scenarios/run.py to td.scn, whose own trainsets were removed: two trains at Stacja1.
|
||||
// the train under test (test.vehicle) stands on track 2, where its driver has nothing to do; the other one,
|
||||
// AI traffic, has the td/rozklad timetable on track 1 and leaves for Przystanek at 10:35. the standstill of
|
||||
// the test waits for the train under test only, so the traffic running on doesn't hold it up.
|
||||
trainset none tor2k 30.0 0.0
|
||||
node -1 0 {{vehicle}} dynamic pkp\4e_v1 4e-004 4e 0 headdriver 0 0 enddynamic
|
||||
endtrainset
|
||||
trainset td/rozklad tdo_n1734 0.0 0.1
|
||||
node -1 0 traffic_{{vehicle}} dynamic pkp\4e_v1 4e-004 4e 0 headdriver 0 0 enddynamic
|
||||
endtrainset
|
||||
|
||||
// the way out of track 1 for the traffic, see td_timetable.scn
|
||||
node -1 0 autotest_route eventlauncher 0 0 0 -1 none 1034 keyctrl04 end
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"description": "Test mode, standstill: EU07 on td.scn with no route set stops before the exit signal stacja1_j at stop and stays; nothing reports a result, so the test ends once every vehicle stood still for test.standstill 120 seconds (the train waits about 70 s before it pulls off, so less would end it before the start).",
|
||||
"description": "Test mode, standstill: EU07 on td.scn with no route set stops before the exit signal stacja1_j at stop and stays; nothing reports a result, so the test ends once the train under test stood still for test.standstill 120 seconds (the train waits about 70 s before it pulls off, so less would end it before the start).",
|
||||
"base_scenery": "td.scn",
|
||||
"time": "10:34",
|
||||
"fragment": "td_red_signal.scn",
|
||||
|
||||
18
tests/scenarios/cases/test_mode_standstill_traffic.json
Normal file
18
tests/scenarios/cases/test_mode_standstill_traffic.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"description": "Test mode, standstill with traffic: an EU07 stands on track 2 of Stacja1 on td.scn while another EU07, AI traffic, leaves track 1 on the td/rozklad timetable at 10:35 and runs on. Only the train under test (test.vehicle, the case's vehicle) counts, so the test ends on test.standstill 100 although the traffic is moving; counting every vehicle, it would run into the 300 s test timeout.",
|
||||
"base_scenery": "td.scn",
|
||||
"time": "10:34",
|
||||
"fragment": "td_traffic.scn",
|
||||
"test_config": [
|
||||
"test.standstill 100"
|
||||
],
|
||||
"expect": "standstill",
|
||||
"duration": 300,
|
||||
"timeout": 600,
|
||||
"checks": [
|
||||
{
|
||||
"type": "max_speed",
|
||||
"limit": 0.5
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user