-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
40 lines (37 loc) · 840 Bytes
/
run.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
#!/bin/sh
MEMCHECK_FULL=0
ENABLE_GDB=0
INPUT_FILE="test.csv"
FILE_RUNNED=./build/cellulose
valgrind_mode() {
make
echo "running using valgrind"
if [ $MEMCHECK_FULL ]
then
echo Enabling full memcheck
valgrind --leak-check=full --show-leak-kinds=definite --log-file="valgrind_log.txt" $FILE_RUNNED $INPUT_FILE
else
valgrind $FILE_RUNNED $INPUT_FILE
fi
}
test_mode() {
echo "running all of the tests"
make test
./tests/cellulose_test
}
basic_run() {
make
$FILE_RUNNED $INPUT_FILE
}
# get command line flags execute_mode will be used to see how to execute the executable
case "${1}" in
"-v") valgrind_mode ;;
"-t") test_mode ;;
"-gt")
ENABLE_GDB=1
test_mode ;;
"-m")
MEMCHECK_FULL=1
valgrind_mode ;;
*) basic_run ;;
esac