@@ -216,55 +216,55 @@ lint: vuln
216
216
test : unit acc
217
217
218
218
.PHONY : acc
219
- # # acc: [test] Runs Terraform provider acceptance tests.
219
+ # # acc: [test] Runs Terraform provider acceptance tests. Set NAME= (without 'Test') to run a specific test by name
220
220
acc :
221
221
@ $(ECHO ) " "
222
222
@ $(ECHO ) " \033[1;33m=====> Running unit and acceptance tests...\033[0m"
223
- TF_ACC=1 go test -count=1 -parallel=$(shell nproc) -timeout 30s -coverpkg=./corefuncprovider/... -coverprofile=__coverage.out -v ./corefuncprovider/...
223
+ TF_ACC=1 $( GO ) test -run=TestAcc $( NAME ) -count=1 -parallel=$(shell nproc) -timeout 30s -coverpkg=./corefuncprovider/... -coverprofile=__coverage.out -v ./corefuncprovider/...
224
224
225
225
.PHONY : unit
226
- # # unit: [test] Runs unit and fuzz tests.
226
+ # # unit: [test] Runs unit tests. Set NAME= (without 'Test') to run a specific test by name
227
227
unit :
228
228
@ $(ECHO ) " "
229
229
@ $(ECHO ) " \033[1;33m=====> Running unit tests...\033[0m"
230
- go test -count=1 -parallel=$(shell nproc) -timeout 30s -coverpkg=./corefunc/... -coverprofile=__coverage.out -v ./corefunc/...
230
+ $( GO ) test -run=Test $( NAME ) -count=1 -parallel=$(shell nproc) -timeout 30s -coverpkg=./corefunc/... -coverprofile=__coverage.out -v ./corefunc/...
231
231
232
232
.PHONY : fuzz
233
- # # fuzz: [test]* Runs the fuzzer for 10 minutes.
233
+ # # fuzz: [test]* Runs the fuzzer for 10 minutes. Set NAME= (without 'Fuzz') to run a specific test by name
234
234
fuzz :
235
235
@ $(ECHO ) " "
236
236
@ $(ECHO ) " \033[1;33m=====> Running the fuzzer (https://go.dev/doc/tutorial/fuzz)...\033[0m"
237
- go test -fuzz=Fuzz -fuzztime 10m -parallel=$(shell nproc) -v ./corefunc/.
237
+ $( GO ) test -run= ' ^$$ ' - fuzz=Fuzz$( NAME ) -fuzztime 10m -parallel=$(shell nproc) -v ./corefunc/.. .
238
238
239
239
.PHONY : quickbench
240
- # # quickbench: [test]* Runs the benchmarks with minimal data for a quick check.
240
+ # # quickbench: [test]* Runs the benchmarks with minimal data for a quick check
241
241
quickbench :
242
- go test -bench=. -timeout 60m ./corefunc
242
+ $( GO ) test -bench=. -timeout 60m ./corefunc
243
243
244
244
.PHONY : bench
245
245
# # bench: [test]* Runs the benchmarks with enough data for analysis with benchstat.
246
246
bench :
247
- go test -bench=. -count=6 -timeout 60m -benchmem -cpuprofile=__cpu.out -memprofile=__mem.out -trace=__trace.out ./corefunc | tee __bench-$(shell date --utc "+% Y% m% dT% H% M% SZ") .out
247
+ $( GO ) test -bench=. -count=6 -timeout 60m -benchmem -cpuprofile=__cpu.out -memprofile=__mem.out -trace=__trace.out ./corefunc | tee __bench-$(shell date --utc "+% Y% m% dT% H% M% SZ") .out
248
248
249
249
.PHONY : view-cov
250
250
# # view-cov: [test] After running test or unittest, this will launch a browser to view the coverage report.
251
251
view-cov :
252
- go tool cover -html=__coverage.out
252
+ $( GO ) tool cover -html=__coverage.out
253
253
254
254
.PHONY : view-cpupprof
255
255
# # view-cpupprof: [test] After running bench, this will launch a browser to view the CPU profiler results.
256
256
view-cpupprof :
257
- go tool pprof -http :8080 __cpu.out
257
+ $( GO ) tool pprof -http :8080 __cpu.out
258
258
259
259
.PHONY : view-mempprof
260
260
# # view-mempprof: [test] After running bench, this will launch a browser to view the memory profiler results.
261
261
view-mempprof :
262
- go tool pprof -http :8080 __mem.out
262
+ $( GO ) tool pprof -http :8080 __mem.out
263
263
264
264
.PHONY : view-trace
265
265
# # view-trace: [test] After running bench, this will launch a browser to view the trace results.
266
266
view-trace :
267
- go tool trace _trace.out
267
+ $( GO ) tool trace _trace.out
268
268
269
269
# -------------------------------------------------------------------------------
270
270
# Git Tasks
0 commit comments