diff --git a/Makefile b/Makefile index 66a86b07..7bc82e21 100644 --- a/Makefile +++ b/Makefile @@ -214,6 +214,12 @@ unit-debug: mkdir -p app/build && touch app/build/index.html $(UNIT_DEBUG) +#? unit-bench: Run benchmark tests +unit-bench: + @$(call print, "Running benchmark tests.") + mkdir -p app/build && touch app/build/index.html + $(UNIT_BENCH) + unit-cover: $(GOACC_BIN) @$(call print, "Running unit coverage tests.") $(GOACC_BIN) $(COVER_PKG) @@ -345,7 +351,7 @@ flakehunter-unit: # include in the build process. .PHONY: default all yarn-install build install go-build go-build-noui \ go-install go-install-noui go-install-cli app-build release go-release \ - docker-release docker-tools scratch check unit unit-cover unit-race \ + docker-release docker-tools scratch check unit unit-bench unit-cover unit-race \ clean-itest build-itest build-itest-binary itest-only itest \ itest-parallel flake-unit fmt lint \ mod mod-check list rpc protos protos-check rpc-js-compile clean diff --git a/make/testing_flags.mk b/make/testing_flags.mk index 2f0fc2b6..5be0f111 100644 --- a/make/testing_flags.mk +++ b/make/testing_flags.mk @@ -72,11 +72,16 @@ UNIT_TARGETED ?= no ifeq ($(UNIT_TARGETED), yes) UNIT := $(GOTEST) -tags="$(DEV_TAGS) $(COMPILE_TAGS)" $(TEST_FLAGS) $(UNITPKG) UNIT_DEBUG := $(GOTEST) -v -tags="$(DEV_TAGS) $(COMPILE_TAGS)" $(TEST_FLAGS) $(UNITPKG) +UNIT_BENCH := $(GOTEST) -tags="$(DEV_TAGS) $(COMPILE_TAGS)" \ + -test.bench=. -test.benchmem -test.run=NONE $(UNITPKG) endif ifeq ($(UNIT_TARGETED), no) UNIT := $(GOLIST) | $(XARGS) env $(GOTEST) -tags="$(DEV_TAGS) $(COMPILE_TAGS)" $(TEST_FLAGS) UNIT_DEBUG := $(GOLIST) | $(XARGS) env $(GOTEST) -v -tags="$(DEV_TAGS) $(COMPILE_TAGS)" $(TEST_FLAGS) +UNIT_BENCH := $(GOLIST) | $(XARGS) env $(GOTEST) \ + -tags="$(DEV_TAGS) $(COMPILE_TAGS)" -test.bench=. -test.benchmem \ + -test.run=NONE endif UNIT_RACE := $(UNIT) -race