File: coverage

package info (click to toggle)
docker-libkv 0.2.1-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 372 kB
  • sloc: sh: 85; makefile: 5
file content (21 lines) | stat: -rwxr-xr-x 533 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

MODE="mode: count"
ROOT=${TRAVIS_BUILD_DIR:-.}/../../..

# Grab the list of packages.
# Exclude the API and CLI from coverage as it will be covered by integration tests.
PACKAGES=`go list ./...`

# Create the empty coverage file.
echo $MODE > goverage.report

# Run coverage on every package.
for package in $PACKAGES; do
	output="$ROOT/$package/coverage.out"

	go test -test.short -covermode=count -coverprofile=$output $package
	if [ -f "$output" ] ; then
		cat "$output" | grep -v "$MODE" >> goverage.report
	fi
done