mirror of
https://github.com/navidrome/navidrome.git
synced 2024-09-10 11:32:48 +02:00
26 lines
450 B
Go
26 lines
450 B
Go
package tests
|
|
|
|
import (
|
|
"github.com/astaxie/beego"
|
|
"os"
|
|
"path/filepath"
|
|
"runtime"
|
|
"testing"
|
|
)
|
|
|
|
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)
|
|
}
|
|
}
|
|
|