Fix export of BUILDFLAGS in test-unit. Closes #10832

Signed-off-by: Fabiano Rosas <farosas@br.ibm.com>
This commit is contained in:
Fabiano Rosas 2015-02-16 16:27:33 -02:00
parent 9ee8d41ab2
commit ab6ae7215e
1 changed files with 6 additions and 4 deletions

View File

@ -27,6 +27,11 @@ bundle_test_unit() {
export TESTFLAGS export TESTFLAGS
export HAVE_GO_TEST_COVER export HAVE_GO_TEST_COVER
export DEST export DEST
# some hack to export array variables
export BUILDFLAGS_FILE="buildflags_file"
( IFS=$'\n'; echo "${BUILDFLAGS[*]}" ) > "$BUILDFLAGS_FILE"
if command -v parallel &> /dev/null; then if command -v parallel &> /dev/null; then
# accomodate parallel to be able to access variables # accomodate parallel to be able to access variables
export SHELL="$BASH" export SHELL="$BASH"
@ -34,10 +39,6 @@ bundle_test_unit() {
mkdir -p "$HOME/.parallel" mkdir -p "$HOME/.parallel"
touch "$HOME/.parallel/ignored_vars" touch "$HOME/.parallel/ignored_vars"
# some hack to export array variables
export BUILDFLAGS_FILE="$HOME/buildflags_file"
( IFS=$'\n'; echo "${BUILDFLAGS[*]}" ) > "$BUILDFLAGS_FILE"
echo "$TESTDIRS" | parallel --jobs "$PARALLEL_JOBS" --env _ "$(dirname "$BASH_SOURCE")/.go-compile-test-dir" echo "$TESTDIRS" | parallel --jobs "$PARALLEL_JOBS" --env _ "$(dirname "$BASH_SOURCE")/.go-compile-test-dir"
rm -rf "$HOME" rm -rf "$HOME"
else else
@ -47,6 +48,7 @@ bundle_test_unit() {
# don't let one directory that fails to build tank _all_ our tests! # don't let one directory that fails to build tank _all_ our tests!
done done
fi fi
rm -f "$BUILDFLAGS_FILE"
) )
echo "$TESTDIRS" | go_run_test_dir echo "$TESTDIRS" | go_run_test_dir
} }