blob: 3d82da0d4ee754b5484ea4c3b4056d373a00fd2b [file] [log] [blame]
#!/bin/bash
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -eu
cd -- "$(dirname -- "$0")"
cd -P ..
if [ $# -ne 1 ]; then
printf "Usage: %s PACKAGE" "$0" >&2
exit 1
fi
if ! command -v go >/dev/null; then
echo "go is not installed" >&2
exit 1
fi
export GOPATH="$PWD:/usr/lib/gopath"
go test -covermode=count -coverprofile=coverage.out "$@"
go tool cover -html=coverage.out