Skip to content

Commit 41d6afe

Browse files
lunnylafriks
authored andcommitted
Fix compile failed without gcc (#3130)
* fix comile failed without gcc * add sqlite tag for unit test
1 parent eb6cbed commit 41d6afe

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ fmt-check:
131131

132132
.PHONY: test
133133
test:
134-
$(GO) test $(PACKAGES)
134+
$(GO) build # test if go build succeed without sqlite support
135+
$(GO) test -tags=sqlite $(PACKAGES)
135136

136137
.PHONY: coverage
137138
coverage:
@@ -142,7 +143,7 @@ coverage:
142143

143144
.PHONY: unit-test-coverage
144145
unit-test-coverage:
145-
for PKG in $(PACKAGES); do $(GO) test -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done;
146+
for PKG in $(PACKAGES); do $(GO) test -tags=sqlite -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done;
146147

147148
.PHONY: test-vendor
148149
test-vendor:

models/unit_tests.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import (
1515
"github.com/Unknwon/com"
1616
"github.com/go-xorm/core"
1717
"github.com/go-xorm/xorm"
18-
_ "github.com/mattn/go-sqlite3" // for the test engine
1918
"github.com/stretchr/testify/assert"
2019
"gopkg.in/testfixtures.v2"
2120
)

modules/test/context_tests.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"code.gitea.io/gitea/modules/context"
1515

1616
"github.com/go-macaron/session"
17-
_ "github.com/mattn/go-sqlite3" // for the test engine
1817
"github.com/stretchr/testify/assert"
1918
"gopkg.in/macaron.v1"
2019
)

0 commit comments

Comments
 (0)