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

feat(simulation): test.no_movement_before_pass, a pass that doesn't wait for a stop

The config key from eu07/maszyna#541. By default (yes) a pass reported to
__test.result waits until every vehicle has stood still for 1 s; with no it
ends the test at once. The key is listed with the other test.* settings in the
log and in the test start line.

Scenario tests: new case test_mode_pass_while_moving reports the pass from
event2 of tor1k as the train runs onto it and checks the run ended with the
train still moving (new check ends_moving). The README lists the test.* keys
with their defaults and the input the test mode ignores.
This commit is contained in:
jerrrrycho
2026-11-07 17:38:38 +01:00
parent dd019d88ba
commit 6ccf4b14bf
6 changed files with 71 additions and 3 deletions

View File

@@ -487,6 +487,12 @@ bool global_settings::ConfigParseTest(cParser& Parser, const std::string& token)
return true;
}
if (token == "test.no_movement_before_pass")
{
ParseOne(Parser, test.no_movement_before_pass);
return true;
}
return false;
}
@@ -1783,6 +1789,7 @@ global_settings::export_as_text( std::ostream &Output ) const {
export_as_text( Output, "test.standstill", test.standstill );
export_as_text( Output, "test.pass_on_standstill", test.pass_on_standstill );
export_as_text( Output, "test.fail_if_stop_overran", test.fail_if_stop_overran );
export_as_text( Output, "test.no_movement_before_pass", test.no_movement_before_pass );
export_as_text( Output, "gfx.envmap.enabled", gfx_envmap_enabled );
export_as_text( Output, "gfx.postfx.motionblur.enabled", gfx_postfx_motionblur_enabled );
export_as_text( Output, "gfx.postfx.motionblur.shutter", gfx_postfx_motionblur_shutter );

View File

@@ -93,6 +93,7 @@ struct global_settings {
double standstill{ 300.0 }; // [s] every vehicle standing still this long ends the test; 0 = never
bool pass_on_standstill{ false }; // the standstill end passes the test instead of failing it
bool fail_if_stop_overran{ true }; // a train passing a signal at stop ends the test as failed; with false it's only logged
bool no_movement_before_pass{ true }; // a pass waits until every vehicle stands still; with false it ends the test at once
bool timeout_from_command_line{ false }; // --test-timeout given, the scenery doesn't override it
} test;
bool editor_tracks{ false }; // F3 track workspace: draw and pick tracks without the scenery draw-range cap