quintodrome/tests/init_tests.go

28 lines
509 B
Go
Raw Normal View History

2016-02-27 14:42:08 -09:00
package tests
import (
"os"
"path/filepath"
"runtime"
"testing"
2016-03-08 14:33:35 -09:00
"github.com/astaxie/beego"
"github.com/deluan/gosonic/utils"
2016-02-27 14:42:08 -09:00
)
func Init(t *testing.T, skipOnShort bool) {
if skipOnShort && testing.Short() {
t.Skip("skipping test in short mode.")
}
_, file, _, _ := runtime.Caller(0)
appPath, _ := filepath.Abs(filepath.Join(filepath.Dir(file), ".."))
beego.TestBeegoInit(appPath)
noLog := os.Getenv("NOLOG")
if noLog != "" {
beego.SetLevel(beego.LevelError)
}
2016-03-08 14:33:35 -09:00
utils.Graph.Finalize()
2016-02-27 14:42:08 -09:00
}