added system.gorgeEx that includes the exitCode; refs #4874; fixes #1994

This commit is contained in:
Araq
2017-01-07 02:38:26 +01:00
parent a17d996be9
commit 9d488261df
8 changed files with 46 additions and 20 deletions

View File

@@ -3,10 +3,18 @@ import os
template getScriptDir(): string =
parentDir(instantiationInfo(-1, true).filename)
const
execName = when defined(windows): "tgorge.bat" else: "sh tgorge.sh"
relOutput = gorge(execName)
absOutput = gorge(getScriptDir() / execName)
block gorge:
const
execName = when defined(windows): "tgorge.bat" else: "./tgorge.sh"
relOutput = gorge(execName)
absOutput = gorge(getScriptDir() / execName)
doAssert relOutput == "gorge test"
doAssert absOutput == "gorge test"
doAssert relOutput == "gorge test"
doAssert absOutput == "gorge test"
block gorgeEx:
const
execName = when defined(windows): "tgorgeex.bat" else: "./tgorgeex.sh"
res = gorgeEx(execName)
doAssert res.output == "gorgeex test"
doAssert res.exitCode == 1

2
tests/vm/tgorgeex.bat Normal file
View File

@@ -0,0 +1,2 @@
@echo gorgeex test
@exit /b 1

3
tests/vm/tgorgeex.sh Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
echo "gorgeex test"
exit 1