summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-12-10 22:08:19 +0800
committerLauris BH <lauris@nix.lv>2017-12-10 16:08:19 +0200
commit41d6afe0e7992567ac7c86cdd41b9226aae896d2 (patch)
treefbb2abc219ccce5cb6750fd672d0f1a1f923ed6a
parenteb6cbedcc06b64c919b4a1aadd0f5de06fc18c23 (diff)
downloadgitea-41d6afe0e7992567ac7c86cdd41b9226aae896d2.tar.gz
gitea-41d6afe0e7992567ac7c86cdd41b9226aae896d2.zip
Fix compile failed without gcc (#3130)
* fix comile failed without gcc * add sqlite tag for unit test
-rw-r--r--Makefile5
-rw-r--r--models/unit_tests.go1
-rw-r--r--modules/test/context_tests.go1
3 files changed, 3 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 501defcd94..ebafa95c2a 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:
@@ -142,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:
diff --git a/models/unit_tests.go b/models/unit_tests.go
index cf7c3e4f92..ff7a87da30 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 aa109aa0d0..11f3d83b83 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"
)