summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorSimon Krauter <krauter.simon@arcor.de>2014-11-03 12:18:45 +0100
committerSimon Krauter <krauter.simon@arcor.de>2014-11-03 12:18:45 +0100
commita7f5d550c1567f9b150fc73891e1afeb4623cfba (patch)
tree2f6141c105f70d43f6b8b5fad7a77d0c68ed3195
parentf3d7158d5db591a88a6da3234a1f72d534c543fb (diff)
downloadNim-a7f5d550c1567f9b150fc73891e1afeb4623cfba.tar.gz
Added test case
-rw-r--r--tests/stdlib/tosprocterminate.nim21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/stdlib/tosprocterminate.nim b/tests/stdlib/tosprocterminate.nim
new file mode 100644
index 000000000..fd044414c
--- /dev/null
+++ b/tests/stdlib/tosprocterminate.nim
@@ -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")