-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWerkfile
54 lines (47 loc) · 1.06 KB
/
Werkfile
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
default target = "build"
config profile = "debug"
# Pick cflags based on the build profile
let cflags = profile | match {
"debug" => ["-O0"]
"release" => ["-O3"]
"asan-address" => ["-O0", "--sanitize=address"]
"%" => ""
}
build "cbril" {
#from glob "cbril/*.c3"
from [
"cbril/main.c3",
"cbril/bril.c3",
"cbril/analysis.c3",
"cbril/util.c3",
"libs/json-c3/json.c3",
"libs/json-c3/deserialize.c3",
"libs/json-c3/serialize.c3",
"libs/json-c3/lex.c3",
"libs/opter-c3/opter.c3",
]
run "c3c compile {cflags*} <in*> -o <out:out-dir>"
}
build "testrun" {
from [
"cbril/util.c3",
]
run "c3c compile-test --suppress-run {cflags*} <in*> -o <out:out-dir>"
}
task build {
build "cbril"
}
task test {
let test_exe = "testrun"
build test_exe
run "<test_exe>"
}
# `werk test -Dturnt-args=-v`
# --save
# --diff
let turnt-args = ""
task turnt {
build "cbril"
let test_inputs = glob "test/**/*.bril"
run "time turnt {turnt-args} -j <test_inputs*>"
}