From 514e269b1d7f2ef74b3086e43fc7194a4a640f85 Mon Sep 17 00:00:00 2001 From: Mura Li Date: Tue, 7 Apr 2020 12:31:11 +0800 Subject: [PATCH] Support running subtests manually (#10988) Since GNU Make does not allow '/' in the target patterns, we tranlate the subsequent '.' into '/' for "go test -run". Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 81cd2c5054..bb328b4f10 100644 --- a/Makefile +++ b/Makefile @@ -293,7 +293,7 @@ test-check: .PHONY: test\#% test\#%: - $(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' -run $* $(GO_PACKAGES) + $(GO) test -mod=vendor -tags='sqlite sqlite_unlock_notify' -run $(subst .,/,$*) $(GO_PACKAGES) .PHONY: coverage coverage: @@ -322,7 +322,7 @@ test-sqlite: integrations.sqlite.test .PHONY: test-sqlite\#% test-sqlite\#%: integrations.sqlite.test - GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.run $* + GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.run $(subst .,/,$*) .PHONY: test-sqlite-migration test-sqlite-migration: migrations.sqlite.test @@ -341,7 +341,7 @@ test-mysql: integrations.mysql.test generate-ini-mysql .PHONY: test-mysql\#% test-mysql\#%: integrations.mysql.test generate-ini-mysql - GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test -test.run $* + GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.mysql.test -test.run $(subst .,/,$*) .PHONY: test-mysql-migration test-mysql-migration: migrations.mysql.test generate-ini-mysql @@ -360,7 +360,7 @@ test-mysql8: integrations.mysql8.test generate-ini-mysql8 .PHONY: test-mysql8\#% test-mysql8\#%: integrations.mysql8.test generate-ini-mysql8 - GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql8.ini ./integrations.mysql8.test -test.run $* + GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql8.ini ./integrations.mysql8.test -test.run $(subst .,/,$*) .PHONY: test-mysql8-migration test-mysql8-migration: migrations.mysql8.test generate-ini-mysql8 @@ -380,7 +380,7 @@ test-pgsql: integrations.pgsql.test generate-ini-pgsql .PHONY: test-pgsql\#% test-pgsql\#%: integrations.pgsql.test generate-ini-pgsql - GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test -test.run $* + GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.pgsql.test -test.run $(subst .,/,$*) .PHONY: test-pgsql-migration test-pgsql-migration: migrations.pgsql.test generate-ini-pgsql @@ -399,7 +399,7 @@ test-mssql: integrations.mssql.test generate-ini-mssql .PHONY: test-mssql\#% test-mssql\#%: integrations.mssql.test generate-ini-mssql - GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./integrations.mssql.test -test.run $* + GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mssql.ini ./integrations.mssql.test -test.run $(subst .,/,$*) .PHONY: test-mssql-migration test-mssql-migration: migrations.mssql.test generate-ini-mssql