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