mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-14 11:13:34 +01:00
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.
This commit is contained in:
@@ -433,8 +433,12 @@ int eu07_application::init(int Argc, char *Argv[])
|
||||
|
||||
#if WITH_DISCORD_RPC
|
||||
// Run DiscordRPC service
|
||||
std::thread sDiscordRPC(&eu07_application::DiscordRPCService, this);
|
||||
Global.threads.emplace("DiscordRPC", std::move(sDiscordRPC));
|
||||
// not for a test run: it would show the test scenery as the player's presence, and hold up the closing
|
||||
if (false == Global.test.enabled)
|
||||
{
|
||||
std::thread sDiscordRPC(&eu07_application::DiscordRPCService, this);
|
||||
Global.threads.emplace("DiscordRPC", std::move(sDiscordRPC));
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!init_network())
|
||||
|
||||
Reference in New Issue
Block a user