Skip to content

Commit b54f085

Browse files
committed
chore: update .gitignore and Makefile to include test coverage
Add .testCoverage.txt to .gitignore to exclude test coverage files from version control. Update Makefile to include a test target that generates a coverage profile and ensures tests are run before building the application.
1 parent 194f435 commit b54f085

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ bin
55

66
# dev
77
profiles
8+
.testCoverage.txt

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ all: $(helpme) gen_mem_password_example gen_secure_password_example find_go_pkg_
1010
GO_FILES := $(shell git ls-files '*.go')
1111
.PHONY: $(GO_FILES)
1212

13-
$(helpme): $(GO_FILES)
13+
$(helpme): $(GO_FILES) test
1414
@echo "Building..."
1515
@go build -o $(build_dir)/helpme .
1616

@@ -30,7 +30,11 @@ install: $(helpme)
3030
@echo "Installing..."
3131
@go install -ldflags "-X github.com/vldcreation/helpme/cmd.Version=v1.0.0 -X github.com/vldcreation/helpme/cmd.Date=$(shell date -u '+%Y-%m-%d_%I:%M:%S%p') -X github.com/vldcreation/helpme/cmd.Commit=$(shell git rev-parse HEAD)" .
3232

33-
build: clean $(helpme)
33+
build: clean test $(helpme)
34+
35+
test:
36+
@echo "Testing..."
37+
@go test $(go list ./... | grep -v /vendor/ | grep -v /local/ | grep -v /examples/) -coverprofile .testCoverage.txt
3438

3539
clean:
3640
@echo "Cleaning..."

0 commit comments

Comments
 (0)