From f255f4a70b4a0c64ae2d82f9027ca15fac92ed28 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 10 Dec 2017 11:27:46 +0800 Subject: [PATCH 1/2] fix comile failed without gcc --- Makefile | 3 ++- models/unit_tests.go | 1 - modules/test/context_tests.go | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 501defcd94d20..393a171fa2cad 100644 --- a/Makefile +++ b/Makefile @@ -131,7 +131,8 @@ fmt-check: .PHONY: test test: - $(GO) test $(PACKAGES) + $(GO) build # test if go build succeed without sqlite support + $(GO) test -tags=sqlite $(PACKAGES) .PHONY: coverage coverage: diff --git a/models/unit_tests.go b/models/unit_tests.go index cf7c3e4f9282b..ff7a87da30381 100644 --- a/models/unit_tests.go +++ b/models/unit_tests.go @@ -15,7 +15,6 @@ import ( "github.com/Unknwon/com" "github.com/go-xorm/core" "github.com/go-xorm/xorm" - _ "github.com/mattn/go-sqlite3" // for the test engine "github.com/stretchr/testify/assert" "gopkg.in/testfixtures.v2" ) diff --git a/modules/test/context_tests.go b/modules/test/context_tests.go index aa109aa0d08a6..11f3d83b830dd 100644 --- a/modules/test/context_tests.go +++ b/modules/test/context_tests.go @@ -14,7 +14,6 @@ import ( "code.gitea.io/gitea/modules/context" "github.com/go-macaron/session" - _ "github.com/mattn/go-sqlite3" // for the test engine "github.com/stretchr/testify/assert" "gopkg.in/macaron.v1" ) From 3373fab5eaf872c1ac7bed6c399049b3905060a8 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 10 Dec 2017 11:35:18 +0800 Subject: [PATCH 2/2] add sqlite tag for unit test --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 393a171fa2cad..ebafa95c2a576 100644 --- a/Makefile +++ b/Makefile @@ -143,7 +143,7 @@ coverage: .PHONY: unit-test-coverage unit-test-coverage: - for PKG in $(PACKAGES); do $(GO) test -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done; + for PKG in $(PACKAGES); do $(GO) test -tags=sqlite -cover -coverprofile $$GOPATH/src/$$PKG/coverage.out $$PKG || exit 1; done; .PHONY: test-vendor test-vendor: