-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathconfig.nims
67 lines (51 loc) · 1.31 KB
/
config.nims
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
import ospaths
srcdir = "src"
template dep(name: untyped): untyped =
exec "nim " & astToStr(name)
proc buildBase(debug: bool, bin: string, src: string) =
switch("out", (thisDir() & "/" & bin).toExe)
--nimcache: build
--threads:on
if not debug:
--forceBuild
--define: release
--opt: size
else:
--define: debug
--debuginfo
--debugger: native
--linedir: on
--stacktrace: on
--linetrace: on
--verbosity: 1
--path: src
--path: srcdir
setCommand "c", src
proc test(name: string) =
if not dirExists "bin":
mkDir "bin"
--run
buildBase true, "bin/test_" & name, "tests/fp/test_" & name
proc example(bin: string, name: string) =
if not dirExists "bin":
mkDir "bin"
--run
buildBase false, "bin/ex_" & bin, "examples" / name
task test_int, "Run all tests - internal":
test "all"
task test, "Run all tests":
dep test_int
task test_either, "Run Either tests":
test "either"
task test_list, "Run List tests":
test "list"
task test_option, "Run Option tests":
test "option"
task test_forcomp, "Run for comprehension tests":
test "forcomp"
task test_concurrent, "Run concurrent tests":
test "concurrent"
task test_futurem, "Run futurem tests":
test "futurem"
task ex_httpactor, "Run httpactor example":
example "httpactor", "httpactor" / "main"