Merge pull request #4828 from jfhg/unify_waitpid_handling
Unify waitpid handling
This commit is contained in:
commit
f46168d654
3 changed files with 57 additions and 32 deletions
3
tests/osproc/tafalse.nim
Normal file
3
tests/osproc/tafalse.nim
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# 'tafalse.nim' to ensure it is compiled before texitcode.nim
|
||||
import system
|
||||
quit(QuitFailure)
|
||||
18
tests/osproc/texitcode.nim
Normal file
18
tests/osproc/texitcode.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
discard """
|
||||
file: "texitcode.nim"
|
||||
output: ""
|
||||
"""
|
||||
import osproc, os
|
||||
|
||||
const filename = when defined(Windows): "tafalse.exe" else: "tafalse"
|
||||
let dir = getCurrentDir() / "tests" / "osproc"
|
||||
doAssert fileExists(dir / filename)
|
||||
|
||||
var p = startProcess(filename, dir)
|
||||
doAssert(waitForExit(p) == QuitFailure)
|
||||
|
||||
p = startProcess(filename, dir)
|
||||
var running = true
|
||||
while running:
|
||||
running = running(p)
|
||||
doAssert(waitForExit(p) == QuitFailure)
|
||||
Loading…
Add table
Add a link
Reference in a new issue