Skip to content

Commit

Permalink
Add a make target for build with code coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Kobi Samoray <[email protected]>
  • Loading branch information
ksamoray committed May 22, 2024
1 parent e43e952 commit c0f668b
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 c0f668b

Please sign in to comment.