make: add make unit-bench command

This commit is contained in:
Viktor Torstensson 2026-02-11 23:48:03 +01:00
parent fe28ff7e60
commit 5898e35762
No known key found for this signature in database
GPG key ID: 961CC8259AE675D4
2 changed files with 12 additions and 1 deletions

View file

@ -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

View file

@ -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