mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-19 19:17:15 +00:00
Merge branch 'devel' into bigbreak
Conflicts: lib/pure/osproc.nim
This commit is contained in:
21
tests/stdlib/tosprocterminate.nim
Normal file
21
tests/stdlib/tosprocterminate.nim
Normal file
@@ -0,0 +1,21 @@
|
||||
import os, osproc
|
||||
|
||||
when defined(Windows):
|
||||
const ProgramWhichDoesNotEnd = "notepad"
|
||||
else:
|
||||
const ProgramWhichDoesNotEnd = "/bin/sh"
|
||||
|
||||
echo("starting " & ProgramWhichDoesNotEnd)
|
||||
var process = startProcess(ProgramWhichDoesNotEnd)
|
||||
sleep(500)
|
||||
echo("stopping process")
|
||||
process.terminate()
|
||||
var TimeToWait = 5000
|
||||
while process.running() and TimeToWait > 0:
|
||||
sleep(100)
|
||||
TimeToWait = TimeToWait - 100
|
||||
|
||||
if process.running():
|
||||
echo("FAILED")
|
||||
else:
|
||||
echo("SUCCESS")
|
||||
Reference in New Issue
Block a user