Add script/.build to keep BUILD_FLAGS in one place

This commit is contained in:
Tomas Kral
2016-08-11 16:50:16 +02:00
parent a15a8f36ca
commit e64f1c1215
4 changed files with 19 additions and 9 deletions
+4 -3
View File
@@ -1,6 +1,8 @@
#!/bin/bash
set -e
source "$(dirname "$BASH_SOURCE")/.build"
find_dirs() {
(
find . -not \( \
@@ -11,7 +13,7 @@ find_dirs() {
)
}
TEST_FLAGS="-tags experimental -cover -coverprofile=cover.out"
TEST_FLAGS=("${BUILD_FLAGS[@]}" -cover -coverprofile=cover.out)
if [ -z "$TEST_DIRS" ]; then
TEST_DIRS=$(find_dirs '*_test.go')
@@ -19,7 +21,6 @@ fi
TESTS_FAILED=()
set +e
for dir in $TEST_DIRS; do
go test ${TEST_FLAGS} "./${dir}"
go test "${TEST_FLAGS[@]}" "./${dir}"
done