reg/vendor/github.com/docker/docker-ce/components/cli/scripts/test/unit-with-coverage
Jess Frazelle 8e5eba8735
switch to dep
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
2017-12-11 14:50:55 -05:00

20 lines
432 B
Bash
Executable file

#!/usr/bin/env bash
set -eu -o pipefail
# install test dependencies once before running tests for each package. This
# reduces the runtime from 200s down to 23s
go test -i "$@"
for pkg in "$@"; do
./scripts/test/unit \
-cover \
-coverprofile=profile.out \
-covermode=atomic \
"${pkg}"
if test -f profile.out; then
cat profile.out >> coverage.txt
rm profile.out
fi
done