@@ -107,7 +107,17 @@ test: fmt-check
107
107
go test $(PACKAGES )
108
108
109
109
.PHONY : test-coverage
110
- test-coverage :
110
+ test-coverage : unit-test-coverage integration-test-coverage
111
+ for PKG in $( PACKAGES) ; do\
112
+ touch $$ GOPATH/src/$$ PKG/coverage.out; \
113
+ egrep " $$ PKG[^/]*\.go" integration.coverage.out > int.coverage.out; \
114
+ gocovmerge $$ GOPATH/src/$$ PKG/coverage.out int.coverage.out > pkg.coverage.out; \
115
+ mv pkg.coverage.out $$ GOPATH/src/$$ PKG/coverage.out; \
116
+ rm int.coverage.out; \
117
+ done ;
118
+
119
+ .PHONY : unit-test-coverage
120
+ unit-test-coverage :
111
121
for PKG in $( PACKAGES) ; do go test -cover -coverprofile $$ GOPATH/src/$$ PKG/coverage.out $$ PKG || exit 1; done ;
112
122
113
123
.PHONY : test-vendor
@@ -124,9 +134,8 @@ test-vendor:
124
134
govendor status || exit 1
125
135
126
136
.PHONY : test-sqlite
127
- test-sqlite :
128
- go test -c code.gitea.io/gitea/integrations -tags ' sqlite'
129
- GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.test
137
+ test-sqlite : integrations.sqlite.test
138
+ GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test
130
139
131
140
.PHONY : test-mysql
132
141
test-mysql : integrations.test
@@ -136,9 +145,19 @@ test-mysql: integrations.test
136
145
test-pgsql : integrations.test
137
146
GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/pgsql.ini ./integrations.test
138
147
148
+ .PHONY : integration-test-coverage
149
+ integration-test-coverage : integrations.cover.test
150
+ GITEA_ROOT=${CURDIR} GITEA_CONF=integrations/mysql.ini ./integrations.cover.test -test.coverprofile=integration.coverage.out
151
+
139
152
integrations.test : $(SOURCES )
140
153
go test -c code.gitea.io/gitea/integrations
141
154
155
+ integrations.sqlite.test : $(SOURCES )
156
+ go test -c code.gitea.io/gitea/integrations -o integrations.sqlite.test -tags ' sqlite'
157
+
158
+ integrations.cover.test : $(SOURCES )
159
+ go test -c code.gitea.io/gitea/integrations -coverpkg $(shell echo $(PACKAGES ) | tr ' ' ',') -o integrations.cover.test
160
+
142
161
.PHONY : check
143
162
check : test
144
163
0 commit comments