Move the body of go_compile_test_dir into a file since GNU Parallel breaks on sourcing exported Bash functions thanks to the shellshock fixes
Signed-off-by: Andrew Page <admwiggin@gmail.com> Upstream-commit: 8ffdf6022e88e19c6d1f434a69ff5cbd3dc7db6b Component: engine
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Compile phase run by parallel in test-unit. No support for coverpkg
|
||||
|
||||
dir=$1
|
||||
out_file="$DEST/precompiled/$dir.test"
|
||||
testcover=()
|
||||
if [ "$HAVE_GO_TEST_COVER" ]; then
|
||||
# if our current go install has -cover, we want to use it :)
|
||||
mkdir -p "$DEST/coverprofiles"
|
||||
coverprofile="docker${dir#.}"
|
||||
coverprofile="$DEST/coverprofiles/${coverprofile//\//-}"
|
||||
testcover=( -cover -coverprofile "$coverprofile" ) # missing $coverpkg
|
||||
fi
|
||||
if [ "$BUILDFLAGS_FILE" ]; then
|
||||
readarray -t BUILDFLAGS < "$BUILDFLAGS_FILE"
|
||||
fi
|
||||
(
|
||||
cd "$dir"
|
||||
go test "${testcover[@]}" -ldflags "$LDFLAGS" "${BUILDFLAGS[@]}" $TESTFLAGS -c
|
||||
)
|
||||
[ $? -ne 0 ] && return 1
|
||||
mkdir -p "$(dirname "$out_file")"
|
||||
mv "$dir/$(basename "$dir").test" "$out_file"
|
||||
echo "Precompiled: ${DOCKER_PKG}${dir#.}"
|
||||
Reference in New Issue
Block a user