1
- import std/ [unittest, strutils, osproc]
1
+ import std/ [unittest, strutils, osproc, os ]
2
2
3
3
when not defined skipbuild:
4
4
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
13
13
14
14
test " can build addons with CMake" :
15
15
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" )
17
17
if status.exitCode != 0 :
18
18
echo status.output
19
19
else :
20
20
echo " [OK] " & addonName & " .nim"
21
21
assert status.exitCode == 0
22
22
23
23
test " can run myaddon (NodeJS)" :
24
- let status = execCmdEx (" node tests/js/ myaddon.js" )
24
+ let status = execCmdEx (" node " & " tests" / " js " / " myaddon.js" )
25
25
let hello = status.output.strip ()
26
26
echo hello
27
27
assert hello == " Hello, World! from Nim. This is awesome!"
28
28
assert status.exitCode == 0
29
29
30
30
test " can run mypromise (NodeJS)" :
31
- let status = execCmdEx (" node tests/js/ mypromise.js" )
31
+ let status = execCmdEx (" node " & " tests" / " js " / " mypromise.js" )
32
32
echo status.output.strip ()
33
33
assert status.exitCode == 0
34
34
35
35
test " can run myobject (NodeJS)" :
36
- let status = execCmdEx (" node tests/js/ myobject.js" )
36
+ let status = execCmdEx (" node " & " tests" / " js " / " myobject.js" )
37
37
echo status.output.strip ()
38
38
assert status.exitCode == 0
39
39
40
40
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