mirror of
https://github.com/docker/docs.git
synced 2026-04-01 16:58:54 +07:00
to merge them, to get more complete coverage information (so a package can be tested by code outside the package). Signed-off-by: Ying Li <ying.li@docker.com>
11 lines
407 B
Bash
Executable File
11 lines
407 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Given a subpackage and the containing package, figures out which packages
|
|
# need to be passed to `go test -coverpkg`: this includes all of the
|
|
# subpackage's dependencies within the containing package, as well as the
|
|
# subpackage itself.
|
|
|
|
DEPENDENCIES="$(go list -f $'{{range $f := .Deps}}{{$f}}\n{{end}}' ${1} | grep ${2})"
|
|
|
|
echo "${1} ${DEPENDENCIES}" | xargs echo -n | tr ' ' ','
|