tgorge.nim 762 B

123456789101112131415161718192021222324252627282930
  1. discard """
  2. disabled: "windows"
  3. """
  4. # If your os is windows and this test fails for you locally, please
  5. # check what is going wrong.
  6. import os
  7. template getScriptDir(): string =
  8. parentDir(instantiationInfo(-1, true).filename)
  9. # See also simpler test in Nim/tests/vm/tvmops.nim for a simpler
  10. # cross platform way.
  11. block gorge:
  12. const
  13. execName = when defined(windows): "tgorge.bat" else: "./tgorge.sh"
  14. relOutput = gorge(execName)
  15. absOutput = gorge(getScriptDir() / execName)
  16. doAssert relOutput == "gorge test"
  17. doAssert absOutput == "gorge test"
  18. block gorgeEx:
  19. const
  20. execName = when defined(windows): "tgorgeex.bat" else: "./tgorgeex.sh"
  21. res = gorgeEx(execName)
  22. doAssert res.output == "gorgeex test"
  23. doAssert res.exitCode == 1