Commit Graph

5 Commits

Author SHA1 Message Date
01cde4562b Verify the exact tiny game exit code in runtime tests 2026-11-22 20:38:19 +08:00
b4d7f7b279 tiny_game: opt-in checks by argument, and a CTest run for each
The thread_local and C++ exception checks were switched on by LEONIDA_RUN_TLS=1
and LEONIDA_RUN_EH=1. scripts/run_wine_tests.py passes a test's command line but
not its ENVIRONMENT property, so under Wine an environment-based test would only
ever see the SKIP path. They now take arguments after "hello 42" (`tls`, `eh`),
and CTest runs each in its own test, run_tiny_game_tls and run_tiny_game_eh.
run_tiny_game keeps running without them. stdout is unbuffered, so a crash still
shows how far the run got.
2026-11-22 12:29:52 +01:00
d1b75ca0cf tiny_game: C++ exception check opt-in again: MSVC's throw needs the image known to RtlPcToFileHeader, not only #176's tables 2026-11-22 00:12:44 +01:00
18e968a28b tiny_game: the C++ exception check is on by default now that #176 is on main 2026-11-22 00:08:20 +01:00
0ca9bb8bc0 Runtime: gta6rt --run, and a stand-in game executable run through the loader
gta6rt --run <exe> [-- args] maps and binds the executable, initialises its
modules and calls its entry point on a game thread. shims/process.cpp answers
the process-level imports through the game's own import table: argv/argc and
GetCommandLine are the game's (UCRT api-set/ucrtbase and msvcrt forms), and
exit/_exit/quick_exit/ExitProcess/abort end the run with that exit code
instead of the host. gta6rt then exits with the game's code directly, so the
game's atexit handlers don't run during host shutdown.

tiny_game.exe (CTest run_tiny_game, run_tiny_game_exit_code) does what a title
does in its first second: arguments, a static initializer, a 4 MiB allocation,
a file round trip, a thread, and xgameruntime.dll imports, which the shim
registry answers instead of the link-time stub. thread_local and a C++
exception are opt-in (LEONIDA_RUN_TLS / LEONIDA_RUN_EH) until #93 and #176.
2026-11-21 23:50:31 +01:00