diff --git a/project/make/test-unit b/project/make/test-unit index 9225b33a06..700eaa49a3 100644 --- a/project/make/test-unit +++ b/project/make/test-unit @@ -27,6 +27,11 @@ bundle_test_unit() { export TESTFLAGS export HAVE_GO_TEST_COVER 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 # accomodate parallel to be able to access variables export SHELL="$BASH" @@ -34,10 +39,6 @@ bundle_test_unit() { mkdir -p "$HOME/.parallel" 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" rm -rf "$HOME" else @@ -47,6 +48,7 @@ bundle_test_unit() { # don't let one directory that fails to build tank _all_ our tests! done fi + rm -f "$BUILDFLAGS_FILE" ) echo "$TESTDIRS" | go_run_test_dir }