@@ -33,9 +33,10 @@ GO_ARCH = $(word 2, $(GO_OSARCH))
33
33
34
34
# Conditional assignment. ('?=')
35
35
# Can be overridden with "export"
36
- # Example: "export LD_LIBRARY_PATH=/path/to/my/senzing/g2/lib"
36
+ # Example: "export LD_LIBRARY_PATH=/path/to/my/senzing-garage /g2/lib"
37
37
38
38
LD_LIBRARY_PATH ?= /opt/senzing/g2/lib
39
+ GOBIN ?= $(shell go env GOPATH) /bin
39
40
SENZING_TOOLS_DATABASE_URL ?= sqlite3://na:na@/tmp/sqlite/G2C.db
40
41
41
42
# Export environment variables.
@@ -64,6 +65,12 @@ hello-world: hello-world-osarch-specific
64
65
# Dependency management
65
66
# -----------------------------------------------------------------------------
66
67
68
+ .PHONY : make-dependencies
69
+ make-dependencies :
70
+ @go install github.com/vladopajic/go-test-coverage/v2@latest
71
+ @curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH) /bin v1.58.1
72
+
73
+
67
74
.PHONY : dependencies
68
75
dependencies :
69
76
@go get -u ./...
@@ -99,6 +106,28 @@ docker-build:
99
106
.PHONY : test
100
107
test : test-osarch-specific
101
108
109
+ # -----------------------------------------------------------------------------
110
+ # Coverage
111
+ # -----------------------------------------------------------------------------
112
+
113
+ .PHONY : coverage
114
+ coverage : coverage-osarch-specific
115
+
116
+
117
+ .PHONY : check-coverage
118
+ check-coverage : export SENZING_LOG_LEVEL=TRACE
119
+ check-coverage :
120
+ go test ./... -coverprofile=./cover.out -covermode=atomic -coverpkg=./...
121
+ ${GOBIN} /go-test-coverage --config=./.testcoverage.yml
122
+
123
+ # -----------------------------------------------------------------------------
124
+ # Lint
125
+ # -----------------------------------------------------------------------------
126
+
127
+ .PHONY : run-golangci-lint
128
+ run-golangci-lint :
129
+ ${GOBIN} /golangci-lint run --config=.github/linters/.golangci.yml
130
+
102
131
# -----------------------------------------------------------------------------
103
132
# Run
104
133
# -----------------------------------------------------------------------------
0 commit comments