forked from maspadaru/laser-plus-plus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
laser.sh
executable file
·115 lines (100 loc) · 2.24 KB
/
laser.sh
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/bash
TESTAPP_EXECUTABLE=testapp
GTEST_EXECUTABLE=run_gtest
build_release() {
mkdir -p cmake-build-release
cd cmake-build-release
cmake -DCMAKE_BUILD_TYPE=Release ..
make # placeholder, should build L++ library
cd ..
}
build_testapp() {
mkdir -p cmake-build-debug
cd cmake-build-debug
cmake -DCMAKE_BUILD_TYPE=Debug ..
#make VERBOSE=1 testapp
make testapp
cd ..
}
build_gtest() {
mkdir -p cmake-build-debug
cd cmake-build-debug
cmake -DCMAKE_BUILD_TYPE=Debug ..
make run_gtest
cd ..
}
clean_up () {
rm -rf cmake-build-debug
rm -rf cmake-build-release
}
run_testapp () {
build_testapp
cmake-build-debug/$TESTAPP_EXECUTABLE
}
debug_testapp () {
build_testapp
gdb cmake-build-debug/$TESTAPP_EXECUTABLE --tui
}
run_gtest () {
build_gtest
cmake-build-debug/$GTEST_EXECUTABLE
}
run_valgrind_testapp () {
build_testapp
valgrind cmake-build-debug/$TESTAPP_EXECUTABLE
}
run_valgrind_gtest () {
build_gtest
valgrind cmake-build-debug/$GTEST_EXECUTABLE
}
run_valgrind_testapp_v () {
build_testapp
valgrind -v cmake-build-debug/$TESTAPP_EXECUTABLE
}
run_valgrind_gtest_v () {
build_gtest
valgrind -v cmake-build-debug/$GTEST_EXECUTABLE
}
print_help () {
echo "Usage: laser.sh [b c d h r t]"
echo "b: build Laser++"
echo "c: Clean project"
echo "d: Debug Test App using GDB"
echo "h: Print help"
echo "r: Run Test App"
echo "t: Run all testcases"
echo "vr: Run Valgrind on Test App"
echo "vt: Run valgrind on testcases"
echo " "
}
if [ $# -eq 0 ]; then
print_help
elif [ $1 = "b" ]; then
build_release
elif [ $1 = "br" ]; then
build_testapp
elif [ $1 = "bt" ]; then
build_gtest
elif [ $1 = "c" ]; then
clean_up
elif [ $1 = "d" ]; then
debug_testapp
elif [ $1 = "h" ]; then
print_help
elif [ $1 = "r" ]; then
run_testapp
elif [ $1 = "t" ]; then
run_gtest
elif [ $1 = "vr" ]; then
run_valgrind_testapp
elif [ $1 = "vt" ]; then
run_valgrind_gtest_v
elif [ $1 = "vrv" ]; then
run_valgrind_testapp_v
elif [ $1 = "vtv" ]; then
run_valgrind_gtest
else
print_help
fi
#ln -s cmake-build-debug/compile_commands.json
# cmake-build-debug/run_gtest --gtest_filter=AtomsTest.Atom