1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/hack/test/unit
Daniel Nephin e593b72cc9 Fix exclude list in make.ps1
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-08-09 11:03:20 -04:00

25 lines
650 B
Bash
Executable file

#!/usr/bin/env bash
#
# Run unit tests
#
# TESTFLAGS - add additional test flags. Ex:
#
# TESTFLAGS="-v -run TestBuild" hack/test/unit
#
# TESTDIRS - run tests for specified packages. Ex:
#
# TESTDIRS="./pkg/term" hack/test/unit
#
set -eu -o pipefail
TESTFLAGS+=" -test.timeout=${TIMEOUT:-5m}"
BUILDFLAGS=( -tags "netgo seccomp libdm_no_deferred_remove" )
TESTDIRS="${TESTDIRS:-"./..."}"
exclude_paths="/vendor/|/integration"
if [ "$(go env GOHOSTOS)" = 'solaris' ]; then
exclude_paths="$exclude_paths|/daemon/graphdriver"
fi
pkg_list=$(go list $TESTDIRS | grep -vE "($exclude_paths)")
go test -cover "${BUILDFLAGS[@]}" $TESTFLAGS $pkg_list