Skip to content

Commit 2ae70f8

Browse files
committed
update tests
Signed-off-by: George Lemon <[email protected]>
1 parent 2741eec commit 2ae70f8

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

tests/test1.nim

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
1-
import std/[unittest, strutils, osproc]
1+
import std/[unittest, strutils, osproc, os]
22

33
when not defined skipbuild:
44
var addons = ["myaddon", "myobject", "mypromise", "myexceptions"]
5-
test "can build addons with node-gyp":
6-
for addonName in addons:
7-
let status = execCmdEx("denim build ./tests/" & addonName & ".nim -y")
8-
if status.exitCode != 0:
9-
echo status.output
10-
else:
11-
echo "[OK] " & addonName & ".nim"
12-
assert status.exitCode == 0
5+
# test "can build addons with node-gyp":
6+
# for addonName in addons:
7+
# let status = execCmdEx("denim build tests" / addonName & ".nim -y")
8+
# if status.exitCode != 0:
9+
# echo status.output
10+
# else:
11+
# echo "[OK] " & addonName & ".nim"
12+
# assert status.exitCode == 0
1313

1414
test "can build addons with CMake":
1515
for addonName in addons:
16-
let status = execCmdEx("./bin/denim build ./tests/" & addonName & ".nim --cmake -y")
16+
let status = execCmdEx("denim build tests" / addonName & ".nim --cmake -y")
1717
if status.exitCode != 0:
1818
echo status.output
1919
else:
2020
echo "[OK] " & addonName & ".nim"
2121
assert status.exitCode == 0
2222

2323
test "can run myaddon (NodeJS)":
24-
let status = execCmdEx("node tests/js/myaddon.js")
24+
let status = execCmdEx("node " & "tests" / "js" / "myaddon.js")
2525
let hello = status.output.strip()
2626
echo hello
2727
assert hello == "Hello, World! from Nim. This is awesome!"
2828
assert status.exitCode == 0
2929

3030
test "can run mypromise (NodeJS)":
31-
let status = execCmdEx("node tests/js/mypromise.js")
31+
let status = execCmdEx("node " & "tests" / "js" / "mypromise.js")
3232
echo status.output.strip()
3333
assert status.exitCode == 0
3434

3535
test "can run myobject (NodeJS)":
36-
let status = execCmdEx("node tests/js/myobject.js")
36+
let status = execCmdEx("node " & "tests" / "js" / "myobject.js")
3737
echo status.output.strip()
3838
assert status.exitCode == 0
3939

4040
test "can run myexceptions (NodeJS)":
41-
let status = execCmdEx("node tests/js/myexceptions.js")
42-
assert status.exitCode == 1
41+
let status = execCmdEx("node " & "tests" / "js" / "myexceptions.js")
42+
assert status.exitCode == 1

0 commit comments

Comments
 (0)