-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
49 lines (43 loc) · 948 Bytes
/
test.sh
File metadata and controls
49 lines (43 loc) · 948 Bytes
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
set -e
run=false
memtest=false
while test $# -gt 0; do
case "$1" in
-r|--run)
run=true
shift
;;
-m|--memtest)
memtest=true
shift
;;
*)
break
esac
done
prog=build/bin/Debug/csr
if [ $run == false ]; then
if [ $memtest == true ]; then
./build.sh -m
prog=build/bin/MemTest/csr
else
./build.sh
fi
echo
fi
if [ ! -e "$prog" ]; then
echo "[TEST_SCRIPT] Program at $prog doesn't exist."
exit 1
fi
echo "-----------------------------------------"
echo " RUNNING "
if [ $memtest == true ]; then
echo " MEMTEST "
echo "-----------------------------------------"
echo
valgrind --leak-check=yes "$prog" "$@"
else
echo "-----------------------------------------"
echo
build/bin/Debug/csr "$@"
fi