forked from aweltsch/appfs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makeall.sh
executable file
·50 lines (40 loc) · 1.12 KB
/
makeall.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
#!/usr/bin/env bash
#
# compile the different codes (Makefiles are assumed to be present)
home=`pwd`
# don't do coverage every time
coverage=0
exes=(ex5 ex6 ex7)
tests=("$home"/data/corrupt* "$home"/data/error* "$home"/data/test*)
for ex in ${exes[@]}
do
students=(`find $ex -maxdepth 1 -mindepth 1 -type d`)
for student in ${students[@]}
do
cd "$student"
echo
echo "compiling code for $student"
make clean
rm -rf $home/scan/$student
mkdir -p $home/scan/$ex
scan-build -k -o $home/scan/$student make
if [ $coverage -eq 1 ]; then
for test in ${tests[@]}
do
if [ $student = "ex6/schrezenmaier" ] || [ $student = "ex5/schrezenmaier" ]; then
./$ex $test sol
else
./$ex $test
fi
done
mkdir -p cov/
# location of compiled code is not known - try some...
lcov -d obj/ -c -o cov/coverage.info
lcov -d src/ -c -o cov/coverage.info
lcov -d . -c -o cov/coverage.info
genhtml -o cov cov/coverage.info
fi
cd "$home"
done
done
exit