From cb2b764cc8a8613b84c44c45b8b2b1ba9da6244d Mon Sep 17 00:00:00 2001 From: HolynnChen <854560673@qq.com> Date: Sat, 28 Feb 2026 21:55:28 +0800 Subject: [PATCH] test(make): modify test folder and test command in Makefile (#4465) Co-authored-by: Bo-Yi Wu --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1a7de86b..3c2da3b1 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ GO_VERSION=$(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2) PACKAGES ?= $(shell $(GO) list ./...) VETPACKAGES ?= $(shell $(GO) list ./... | grep -v /examples/) GOFILES := $(shell find . -name "*.go") -TESTFOLDER := $(shell $(GO) list ./... | grep -E 'gin$$|binding$$|render$$' | grep -v examples) +TESTFOLDER := $(shell $(GO) list ./... | grep -E 'gin$$|ginS$$|binding$$|render$$' | grep -v examples) TESTTAGS ?= "" .PHONY: test @@ -12,7 +12,11 @@ TESTTAGS ?= "" test: echo "mode: count" > coverage.out for d in $(TESTFOLDER); do \ - $(GO) test $(TESTTAGS) -v -covermode=count -coverprofile=profile.out $$d > tmp.out; \ + if [ -n "$(TESTTAGS)" ]; then \ + $(GO) test $(TESTTAGS) -v -covermode=count -coverprofile=profile.out $$d > tmp.out; \ + else \ + $(GO) test -v -covermode=count -coverprofile=profile.out $$d > tmp.out; \ + fi; \ cat tmp.out; \ if grep -q "^--- FAIL" tmp.out; then \ rm tmp.out; \