File: coverage.sh

package info (click to toggle)
mia 2.4.6-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 15,244 kB
  • sloc: cpp: 158,736; python: 1,261; sh: 315; xml: 127; makefile: 30; csh: 24; ansic: 9
file content (24 lines) | stat: -rwxr-xr-x 615 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

if [ -e Makefile ]; then 
	make -j8 && make test
elif [-e rules.ninja ]; then 
	ninja && ninja test
fi

if [ "x$?" = "x0" ]; then 

    lcov --base-directory . --directory . -c -o mia.info

    # remove system library files 
    lcov --remove mia.info "/usr*" -o mia.info
    lcov --remove mia.info "mia2/src*" -o mia.info

    # generate the html report, note that genhtml may have some problems with a few files
    # that will currently need to be removed manually
    rm -rf test-coverage

    genhtml -o test-coverage -t "Mia coverage" --num-spaces 2 mia.info
else
    echo build or test failed 
fi