Skip to content

Commit

Permalink
Merge pull request #1215 from ksamoray/build-coverage
Browse files Browse the repository at this point in the history
Add a make target for build with code coverage
  • Loading branch information
ksamoray authored May 26, 2024
2 parents 5162981 + c0f668b commit f54f315
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
WEBSITE_REPO=github.com/hashicorp/terraform-website
PKG_NAME=nsxt
GIT_COMMIT=$$(git rev-list -1 HEAD)
GOPATH=$$(go env GOPATH)

default: build

Expand All @@ -14,6 +15,9 @@ tools:
build: fmtcheck
go install -ldflags "-X github.com/vmware/terraform-provider-nsxt/nsxt.GitCommit=$(GIT_COMMIT)"

build-coverage:
go build -cover -ldflags "-X github.com/vmware/terraform-provider-nsxt/nsxt.GitCommit=$(GIT_COMMIT)" -o $(GOPATH)/bin

test: fmtcheck
go test -i $(TEST) || exit 1
echo $(TEST) | \
Expand Down

0 comments on commit f54f315

Please sign in to comment.