summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorEthan Koenig <etk39@cornell.edu>2017-01-30 09:22:04 -0500
committerLunny Xiao <xiaolunwen@gmail.com>2017-01-30 22:22:04 +0800
commit0a02fb3c4fc241aca54e4ec62e4029e6db3be3f9 (patch)
tree85271954f31a3fb9823130208a0f75e6ab8be3ca /models
parent2eb15f4a611393a4cbfcd91054f92ade302be62f (diff)
downloadgitea-0a02fb3c4fc241aca54e4ec62e4029e6db3be3f9.tar.gz
gitea-0a02fb3c4fc241aca54e4ec62e4029e6db3be3f9.zip
Windows compatibility for unit tests (#800)
Diffstat (limited to 'models')
-rw-r--r--models/setup_for_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/models/setup_for_test.go b/models/setup_for_test.go
index c3e5c3aa54..fd5a180aec 100644
--- a/models/setup_for_test.go
+++ b/models/setup_for_test.go
@@ -7,6 +7,7 @@ package models
import (
"fmt"
"os"
+ "path/filepath"
"testing"
"code.gitea.io/gitea/modules/setting"
@@ -30,8 +31,8 @@ func TestMain(m *testing.M) {
setting.RunUser = "runuser"
setting.SSH.Port = 3000
setting.SSH.Domain = "try.gitea.io"
- setting.RepoRootPath = "/tmp/repos"
- setting.AppDataPath = "/tmp/appdata"
+ setting.RepoRootPath = filepath.Join(os.TempDir(), "repos")
+ setting.AppDataPath = filepath.Join(os.TempDir(), "appdata")
os.Exit(m.Run())
}