Start the scenery editor from its own button and note launches

With no scenery selected the button starts a new one in the editor. Each launch
notes the scenery, the timetable number and the vehicles for the tapes. Tools
work on the selected scenery, and an emptied consist stays listed.
This commit is contained in:
maj00r
2026-11-01 16:06:16 +01:00
parent 6e45f5de59
commit 2ebff91316
9 changed files with 670 additions and 124 deletions

View File

@@ -55,11 +55,28 @@ public class SimulatorExitTests
? ("cmd", new[] { "/c", "echo boom 1>&2 & exit 3" })
: ("/bin/sh", new[] { "-c", "echo boom >&2; exit 3" });
var process = launcher.Start(shell, script, null, captureErrors: true, out string? error);
var process = launcher.Start(shell, script, null, new Dictionary<string, string>(), captureErrors: true,
out string? error);
Assert.Null(error);
await process!.WaitForExitAsync();
Assert.Equal(3, process.ExitCode);
Assert.Equal("boom", Assert.Single(process.ErrorTail).Trim());
}
[Fact]
public async Task A_real_process_gets_the_environment_it_was_given()
{
var launcher = new SystemProcessLauncher(new TestInstallation().Log);
var (shell, script) = OperatingSystem.IsWindows()
? ("cmd", new[] { "/c", "echo %__NV_PRIME_RENDER_OFFLOAD% 1>&2" })
: ("/bin/sh", new[] { "-c", "echo $__NV_PRIME_RENDER_OFFLOAD >&2" });
var process = launcher.Start(shell, script, null,
new Dictionary<string, string> { ["__NV_PRIME_RENDER_OFFLOAD"] = "1" },
captureErrors: true, out _);
await process!.WaitForExitAsync();
Assert.Equal("1", Assert.Single(process.ErrorTail).Trim());
}
}