18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-17 02:14:09 +01:00
Commit Graph

3489 Commits

Author SHA1 Message Date
c1089a6b16 Merge pull request #292 from MaSzyna-EU07/fix/en57-ep2-brake-charging
EN57 brakes: charging when hauled with the brake hose alone, Knorr EP brake only with control power
2026-11-09 12:48:13 +00:00
cb1dd60630 Merge pull request #293 from MaSzyna-EU07/fix/door-inner-faces-lowpoly-lighting
Door wings: let the low poly interior have its own, moving inside of the doors (eu07/maszyna#512)
2026-11-09 12:47:58 +00:00
8ec5d91307 Merge pull request #294 from MaSzyna-EU07/feat/second-loco-engine-start
Separate engine start switches for the vehicles in multiple
2026-11-09 12:47:44 +00:00
af44ed72af Merge pull request #298 from MaSzyna-EU07/feat/editor-tutorial-gifs
feat(editor): the clips of the tutorial lessons
2026-11-09 12:47:22 +00:00
71733a343a Merge pull request #299 from MaSzyna-EU07/fix/ui-tooltips-stay-in-window
fix(ui): tooltips and popups stay in the main window, and a long tooltip wraps
2026-11-09 12:46:56 +00:00
edea0dc0f5 Merge pull request #301 from pwarszawski/fix/python-screens-pillow
Python screens: ship Pillow with the Windows build, and the screen module for Pillow 10+
2026-11-09 12:46:42 +00:00
65468a2eae Merge pull request #302 from miloszunio/fix/gizmo-yaw-rotation-master
fix(editor): model yaw rotation with the gizmo jumps past 90 degrees
2026-11-09 12:46:24 +00:00
c0524552f1 Merge pull request #303 from MaSzyna-EU07/fix/legacy-renderer-instance-scale
fix(render): scale of model instances in the legacy and simple renderers
2026-11-09 11:39:41 +00:00
963d65192a fix(render): scale of model instances in the legacy and simple renderers build-fix-legacy-renderer-instance-scale 2026-11-09 11:23:46 +01:00
Claude
58e4bbff49 fix(editor): a model turned with the gizmo about the vertical axis no longer jumps back and forth
The angles of the whole gizmo matrix were decomposed every frame and the model was turned by their difference from its own.
The decomposition gives the angle about the vertical axis only within -90..90 degrees: past 90 it comes out as 180 - angle
with the other two axes turned by 180, so a drag one way turned the model back and flipped it. The turn is now taken from
the delta matrix of this frame (small, so its angles decompose with no ambiguity) and wrapped to -180..180.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ
2026-11-09 07:56:51 +01:00
jerrrrycho
38202f4e57 Merge remote-tracking branch 'origin/master' into feat/second-loco-engine-start
# Conflicts:
#	CMakeLists.txt
build-feat-second-loco-engine-start
2026-11-08 21:51:59 +01:00
jerrrrycho
c0f1749e87 Merge remote-tracking branch 'origin/master' into fix/door-inner-faces-lowpoly-lighting
# Conflicts:
#	vehicle/DynObj.cpp
build-fix-door-inner-faces-lowpoly-lighting
2026-11-08 21:47:32 +01:00
jerrrrycho
db65dfa5f0 test: file-local helpers instead of lambdas in the brake handle tests (Sonar S2259)
The analyser loses track of references captured by lambdas; the St113 EP and MHZ buttons tests call plain helpers, as ep_brake() and ready_knorr_ep() do, which it doesn't report.
build-fix-en57-ep2-brake-charging
2026-11-08 21:15:12 +01:00
pwarszawski
eb75089ba2 Python screens: ship Pillow with the Windows build, and the screen module for Pillow 10+
- The Windows build job installs Pillow into the Python 3.14 whose Lib, with
  site-packages, CMake copies next to the executable as python64\Lib, as the
  Linux job already does; the README says the same for a local build.
- Both build jobs copy staticFiles/python/local (the Python 3 version of the
  module every cab screen subclasses) into python/local of the build.
- The module puts back what Pillow 10 removed and the screen scripts use:
  ImageFont.getsize() and ImageDraw.textsize() on top of getbbox() /
  textbbox(), and Image.ANTIALIAS as LANCZOS. With an older Pillow nothing
  changes.

Part of #300.
2026-11-08 21:12:35 +01:00
maj00r
6824e8ae22 Merge pull request #287 from MaSzyna-EU07/fix/msaa-alpha-tested-tracks
fix(render): antialias alpha tested edges with multisampling (eu07/maszyna#449)
2026-11-08 21:03:47 +01:00
maj00r
9fecba82f0 Merge pull request #291 from MaSzyna-EU07/fix/sod-lamp-whole-consist
SOD lamp: doors of the whole consist, three states (eu07/maszyna#288)
2026-11-08 20:56:20 +01:00
maj00r
17676863bc Merge pull request #266 from MaSzyna-EU07/feat/exe-test-mode
Test mode: `--test` runs a scenery unattended and exits with the result (#541)
2026-11-08 20:41:57 +01:00
maj00r
102baa6c81 Merge pull request #297 from pwarszawski/fix/ai-passenger-stop-approach
AI: making for a passenger stop, leave room only for the brake's own fill time
2026-11-08 20:38:35 +01:00
jerrrrycho
04b55c866a fix(render): alpha to coverage only where it is on, full coverage on flat alpha
Review of the alpha to coverage change for alpha tested surfaces:

- An alpha which is flat over the pixel (fwidth 0) and equal to the opacity
  threshold got a coverage of 0.5, so e.g. opacity 1 on an opaque or DXT1
  texture turned half see-through with multisampling. Without an alpha edge
  in the pixel the plain test decides now: step(opacity, alpha).
- The shaders took the coverage path whenever they were built with
  multisampling, also where alpha to coverage is off (the reflections pass)
  or does nothing (the single-sampled model previews), and grew the cut-outs
  there by about half a pixel. model_ubo gets an alpha_to_coverage flag, set
  together with the GL state, and the shaders keep the plain alpha test
  without it. The previews no longer turn alpha to coverage on. The flag
  takes 4 of the 12 padding bytes after shadow_tone, so the std140 layout and
  the size of the block stay the same.
- The shader validator never set iMultisampling, so it never compiled the
  alpha to coverage branches. Its "features on" configuration uses the
  default of 2 now, on desktop GL and GLES.
build-fix-msaa-alpha-tested-tracks
2026-11-08 20:03:32 +01:00
maj00r
d0ca44cd67 fix(ui): a popup begun outside any window stays in the main window too
A popup begun outside any window, as the context menus of the editor, the dialogs for a new scenery and for opening one and the
pause dialog of the driver are, takes no viewport from a parent. It was put into the main window only where it merged there:
with the main window minimized, or behind a panel taken out into a window of its own, it got a window of the system of its own,
with an OpenGL context of its own, the way the editor froze. With io.ConfigViewportsNoAutoDetach the tooltips and popups stay in
the main window there too.

The comment of io.ConfigViewportsNoAutoDetach tells how they're placed: as with the viewports off, not shrunk.
io.ConfigTooltipsWrapWidth moves to the miscellaneous options, it works with the viewports off as well, and its comment tells
that SetItemTooltip() wraps too and BeginTooltip() doesn't.
build-fix-ui-tooltips-stay-in-window
2026-11-08 19:58:48 +01:00
jerrrrycho
8fb596f218 fix(simulation): any exception ends a test run with error, other runs as on master
main() tells a test run (--test) apart before anything runs. Only a test run
catches every exception and installs a std::terminate handler, both ending the
run with the error code and a test: line; any other run keeps master's
exception handling, so on Linux an uncaught runtime_error aborts at the throw
site again.

A test run doesn't start the Discord RPC thread: it published the test
scenery as the player's presence and held the closing up to 5 s.

run.py drops a case scenery's .sbt cache after a run cut short (wall_timeout,
error, a crash, killed by run.py), which could have been writing it.

The -edit branch of the test command line parser had no effect (a token that
isn't an option is ignored either way) and is gone; its test checks what can
be seen instead.
2026-11-08 19:46:16 +01:00
jerrrrycho
bbd7d9c5bf fix: a stopped diesel engine no longer stops the others every frame (eu07/maszyna#80)
dizel_Momentum() relayed MainSwitch 0 to the consist every frame while the engine stood still, whatever stopped it. In a train with mixed JointEngineStart flags an engine stopped from mainb_off stopped the engines behind it once it spun down, and the stopped engine of the cab's vehicle knocked out the one started from mainb_on. The stop is now relayed only when the engine stalls while running, as on master an engine stalling in a joint start still stops the others.
2026-11-08 19:38:16 +01:00
jerrrrycho
7ba478aea9 test: reach the mover by reference in the brake handle lambdas (Sonar S2259)
The lambdas of the St113 EP brake and the MHZ buttons tests called the mover through test::vehicle::operator->(), which the analyser takes as possibly null; they capture a reference from mover() instead.
2026-11-08 19:30:46 +01:00
maj00r
be40008808 fix(ui): tooltips and popups stay in the main window, and a long tooltip wraps
With the panels in separate windows on (the default), a tooltip or a popup that didn't fit in the main window got a window of
the system of its own, with an OpenGL context of its own. The editor froze so on 2026-11-08: its main thread stuck for good in
the NVIDIA driver while making the context of an invisible window 1925 x 29 px, a tooltip in one line wider than the screen.
The Polish texts of the editor have tooltips of up to 360 characters in a line; the one of the curve mode of laying track is
2088 px wide.

- io.ConfigViewportsNoAutoDetach (a MaSzyna addition, set with the separate windows) keeps the tooltips and popups shown over
  the main window inside it too, placed and shrunk as they are without the separate windows: they get no viewport of their
  own. A panel dragged out of the main window by hand still gets its window, and the tooltips and popups over it may go past
  its edge as before.
- io.ConfigTooltipsWrapWidth (a MaSzyna addition): SetTooltip() wraps its text at this width. The ui sets 40 em, 520 px at the
  font of 13 px.

Checked in the editor on a hidden desktop: the tooltip of the curve mode, full screen 1920 x 1080, and the one of the redo
button at the edge of a window 1280 x 720 each made a window of their own before, and none now. Both are drawn in the main
window, the long one in five lines.
2026-11-08 19:26:19 +01:00
maj00r
b1f2d0e3a1 feat(editor): the clips of the tutorial lessons, which the tutorial plays from lang/editor_tutorial
The lessons of looking around, laying, the curves, correcting a curve, joining, the switches, selecting and editing with
the gizmo each name a clip, lang/editor_tutorial/<name>.gif. The editor tutorial that #289 brings plays them, but doesn't
carry them: they were recorded on feat/switch-blades and stayed there. Taken from it as they are, 6.1 MB; the packages copy
lang/ whole, so they go out with the game. Without them a lesson just shows no clip.
build-feat-editor-tutorial-gifs
2026-11-08 18:30:22 +01:00
jerrrrycho
57db0087ff fix: the SOD lamp of the whole consist is opt-in per vehicle (DoorClosureSignal)
The three-state door closure lamp is switched on by DoorClosureSignal=Yes in the
Doors: section of the .fiz of the vehicle whose cab shows the lamp (the occupied
vehicle), off by default: without it the lamp keeps showing the lock of the
vehicle's own doors. The eu07.ini switch doorclosuresignal is gone, the data
decides. Sets whose cars lack DoorNeedPermit would blink at every standstill, so
only the sets with permits get the key.
2026-11-08 18:30:22 +01:00
jerrrrycho
91e0d90e8d fix: review of the separate engine start switches (eu07/maszyna#80)
- initialise the cooling power read from the .fiz to its default, no division by an indeterminate value
- integer step counters in the engine start tests
- main_sw opening the consist turns the two-state mainb_sw / mainc_sw off too, left on they'd start the engines again
- the doc comment of MainCircuitOpensWithStarterOnly() back on it; the .fiz read is the controlled vehicle's
2026-11-08 17:38:59 +01:00
jerrrrycho
200d3ae73b fix: review of the EN57 EP brake (Sonar null check, EP fuse of the cab car, AI re-asserts the EP brake)
- tests: REQUIRE the brake handle before dereferencing it (Sonar cpp:S2259)
- TESt::FillBrakeRes is const (S5817)
- cab EP brake command: drop the mvControlled->EpFuse check, SwitchEPBrake
  already checks the cab car's (mvOccupied) EP fuse with the control supply
- AI: with the handle already at the EP brake position, switch the EP brake
  on again once the control supply is back
2026-11-08 17:37:56 +01:00
pwarszawski
8cc8158d2a AI: making for a passenger stop, leave room only for the brake's own fill time
Since #187 the braking curve towards a stop or a lower speed leaves room for
the time the brake takes to respond, as long as the train brake handle is
still in the running position. The horizon it takes has the AI's old
look-ahead, (1 - a0) * 30/3.6 s, about 7-8 s, as its floor; at 60 km/h that
is over 100 m, up to half of the braking distance. Stops at signals were
tuned with it. A vehicle that brakes with its independent brake (an SN61, a
light engine) leaves the train brake handle where it is, so it kept that
room the whole way in: it braked early and gently, came down to 10 km/h
some 50 m out and crawled the rest, applying power and the brake in turn.

Making for a passenger stop (the point the train is to stop at, found by the
scan of the route, is a W4), the room now covers only the time the brake
takes to fill (half its application time), without the look-ahead floor.
Stops at signals and anything else keep the room as it was.

When a vehicle ahead is closer than the stop the scan found, the train makes
for that vehicle, so the room is the full one again.
2026-11-08 16:25:12 +01:00
jerrrrycho
22c588d8f9 feat(cab): 401Da oil pump lamp and slotted speedometer lever (eu07/maszyna#546) (#261)
* feat: 401da oil pump lamp and slotted lever animation (eu07/maszyna#546)

i-oilpump lights while the pre-lubrication oil pump works, so it goes
off once the engine runs. animslottedlever: in the .mmd turns a lever
by a pin on the coupling rod sliding in the lever's slot, which the
speedometer drive of 401Da needs.

The compressor start delay of #546 came with CompressorStartDelay
(Brake section) of master.

* fix: force GLM AVX2 only when the compiler targets AVX2

ENABLE_AVX2=OFF left GLM_FORCE_AVX2 defined, so MSVC still emitted
AVX2 intrinsics and the exe crashed on CPUs without AVX2.

* test: cover the compressor start delay and the oil pump lamp

The delay of an engine stopped before it passed starts over, a
compressor switched on by hand waits too, and the key is read from the
Brake section. In the converter-fed set-up of 401Da the compressor
waits for ConverterStartDelay and then its own delay. The oil pump
(i-oilpump lamp) works before the engine start and stops once the
engine runs.
2026-11-08 14:48:42 +01:00
jerrrrycho
5f46aca43a fix: a latching line breaker lever goes off with the breaker knocked out (#277)
The EP05's single two-state line breaker lever stayed on once the converter
overload relay knocked the breaker out: every press of the toggle tried to
close the open breaker, which the tripped relay refused. A press now puts
a lever left on over an open breaker off first.

(eu07/maszyna#394)
2026-11-08 14:48:04 +01:00
pawelw
3487e75f9a AI: the passenger stop flag no longer turns itself on and off (#295)
Whether a train is at a passenger stop (IsAtPassengerStop) was checked against
the final approach margins fMinProximityDist and fMaxProximityDist, which are
themselves set from that flag: 10-15 m and 15-40 m at a stop, 8 m and 50 m
otherwise. With the two sets different, the flag switched on and off on every
other scan of the route on the way to a W4. Each time the train went from a
final approach to a stop 50 m long to one 15 m long and back: braking in one
scan, full power below the 10 km/h coasting speed in the next. Close to the
stop the braking demand did not hold the train to a standstill, and below
1 km/h the stop counted as done, so an SN61 drove off without ever standing
still (#290).

The margins are now worked out in train_proximity_margins(), and the check of
the stop uses the margins of a passenger stop whatever the flag is at the
moment. A vehicle that is not a train keeps the present ones, as before.
2026-11-08 14:40:13 +01:00
maj00r
a6f30c3a2a CLAUDE.md: a PR has to pass the Sonar quality gate, not fix every remark (#296)
* docs(claude): a PR has to pass the Sonar quality gate, not fix every remark

The section on SonarCloud asked for every remark on the changed code to
be fixed, code smells included. It now asks for the quality gate: new
code rated A for reliability, security and maintainability, duplication
at most 3%, hotspots reviewed. A remark that doesn't fail the gate needn't
be fixed, and large restructurings that only answer one stay out of the
PR. The rules that keep coming up stay listed, as the way to keep the
gate passing.

* docs(claude): what the gate's ratings mean for bugs, smells and hotspots

Every bug or vulnerability on new code drops its rating below A and
fails the gate, code smells only count together through the
maintainability rating, and a hotspot is reviewed in SonarCloud rather
than by rewriting the code.

---------

Co-authored-by: maj00r <maj00r@host>
2026-11-08 14:39:19 +01:00
jerrrrycho
cea92f0170 test(unit): the test mode tests compare seconds with a tolerance
Floating point values of the command line, the real time limit and the
standstill clock are checked with doctest::Approx rather than ==.
2026-11-08 11:57:03 +01:00
jerrrrycho
349ffb1caf fix(simulation): on Linux an exception ends a test run with its verdict too
The runtime_error the simulator throws on a fatal problem was caught on Windows
only. On Linux a test run aborted on it, with the code of abort() and no
`test:` line. It is caught there too in test mode and ends the test with the
error code and the reason; outside a test it is thrown on as before.
2026-11-08 11:40:13 +01:00
jerrrrycho
e5aafd154f 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.
2026-11-08 11:39:52 +01:00
jerrrrycho
03a417c7b0 feat(simulation): a real time watchdog ends a test run that hangs
A test run that hung, in the loading or anywhere else, waited until whoever
started it killed it. A watchdog thread now ends a run still going test.wall_timeout
seconds of real time after the start of the simulator, loading included: it says
`test: timeout ... still running after N s of real time` and quits with the
timeout code, whatever the main thread is doing, with no dialog. A test that has
ended but whose simulator doesn't close ends with its own result.

The limit is test.wall_timeout (settings, the scenery's config block) or
--test-wall-timeout, which wins. Not given, it is test.timeout + 600 s: ten
minutes for the loading, and a simulation that runs at least as fast as real
time is never cut short. test.timeout 0 means no watchdog unless the limit is
given; test.wall_timeout 0 turns it off.

run.py passes the case's timeout as --test-wall-timeout and kills a simulator
only 30 s after it. A timeout from the watchdog counts as wall_timeout there, so
a run that hung doesn't pass a case expecting the simulation time to run out;
test_mode_wall_timeout ends while loading on a limit of 2 s.
2026-11-08 11:33:36 +01:00
jerrrrycho
14d25520f3 fix(simulation): a test's standard output carries its result only
The log was printed in colour to stdout too (debuglog bit 2), so a script reading
the verdict of a test got the whole log with it. In test mode the log goes to the
log file only and stdout has the `test: ...` line alone; the usage text of a bad
command line goes to stderr. Whether the run is a test is now known before the
log service starts.
2026-11-08 11:23:02 +01:00
jerrrrycho
1626df2bc4 fix(simulation): a scenery's config block can't turn back on what a test keeps off
The config block of a scenery is read like the settings files, after the test
mode settings were applied, so a scenery with soundenabled, multiplayer,
execonexit, feedbackmode or the like in it got them back in a test run. The test
mode settings now are applied again after each config block of the scenery;
apply_test_mode_settings() moved to simulationtest.cpp for that.
2026-11-08 11:22:37 +01:00
jerrrrycho
7f8892cda6 fix(simulation): a test doesn't read the player's own eu07.ini
The simulator reads eu07.ini from %APPDATA%/MaSzyna (~/.config/MaSzyna on Linux)
when there is one, in place of the game folder's. A test run then depended on
whose machine it ran on. With --test only the game folder's eu07.ini is read,
then the files given with -ini. The test mode options are taken from the command
line before the settings for that; --test-timeout still wins over test.timeout
of any settings file.
2026-11-08 11:21:57 +01:00
jerrrrycho
baf6bc2a20 feat(simulation): the test mode's exit codes keep clear of 1 and 3
1 is what a process killed with TerminateProcess (and the plain failure of most
programs) ends with, 3 what abort() ends with on Windows, so a fail or a timeout
couldn't be told from a run that was killed or blew up. The codes other than
pass now are 10 fail, 11 signal passed at danger, 12 timeout, 13 standstill and
14 error: none of them a code a process gets on its own, neither the shells'
126-127 nor 128 + a signal number on Linux. pass stays 0.
2026-11-08 11:21:30 +01:00
jerrrrycho
486a714f52 refactor(simulation): the rules of the test mode in a file of their own, with unit tests
The command line options of the test mode and the end conditions checked after
each frame are now plain functions in simulation/simulationtestrules.cpp, which
needs nothing of the running simulation: parse_test_command_line() and
evaluate_frame(). The file is part of the core library, so the unit tests check
them (tests/unit/test_test_mode.cpp): the --test-timeout value, values of other
options not taken for options, a pass that waits for the stop, the standstill,
the timeout. test_manager only gathers what a frame brought and acts on the
verdict. No change in behaviour.
2026-11-08 11:20:52 +01:00
jerrrrycho
62526e9d6a test(scenarios): the timetable cases check where the train stops, not how long
Przystanek on td.scn is a technical stop of the td/rozklad timetable (pt): the AI
doesn't wait there for the departure time but sets off as soon as it counts the
train as standing at the W4, below 1 km/h. How long the speed then stays under
0.5 km/h is only how fast the brake releases. With the AI braking of #264 the
trains creep up to the W4 at about 10 km/h on a light application and stood there
for 1-5 s; the SN61 turns back at 0.36 km/h without stopping. The hold of 5 s
(2 s for the SN61) failed for EP09, SN61 and Vectron and had well under a second
to spare for others.

The cases now check that the train comes down to 1 km/h, the AI's own standstill
at a W4, 1380-1420 m from the start; every vehicle stops at 1397-1401 m, before
and after #264. `stops` takes min_distance and max_distance for that.
2026-11-08 11:16:40 +01:00
jerrrrycho
491ed3e6da Merge remote-tracking branch 'origin/master' into feat/exe-test-mode 2026-11-08 10:58:43 +01:00
jerrrrycho
b2331ad2d1 docs(test): what waits for a test run in cmd, checked
start /wait gives the exit code but not the output; a .bat file waits
for the windowed simulator and passes its output on.
2026-11-08 09:37:32 +01:00
jerrrrycho
1b373bcc38 docs(test): the test mode README on the new ends, outside settings and Windows shells
- what the test mode turns off towards the outside (feedbackmode,
  multiplayer, execonexit, showsystemconsole, imgui.ini),
- a command line it can't take or a failed start ends with `error`,
- cmd and PowerShell don't wait for the (windowed) simulator nor show its
  output: start /wait, Start-Process -Wait,
- 15 cases, not 14.
2026-11-08 09:36:56 +01:00
jerrrrycho
93e2b85d08 fix(simulation): the test mode gives nothing to the outside and leaves the player's files alone
The test mode turned off what comes in from outside, but a few settings
of the user's eu07.ini still reached out of a test run:

- feedbackmode: 1 and 2 toggle Caps Lock / Scroll Lock by injecting key
  events into the whole system, 3 and 4 drive an LPT port or a PoKeys
  desk (and 4 reads the desk's switches);
- multiplayer: events are reported to a multiplayer server, and some
  events are held back for it;
- execonexit: a program is run with system() at the end of each run,
  which also waits for it;
- showsystemconsole: a console of the run's own pops up and stdout is
  reopened on it, so whoever started the test with a redirected output
  doesn't get the `test:` line (and a console the run was started from
  would be hidden without it);
- imgui.ini in the game folder was written by every run, and by several
  at once with run.py -j.

All of these are off in test mode. Nothing changes outside it.
2026-11-08 09:36:51 +01:00
jerrrrycho
ced4e06b35 fix(simulation): no crash message box in test mode
The crash handler of WITHDUMPGEN builds (on by default) shows a message
box before it writes the dump. It also gets the C++ exceptions nothing
catches, since it replaces the CRT's unhandled exception filter. In test
mode nobody is there to close the box, so a crashing test waited for it
until whatever started it gave up (run.py after the case's timeout,
600 s by default). The dump is still written, the exit code is the
exception's.
2026-11-08 09:36:35 +01:00
jerrrrycho
4356e7c3fd fix(simulation): a test run that can't start ends with the error code and says why
- `--test` is looked for before the rest of the command line is read. An
  unknown option before it (e.g. `-s x.scn --test-timout 90 --test`) used
  to end the run with exit code 0, which a caller reads as a pass.
- `--test-timeout` without a value, or with one that isn't a number of
  seconds, fails the run instead of leaving the default or, through atof,
  turning the timeout off.
- These, a missing -s, a failed start and an exception caught in main()
  end the test through test_manager::conclude(), which writes the usual
  `test: error (exit code 5) ... : <reason>` line to stdout and the log.
  Before, `eu07 --test` alone exited with 5 and nothing anywhere: the
  error went to the log queue and the process ended before the log
  thread wrote it. In test mode main() now stops the log thread and
  waits for it before _Exit().

Outside the test mode nothing changes: conclude() does nothing there.
2026-11-08 09:36:28 +01:00
jerrrrycho
547706b54d refactor(simulation): fix the Sonar remarks on the test mode code
- TController::TableCheck() calls TSpeedPos::Update() as it did before the
  test mode: the check for a signal passed at danger is a call of its own
  after it (CheckSignalPassedAtDanger), so the update lines nest no deeper
  than on master (S134). A switch is a track, so a signal's update never
  takes the switch-change branch and the check runs in the same place as
  before; the physicslogs of all 15 scenario cases are byte for byte the
  same.
- null_imgui_renderer is final (S1235), to_string(test_result) uses
  `using enum` (S6177), init_result_cell() is const (S5817),
  ConfigParseTest() takes a std::string_view (S6009) and the test settings
  struct is declared apart from its member (S3646).
2026-11-08 09:35:59 +01:00