tgorge.nim 540 B

123456789101112131415161718192021
  1. import os
  2. template getScriptDir(): string =
  3. parentDir(instantiationInfo(-1, true).filename)
  4. block gorge:
  5. const
  6. execName = when defined(windows): "tgorge.bat" else: "./tgorge.sh"
  7. relOutput = gorge(execName)
  8. absOutput = gorge(getScriptDir() / execName)
  9. doAssert relOutput == "gorge test"
  10. doAssert absOutput == "gorge test"
  11. block gorgeEx:
  12. const
  13. execName = when defined(windows): "tgorgeex.bat" else: "./tgorgeex.sh"
  14. res = gorgeEx(execName)
  15. doAssert res.output == "gorgeex test"
  16. doAssert res.exitCode == 1