aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgenotrance <dev@genotrance.com>2018-08-06 11:36:11 -0500
committerGitHub <noreply@github.com>2018-08-06 11:36:11 -0500
commitdb0363505e13feaea27a7077452f3e20e6935346 (patch)
treec10fc1df1d91e3a021b32ef589b148a832377439
parent2c3cc71540f94783a98f34a82afc5c40bf320dd3 (diff)
parentc6148571c10d073b2c4c4a6392c5a43e747315b4 (diff)
downloadnimgen-db0363505e13feaea27a7077452f3e20e6935346.tar.gz
nimgen-db0363505e13feaea27a7077452f3e20e6935346.zip
Merge pull request #34 from jyapayne/fix_unittest_continue
Fix unit test for Windows and quit with failure code
-rw-r--r--tests/rununittests.nim4
-rw-r--r--tests/unittests/testfileops.nim2
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/rununittests.nim b/tests/rununittests.nim
index a92ff0a..865f77d 100644
--- a/tests/rununittests.nim
+++ b/tests/rununittests.nim
@@ -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()
diff --git a/tests/unittests/testfileops.nim b/tests/unittests/testfileops.nim
index 2fff387..076c586 100644
--- a/tests/unittests/testfileops.nim
+++ b/tests/unittests/testfileops.nim
@@ -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'")