Windows compatibility for unit tests (#800)

This commit is contained in:
Ethan Koenig 2017-01-30 09:22:04 -05:00 committed by Lunny Xiao
parent 2eb15f4a61
commit 0a02fb3c4f

View file

@ -7,6 +7,7 @@ package models
import ( import (
"fmt" "fmt"
"os" "os"
"path/filepath"
"testing" "testing"
"code.gitea.io/gitea/modules/setting" "code.gitea.io/gitea/modules/setting"
@ -30,8 +31,8 @@ func TestMain(m *testing.M) {
setting.RunUser = "runuser" setting.RunUser = "runuser"
setting.SSH.Port = 3000 setting.SSH.Port = 3000
setting.SSH.Domain = "try.gitea.io" setting.SSH.Domain = "try.gitea.io"
setting.RepoRootPath = "/tmp/repos" setting.RepoRootPath = filepath.Join(os.TempDir(), "repos")
setting.AppDataPath = "/tmp/appdata" setting.AppDataPath = filepath.Join(os.TempDir(), "appdata")
os.Exit(m.Run()) os.Exit(m.Run())
} }