Merge pull request #34 from jyapayne/fix_unittest_continue

Fix unit test for Windows and quit with failure code
This commit is contained in:
genotrance 2018-08-06 11:36:11 -05:00 committed by GitHub
commit db0363505e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -1,8 +1,10 @@
import os, osproc, strutils
proc main() =
var failures = 0
for file in walkFiles(currentSourcePath().splitPath().head / "unittests/*.nim"):
let (path, fname, ext) = file.splitFile()
if fname.startswith("test"):
discard execCmd "nim c -r " & file
failures += execCmd "nim c -r " & file
quit(failures)
main()

View file

@ -120,7 +120,7 @@ suite "test file ops":
test "pipe command into file":
when defined(windows):
pipe(testfilename, "(ECHO foo)>>$file")
pipe(testfilename, "ECHO foo")
testfilename.checkFile("foo")
else:
pipe(testfilename, "cat $file | grep 'this is text'")