summary refs log tree commit diff stats
path: root/tests/vm/tgorge.nim
blob: 1f77d2c959a2ef27cae4887a614ebddc33a24521 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
discard """
disabled: "windows"
"""

# If your os is windows and this test fails for you locally, please
# check what is going wrong.

import os

template getScriptDir(): string =
  parentDir(instantiationInfo(-1, true).filename)

# See also simpler test in Nim/tests/vm/tvmops.nim for a simpler
# cross platform way.
block gorge:
  const
    execName = when defined(windows): "tgorge.bat" else: "./tgorge.sh"
    relOutput = gorge(execName)
    absOutput = gorge(getScriptDir() / execName)

  doAssert relOutput == "gorge test"
  doAssert absOutput == "gorge test"

block gorgeEx:
  const
    execName = when defined(windows): "tgorgeex.bat" else: "./tgorgeex.sh"
    res = gorgeEx(execName)
  doAssert res.output == "gorgeex test"
  doAssert res.exitCode == 1