-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgo
executable file
·78 lines (73 loc) · 2.06 KB
/
go
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
71
72
73
74
75
76
77
78
#!/bin/sh
set -e
set -x
nimflags="-d:usemalloc --verbosity:0 --mm:arc --panics:on "
nimflags="$nimflags --debugger:native "
#nimflags="$nimflags --passC:-g --passL:-g"
run()
{
cmd=$1
src=$2
bin=`echo $src | sed -e 's/.nim$//g'`
case $1 in
run)
nim c ${nimflags} -d:danger ${src} && ${bin}
;;
perf)
nim c ${nimflags} -d:danger ${src} && perf record -g ${bin}
;;
tsan)
nim c ${nimflags} -d:danger --passC:-fsanitize=thread --passL:-fsanitize=thread ${src} && ${bin}
;;
asan)
nim c ${nimflags} -d:danger --passC:-fsanitize=address --passL:-fsanitize=address ${src} && ${bin}
;;
tsand)
nim c ${nimflags} --passC:-fsanitize=thread --passL:-fsanitize=thread ${src} && ${bin}
;;
asand)
nim c ${nimflags} --passC:-fsanitize=address --passL:-fsanitize=address ${src} && ${bin}
;;
valgrind)
nim c ${nimflags} -d:danger ${src} && valgrind --exit-on-first-error=yes --error-exitcode=255 --quiet --leak-check=full --show-leak-kinds=all ${bin}
;;
valgrind2)
nim c ${nimflags} -d:danger ${src} && valgrind --exit-on-first-error=yes --error-exitcode=255 --quiet ${bin}
;;
helgrind)
nim c ${nimflags} -d:danger ${src} && valgrind --exit-on-first-error=yes --error-exitcode=255 --quiet --tool=helgrind ${bin}
;;
drd)
nim c ${nimflags} -d:danger ${src} && valgrind --exit-on-first-error=yes --error-exitcode=255 --quiet --tool=drd --suppressions=./misc/valgrind-drd-suppressions ${bin}
;;
bitline)
nim c ${nimflags} -d:danger -d:optbitline:bitline.log ${src} && ${bin}
;;
release)
nim c ${nimflags} -d:release ${src} && ${bin}
;;
debug)
nim c ${nimflags} ${src} && ${bin}
;;
gdb)
nim c ${nimflags} ${src} && gdb ${bin}
;;
strace)
nim c ${nimflags} ${src} && strace -f ${bin}
;;
all)
./go run tests/texit
./go valgrind tests/texit
./go helgrind tests/texit
./go drd tests/texit
./go tsan tests/texit
./go asan tests/texit
./go debug tests/texit
./go run tests/tlink
./go run tests/tmillions
./go run tests/tasynciopipe
figlet "all good"
;;
esac
}
run $1 $2