mirror of
https://github.com/daylinmorgan/bbansi.git
synced 2024-11-22 01:10:44 -06:00
tests: make test binary compilation conditional
This commit is contained in:
parent
02ebab10d1
commit
565880e69a
1 changed files with 7 additions and 3 deletions
|
@ -3,6 +3,7 @@ import std/[
|
||||||
os,
|
os,
|
||||||
osproc,
|
osproc,
|
||||||
strutils,
|
strutils,
|
||||||
|
times,
|
||||||
unittest
|
unittest
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -14,9 +15,12 @@ proc cliRun(cmd: string): string =
|
||||||
|
|
||||||
suite "cli":
|
suite "cli":
|
||||||
setup:
|
setup:
|
||||||
let cmd = "nim c -o:" & pathToSrc / "bbansi.out " & (pathToSrc / ".." /
|
let
|
||||||
"src" / "bbansi.nim")
|
cli = pathToSrc / "bbansi.out"
|
||||||
check execCmdEx(cmd).exitCode == 0
|
srcDir = pathToSrc / ".." / "src"
|
||||||
|
cmd = "nim c -o:" & cli & " " & (srcDir / "bbansi.nim")
|
||||||
|
if getFileInfo(cli).lastWriteTime < getFileInfo(srcDir).lastWriteTime:
|
||||||
|
check execCmdEx(cmd).exitCode == 0
|
||||||
test "simple":
|
test "simple":
|
||||||
check "\e[31mRed\e[0m" == cliRun "[red]Red[/]"
|
check "\e[31mRed\e[0m" == cliRun "[red]Red[/]"
|
||||||
check "\e[1;31mRed\e[0m\e[1m Not Red but Bold\e[0m" ==
|
check "\e[1;31mRed\e[0m\e[1m Not Red but Bold\e[0m" ==
|
||||||
|
|
Loading…
Reference in a new issue