File: gather-coverage.sh

package info (click to toggle)
gap-io 4.5.4%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 860 kB
  • sloc: xml: 2,887; ansic: 2,711; sh: 52; makefile: 32
file content (31 lines) | stat: -rwxr-xr-x 780 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/env bash
set -ex

# If we don't care about code coverage, do nothing
if [[ -n $NO_COVERAGE ]]; then
    exit 0
fi

GAP="$GAPROOT/bin/gap.sh -l $PWD; --quitonbreak -q"

# generate library coverage reports
$GAP -a 500M -m 500M -q <<GAPInput
if LoadPackage("profiling") <> true then
    Print("ERROR: could not load profiling package");
    FORCE_QUIT_GAP(1);
fi;
d := Directory("$COVDIR");;
covs := [];;
for f in DirectoryContents(d) do
    if f in [".", ".."] then continue; fi;
    Add(covs, Filename(d, f));
od;
Print("Merging coverage results from ", covs, "\n");
r := MergeLineByLineProfiles(covs);;
Print("Outputting JSON\n");
OutputJsonCoverage(r, "gap-coverage.json");;
QUIT_GAP(0);
GAPInput

# generate source coverage reports by running gcov
gcov -o . src/*.c*