File: coverage.sh

package info (click to toggle)
golang-github-knqyf263-go-cpe 0.0~git20180327.659663f6-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 18,036 kB
  • sloc: sh: 11; makefile: 4
file content (17 lines) | stat: -rw-r--r-- 344 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env bash

set -e

# http://stackoverflow.com/a/21142256/2055281

echo "mode: atomic" > coverage.out
echo $@

for d in $@; do
    go test  -coverprofile=profile.out -covermode=atomic $d
    if [ -f profile.out ]; then
        echo "$(pwd)"
        cat profile.out | grep -v "mode: " >> coverage.out
        rm profile.out
    fi
done