Files
docker-cli/components/engine/hack/make/test
Tianon Gravi 788a1fc558 Update Dockerfile and hack to support compiling device-mapper code statically (using go1.2rc1)
Upstream-commit: 06d0843a61843e6b16a56d518e21032a5652098b
Component: engine
2013-10-03 10:32:47 -06:00

30 lines
625 B
Bash

#!/bin/sh
DEST=$1
set -e
# Run Docker's test suite, including sub-packages, and store their output as a bundle
bundle_test() {
{
date
for test_dir in $(find_test_dirs); do (
set -x
cd $test_dir
go test -v -ldflags "$LDFLAGS" $BUILDFLAGS
) done
} 2>&1 | tee $DEST/test.log
}
# This helper function walks the current directory looking for directories
# holding Go test files, and prints their paths on standard output, one per
# line.
find_test_dirs() {
find . -name '*_test.go' | grep -v '^./vendor' |
{ while read f; do dirname $f; done; } |
sort -u
}
bundle_test