-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcover.sh
executable file
·66 lines (53 loc) · 1.23 KB
/
cover.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
#!/usr/bin/env bash
#
# Copyright Christopher Kormanyos 2024.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/Fortran/gamma/.gcov/make
# ./cover.sh
if [[ "$1" != "" ]]; then
STD="$1"
else
STD=f2018
fi
echo 'clean and create temporary directories'
echo
mkdir -p bin
mkdir -p obj
rm -rf bin
rm -rf obj
mkdir -p bin
mkdir -p obj
echo
echo 'compile and link bin/gamma'
echo
g++ -O0 -std=$STD -x f77 -c -fprofile-arcs -ftest-coverage ../../gamma.f -o obj/gamma.o
g++ -x none -fprofile-arcs -ftest-coverage obj/gamma.o -lquadmath -lgfortran -o bin/gamma
echo
echo 'verify existence of bin/gamma'
echo
ls -la bin/gamma
res_00=$?
echo
echo 'execute bin/gamma'
echo
bin/gamma
res_01=$?
echo
echo 'run gcov, lcov and htmlgen'
echo
gcov obj/gamma.f
lcov --capture --directory . --output-file coverage.info
genhtml coverage.info --output-directory bin/report
res_02=$?
result_total=$((res_00+res_01+res_02))
echo
echo "res_00 : " "$res_00"
echo "res_01 : " "$res_01"
echo "res_02 : " "$res_02"
echo "result_total : " "$result_total"
echo "gamma_tests"
echo
exit $result_total