1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
# Package
version = "0.4.4"
author = "genotrance"
description = "C/C++ interop for Nim"
license = "MIT"
bin = @["nimterop/toast"]
installDirs = @["nimterop"]
installFiles = @["config.nims"]
# Dependencies
requires "nim >= 0.20.2", "regex#v0.13.1", "cligen >= 0.9.43"
import nimterop/docs
proc execCmd(cmd: string) =
echo "execCmd:" & cmd
exec cmd
proc execTest(test: string, flags = "") =
execCmd "nim c --hints:off -f " & flags & " -r " & test
execCmd "nim cpp --hints:off " & flags & " -r " & test
task buildToast, "build toast":
execCmd("nim c --hints:off nimterop/toast.nim")
task bt, "build toast":
execCmd("nim c --hints:off -d:danger nimterop/toast.nim")
task btd, "build toast":
execCmd("nim c -g nimterop/toast.nim")
task docs, "Generate docs":
buildDocs(@["nimterop/all.nim"], "build/htmldocs")
task test, "Test":
buildToastTask()
execTest "tests/tast2.nim"
execTest "tests/tast2.nim", "-d:HEADER"
execTest "tests/tnimterop_c.nim"
execTest "tests/tnimterop_c.nim", "-d:FLAGS=\"-f:ast2\""
execTest "tests/tnimterop_c.nim", "-d:FLAGS=\"-f:ast2 -H\""
execCmd "nim cpp --hints:off -f -r tests/tnimterop_cpp.nim"
execCmd "./nimterop/toast -pnk -E=_ tests/include/toast.h"
execCmd "./nimterop/toast -pnk -E=_ -f:ast2 tests/include/toast.h"
execTest "tests/tpcre.nim"
execTest "tests/tpcre.nim", "-d:FLAGS=\"-f:ast2\""
# Platform specific tests
when defined(Windows):
execTest "tests/tmath.nim"
execTest "tests/tmath.nim", "-d:FLAGS=\"-f:ast2\""
execTest "tests/tmath.nim", "-d:FLAGS=\"-f:ast2 -H\""
if defined(OSX) or defined(Windows) or not existsEnv("TRAVIS"):
execTest "tests/tsoloud.nim"
execTest "tests/tsoloud.nim", "-d:FLAGS=\"-f:ast2\""
execTest "tests/tsoloud.nim", "-d:FLAGS=\"-f:ast2 -H\""
# getHeader tests
withDir("tests"):
execCmd("nim e getheader.nims")
if not existsEnv("APPVEYOR"):
execCmd("nim e wrappers.nims")
docsTask()
|