-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·47 lines (39 loc) · 864 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
41
42
43
44
45
46
47
#!/bin/bash
USE_VALGRIND=0
USE_LOGGING=0
while getopts "vl:" o; do
case "${o}" in
v)
USE_VALGRIND=1
;;
l)
USE_LOGGING=1
LOG_FILE=$OPTARG
;;
esac
done
shift $((OPTIND -1))
echo "Cleaning"
make clean 1> /dev/null
echo "Making"
make 1> /dev/null
if [[ $USE_LOGGING == 1 ]]; then
echo "Using logging to $LOG_FILE"
fi
if [[ $USE_VALGRIND == 1 ]]; then
echo "Running with valgrind"
echo "################################"
if [[ $USE_LOGGING == 1 ]]; then
valgrind --leak-check=yes ./bin/main > $LOG_FILE
else
valgrind --leak-check=yes ./bin/main
fi
else
echo "Running normally"
echo "################################"
if [[ $USE_LOGGING == 1 ]]; then
./bin/main > $LOG_FILE
else
./bin/main
fi
fi