Browse Source

added some makefile targets

AETH-erial 10 months ago
parent
commit
4318634154
2 changed files with 14 additions and 2 deletions
  1. 4 0
      .gitignore
  2. 10 2
      Makefile

+ 4 - 0
.gitignore

@@ -4,3 +4,7 @@ temp_*.json
 
 # ignoring build files
 build/**
+*.out
+
+*.html
+

+ 10 - 2
Makefile

@@ -1,9 +1,9 @@
-.PHONY: build format test 
+.PHONY: build format test install coverage coverage-html 
 
 KYOKETSU = kyoketsu
 
 build:
-	go build -o ./build/linux/$(KYOKETSU)/$(KYOKETSU) ./cmd/$(KYOKETSU)/$(KYOKETSU).go
+	go build -x -v -cover -o ./build/linux/$(KYOKETSU)/$(KYOKETSU) ./cmd/$(KYOKETSU)/$(KYOKETSU).go
 
 
 format:
@@ -17,5 +17,13 @@ install:
 test:
 	go test -v ./...
 
+coverage:
+	go test -v ./... -cover
+
+
+coverage-html:
+	go test -v ./... -coverprofile=coverage.out 
+	go tool cover -html=coverage.out -o coverage.html
+