mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-19 08:46:00 +01:00
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.
This commit is contained in:
@@ -37,10 +37,11 @@ With `--test` the simulator:
|
|||||||
line on stdout and in the log. A command line it can't take, or a start that fails, ends
|
line on stdout and in the log. A command line it can't take, or a start that fails, ends
|
||||||
the same way with the `error` code.
|
the same way with the `error` code.
|
||||||
|
|
||||||
On Windows the simulator is a windowed program, so `cmd` and PowerShell don't wait for it nor
|
On Windows the simulator is a windowed program, which the `cmd` prompt and PowerShell don't wait
|
||||||
show its output by themselves: run it with `start /wait eu07 --test ... > result.txt` and read
|
for. In a `.bat` file `eu07 --test ... > result.txt` waits and sets `%errorlevel%`; at the prompt
|
||||||
`%errorlevel%` in `cmd`, or `(Start-Process eu07 '--test ...' -Wait -PassThru -RedirectStandardOutput result.txt).ExitCode`
|
`start /wait eu07 --test ...` waits too but doesn't pass the output on. In PowerShell use
|
||||||
in PowerShell. Scripts (Python's `subprocess`, bash) wait for it as for any other program.
|
`(Start-Process eu07 '--test ...' -Wait -PassThru -RedirectStandardOutput result.txt).ExitCode`.
|
||||||
|
Scripts (Python's `subprocess`, bash) wait for it as for any other program.
|
||||||
|
|
||||||
A scenery reports its result to the memory cell `__test.result`, which the simulator creates
|
A scenery reports its result to the memory cell `__test.result`, which the simulator creates
|
||||||
(in every run, so a test scenery loads normally too). Write value 1 to it for a pass and 0
|
(in every run, so a test scenery loads normally too). Write value 1 to it for a pass and 0
|
||||||
|
|||||||
Reference in New Issue
Block a user