Fix determination of ICC path when ifort is a symlink
[charm.git] / coverage / coverage.sh
blob41adda7e779ba1078534855cf602ea7b6859400e
1 #!/bin/bash
3 # it is possible to run the coverage across multiple builds, but the
4 # coverage process is designed to report that SomeBinary has coverage
5 # percentage Y. Not, source file X has sum(across all compilations
6 # and tests) coverage. So what you end up with is a discrete coverage
7 # calculation for each platform for each source file. Which makes it
8 # pretty pointless to run this on more than one platform at a time.
10 # However, if you want to build a bunch at one, here is a representative set
11 #declare -a BUILDS=("multicore-linux-x86_64" "netlrts-linux-x86_64" "netlrts-linux-x86_64-smp")
13 if [[ "$#" -gt 0 ]]; then
14 declare -a BUILDS
15 while [[ "$#" > 0 ]]
17 BUILDS+=("$1");
18 shift;
19 echo "BUILD now $BUILDS";
20 echo "ARGC now $#";
21 done
22 else
23 declare -a BUILDS=("netlrts-linux-x86_64-smp")
26 echo "testing builds $BUILDS"
28 /bin/rm -f summary.txt
30 covdir="$PWD"
32 for b in "${BUILDS[@]}" ; do
33 covbuild="$b-covbuild"
34 echo "coverage base directory $covdir buildir $covbuild"
35 /bin/rm -f "$b"-cov.info
36 cd ../
37 if [ -d "$covbuild" ] ; then
38 /bin/rm -rf "$covbuild"
40 ./build LIBS "$b" -j8 --suffix "covbuild" --coverage -O0 -save #-fprofile-update=atomic
41 cd "$covbuild/tests/"
42 make -j8 OPTS+="--coverage -save"
43 cd ../examples
44 make -j8 OPTS+="--coverage -save"
45 cd ../tmp/
46 make -j8 test
47 testname="$(cut -d'-' -f1 <<<"$b")"
48 testsuff="$(cut -d'-' -f4 <<<"$b")"
49 if [ "$testsuff" = "smp" ] ; then
50 testname=$testsuff
52 echo "test $testname"
53 cd ../..
54 lcov --capture --directory "$covbuild"/tmp --rc lcov_branch_coverage=1 --output-file "$covdir"/"$b"-cov.info --test-name "$testname"
55 # lcov --add-tracefile "$b"-cov.info --output-file coverage/"$b"-total.info >> summary.txt
56 cd "$covdir"
57 genhtml "$covdir/$b-cov.info" --description-file tests.desc -o "$covdir/$b"-cov-html >> gensummary.txt
58 done
61 /bin/rm -f ckconv
63 gcc ck-convcore-summary.C -o ckconv
64 for b in "${BUILDS[@]}" ; do
65 ./ckconv "$b"-cov.info >> summary.txt
66 done