diff options
| author | Adam Mathes <adam@adammathes.com> | 2026-02-15 09:26:33 -0800 |
|---|---|---|
| committer | Adam Mathes <adam@adammathes.com> | 2026-02-15 09:26:33 -0800 |
| commit | 47b18128089d9dbc7a8a388906d86ae38145d2f9 (patch) | |
| tree | f664adc2634f1c63223968d5aa20074a8c2dcc98 /Makefile | |
| parent | 01c7931a6b523c28d856ba05d2d6cd6ac7cc01b2 (diff) | |
| download | neko-47b18128089d9dbc7a8a388906d86ae38145d2f9.tar.gz neko-47b18128089d9dbc7a8a388906d86ae38145d2f9.tar.bz2 neko-47b18128089d9dbc7a8a388906d86ae38145d2f9.zip | |
Add code coverage to 'make check' and add 'cover' and 'coverage-html' targets
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -9,7 +9,7 @@ VERSION=0.3 BUILD=`git rev-parse HEAD` LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.Build=${BUILD}" -.PHONY: default all clean ui build install test test-race test-frontend test-e2e ui-check lint check ci run dev docs install-hooks +.PHONY: default all clean ui build install test test-race test-frontend test-e2e ui-check lint check ci run dev docs install-hooks cover coverage-html default: build @@ -32,12 +32,19 @@ install: build cp ${BINARY} ${GOBIN} test: - ${GO} test ./... + ${GO} test -cover ./... cd frontend && ${NPM} test -- --run test-race: ${GO} test -race ./... +cover: + ${GO} test -coverprofile=coverage.out ./... + ${GO} tool cover -func=coverage.out + +coverage-html: cover + ${GO} tool cover -html=coverage.out + test-frontend: cd frontend && ${NPM} run lint cd frontend && ${NPM} test -- --run |
