Allow for running dedicated tests

Signed-off-by: Steven Kriegler <sk.bunsenbrenner@gmail.com>
This commit is contained in:
justusbunsi 2021-10-17 10:53:54 +02:00
parent 49087433fb
commit 826204b667
No known key found for this signature in database
GPG key ID: 82B29BF2507F9F8B

View file

@ -7,15 +7,17 @@ help:
@echo " - build Build the bot"
@echo " - run Start the bot"
@echo " - clean Delete generated files"
@echo " - test Run test suite"
@echo " - coverage Run test suite and generates coverage report as HTML file"
@echo " - test Run full test suite"
@echo " - test p=./path/to/package Run test suite for specific package"
@echo " - test\#SpecificTestName Run a specific"
@echo " - coverage Run full test suite and generates coverage report as HTML file"
@echo " - dep Dependency maintenance (tidy, vendor, verify)"
@echo " - vet Examine Go source code and reports suspicious parts"
@echo " - fmt Format the Go code"
@echo " - help Print this help"
build:
GOARCH=amd64 GOOS=linux go build --mod=vendor -o ${BINARY_NAME} ./cmd/gitea-sonarqube-bot/
GOARCH=amd64 GOOS=linux go build -mod=vendor -o ${BINARY_NAME} ./cmd/gitea-sonarqube-bot/
run:
./${BINARY_NAME}
@ -26,10 +28,17 @@ clean:
rm -f cover.out cover.html
test:
go test -v ./...
ifdef p
go test -v -mod=vendor $(p)
else
go test -v -mod=vendor ./...
endif
test\#%:
go test -mod=vendor -run $(subst .,/,$*) ./...
coverage:
go test -v -coverprofile=cover.out ./...
go test -coverprofile=cover.out ./...
go tool cover -html=cover.out -o cover.html
dep: