texitcode.nim 555 B

123456789101112131415161718192021222324
  1. discard """
  2. output: ""
  3. """
  4. import osproc, os
  5. const filename = when defined(Windows): "tafalse.exe" else: "tafalse"
  6. let dir = getCurrentDir() / "tests" / "osproc"
  7. doAssert fileExists(dir / filename)
  8. var p = startProcess(filename, dir)
  9. doAssert(waitForExit(p) == QuitFailure)
  10. p = startProcess(filename, dir)
  11. var running = true
  12. while running:
  13. running = running(p)
  14. doAssert(waitForExit(p) == QuitFailure)
  15. # make sure that first call to running() after process exit returns false
  16. p = startProcess(filename, dir)
  17. os.sleep(500)
  18. doAssert(not running(p))