Built tag-ify sealtesting

This commit is contained in:
Jeff Mitchell 2016-04-28 00:47:44 +00:00
parent a50e29f086
commit 1027b51d17
3 changed files with 10 additions and 3 deletions

View File

@ -2,6 +2,7 @@ TEST?=$$(go list ./... | grep -v /vendor/)
VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -printf -rangeloops -shift -structtags -unsafeptr
EXTERNAL_TOOLS=\
github.com/mitchellh/gox
BUILD_TAGS?=vault
default: test
@ -16,7 +17,7 @@ dev: generate
# test runs the unit tests and vets the code
test: generate
VAULT_TOKEN= VAULT_ACC= go test $(TEST) $(TESTARGS) -timeout=120s -parallel=4
VAULT_TOKEN= VAULT_ACC= go test -tags='$(BUILD_TAGS)' $(TEST) $(TESTARGS) -timeout=120s -parallel=4
# testacc runs acceptance tests
testacc: generate
@ -24,11 +25,11 @@ testacc: generate
echo "ERROR: Set TEST to a specific package"; \
exit 1; \
fi
VAULT_ACC=1 go test $(TEST) -v $(TESTARGS) -timeout 45m
VAULT_ACC=1 go test -tags='$(BUILD_TAGS)' $(TEST) -v $(TESTARGS) -timeout 45m
# testrace runs the race checker
testrace: generate
CGO_ENABLED=1 VAULT_TOKEN= VAULT_ACC= go test -race $(TEST) $(TESTARGS)
CGO_ENABLED=1 VAULT_TOKEN= VAULT_ACC= go test -tags='$(BUILD_TAGS)' -race $(TEST) $(TESTARGS)
cover:
./scripts/coverage.sh --html

View File

@ -11,6 +11,9 @@ DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )"
# Change into that directory
cd "$DIR"
# Set build tags
BUILD_TAGS="${VAULT_BUILD_TAGS:-"vault"}"
# Get the git commit
GIT_COMMIT="$(git rev-parse HEAD)"
GIT_DIRTY="$(test -n "`git status --porcelain`" && echo "+CHANGES" || true)"
@ -45,6 +48,7 @@ gox \
-arch="${XC_ARCH}" \
-ldflags "-X github.com/hashicorp/vault/version.GitCommit='${GIT_COMMIT}${GIT_DIRTY}'" \
-output "pkg/{{.OS}}_{{.Arch}}/vault" \
-tags="${BUILD_TAGS}" \
.
# Move all the compiled things to the $GOPATH/bin

View File

@ -1,3 +1,5 @@
// +build vault
package vault
import (