@@ -11,7 +11,7 @@ current_dir := $(dir $(mkfile_path))
11
11
# Global stuff.
12
12
13
13
GO =$(shell which go)
14
- HOMEBREW_PACKAGES =bash bats-core coreutils findutils git git-lfs go jq librsvg nodejs pre-commit python@3.11 tfschema trufflesecurity/trufflehog/trufflehog
14
+ HOMEBREW_PACKAGES =bash bats-core coreutils findutils git git-lfs go grep jq librsvg nodejs pre-commit python@3.11 tfschema trufflesecurity/trufflehog/trufflehog
15
15
16
16
# Determine the operating system and CPU arch.
17
17
OS =$(shell uname -o | tr '[:upper:]' '[:lower:]')
@@ -277,7 +277,7 @@ lint: vuln license pre-commit
277
277
278
278
.PHONY : test
279
279
# # test: [test]* Runs ALL tests.
280
- test : unit examples acc bats
280
+ test : unit examples acc mutate bats
281
281
282
282
.PHONY : list-tests
283
283
# # list-tests: [test] Lists all of the tests that are available to run.
@@ -323,17 +323,24 @@ ifeq ($(DEBUG), true)
323
323
else
324
324
TF_ACC=1 gotestsum --format testname -- -run=TestAcc$(NAME) -count=1 -parallel=$(shell nproc) -timeout 30m -coverpkg=./corefuncprovider/... -coverprofile=__coverage.out -v ./corefuncprovider/...
325
325
endif
326
- go-cover-treemap -coverprofile __coverage.out > acc-coverage.svg
327
- rsvg-convert --width=2000 --format=png --output="acc-coverage.png" "acc-coverage.svg"
326
+ @ go-cover-treemap -coverprofile __coverage.out > acc-coverage.svg
327
+ @ rsvg-convert --width=2000 --format=png --output="acc-coverage.png" "acc-coverage.svg"
328
328
329
329
.PHONY : unit
330
330
# # unit: [test] Runs unit tests. Set NAME= (without 'Test') to run a specific test by name
331
331
unit :
332
332
@ $(ECHO ) " "
333
333
@ $(ECHO ) " \033[1;33m=====> Running unit tests...\033[0m"
334
334
gotestsum --format testname -- -run=Test$(NAME ) -count=1 -parallel=$(shell nproc) -timeout 30s -coverpkg=./corefunc/... -coverprofile=__coverage.out -v ./corefunc/...
335
- go-cover-treemap -coverprofile __coverage.out > unit-coverage.svg
336
- rsvg-convert --width=2000 --format=png --output=" unit-coverage.png" " unit-coverage.svg"
335
+ @ go-cover-treemap -coverprofile __coverage.out > unit-coverage.svg
336
+ @ rsvg-convert --width=2000 --format=png --output=" unit-coverage.png" " unit-coverage.svg"
337
+
338
+ .PHONY : mutate
339
+ # # mutate: [test] Runs mutation tests.
340
+ mutate :
341
+ @ $(ECHO ) " "
342
+ @ $(ECHO ) " \033[1;33m=====> Running mutation tests...\033[0m"
343
+ cd ./corefunc && $(GO ) test -tags=mutation -count=1 -parallel=$(shell nproc) -timeout 30s -ooze.v=true | ggrep -v " ^[[:lower:]]" | ggrep -v " ^)"
337
344
338
345
.PHONY : examples
339
346
# # examples: [test] Runs tests for examples. Set NAME= (without 'Example') to run a specific test by name
@@ -368,7 +375,7 @@ bench:
368
375
pgo :
369
376
@ $(ECHO ) " "
370
377
@ $(ECHO ) " \033[1;33m=====> Running benchmark for PGO data...\033[0m"
371
- TF_ACC=1 go test -run=^TestAcc -count=6 -cpuprofile=default.pgo -parallel=$(shell nproc) -timeout 60m ./corefuncprovider/...
378
+ TF_ACC=1 go test -run=^TestAcc -count=6 -timeout 60m - cpuprofile=default.pgo -parallel=$(shell nproc) ./corefuncprovider/...
372
379
373
380
.PHONY : view-cov-cli
374
381
# # view-cov-cli: [test] After running test or unittest, this will view the coverage report on the CLI.
0 commit comments