提交 f818c326 编写于 作者: martianzhang's avatar martianzhang

update DevPath test cases

上级 7d37fab7
......@@ -20,6 +20,8 @@ import (
"flag"
"fmt"
"os"
"path/filepath"
"runtime"
"strings"
"testing"
......@@ -37,6 +39,10 @@ var rEnv *database.Connector
func TestMain(m *testing.M) {
// 初始化 init
if common.DevPath == "" {
_, file, _, _ := runtime.Caller(0)
common.DevPath, _ = filepath.Abs(filepath.Dir(filepath.Join(file, ".."+string(filepath.Separator))))
}
common.BaseDir = common.DevPath
err := common.ParseConfig("")
common.LogIfError(err, "init ParseConfig")
......
......@@ -19,6 +19,8 @@ package ast
import (
"flag"
"fmt"
"path/filepath"
"runtime"
"testing"
"github.com/XiaoMi/soar/common"
......@@ -31,6 +33,10 @@ var update = flag.Bool("update", false, "update .golden files")
func TestMain(m *testing.M) {
// 初始化 init
if common.DevPath == "" {
_, file, _, _ := runtime.Caller(0)
common.DevPath, _ = filepath.Abs(filepath.Dir(filepath.Join(file, ".."+string(filepath.Separator))))
}
common.BaseDir = common.DevPath
err := common.ParseConfig("")
common.LogIfError(err, "init ParseConfig")
......
......@@ -20,6 +20,8 @@ import (
"flag"
"fmt"
"os"
"path/filepath"
"runtime"
"testing"
"github.com/XiaoMi/soar/common"
......@@ -29,6 +31,10 @@ var update = flag.Bool("update", false, "update .golden files")
func TestMain(m *testing.M) {
// 初始化 init
if common.DevPath == "" {
_, file, _, _ := runtime.Caller(0)
common.DevPath, _ = filepath.Abs(filepath.Dir(filepath.Join(file, ".."+string(filepath.Separator))))
}
common.BaseDir = common.DevPath
err := common.ParseConfig("")
common.LogIfError(err, "init ParseConfig")
......
......@@ -20,6 +20,7 @@ import (
"flag"
"os"
"path/filepath"
"runtime"
"testing"
"github.com/kr/pretty"
......@@ -29,6 +30,10 @@ var update = flag.Bool("update", false, "update .golden files")
func TestMain(m *testing.M) {
// 初始化 init
if DevPath == "" {
_, file, _, _ := runtime.Caller(0)
DevPath, _ = filepath.Abs(filepath.Dir(filepath.Join(file, ".."+string(filepath.Separator))))
}
BaseDir = DevPath
err := ParseConfig("")
LogIfError(err, "init ParseConfig")
......
......@@ -20,6 +20,8 @@ import (
"flag"
"fmt"
"os"
"path/filepath"
"runtime"
"testing"
"github.com/XiaoMi/soar/common"
......@@ -32,6 +34,10 @@ var update = flag.Bool("update", false, "update .golden files")
func TestMain(m *testing.M) {
// 初始化 init
if common.DevPath == "" {
_, file, _, _ := runtime.Caller(0)
common.DevPath, _ = filepath.Abs(filepath.Dir(filepath.Join(file, ".."+string(filepath.Separator))))
}
common.BaseDir = common.DevPath
err := common.ParseConfig("")
common.LogIfError(err, "init ParseConfig")
......
......@@ -20,6 +20,8 @@ import (
"flag"
"fmt"
"os"
"path/filepath"
"runtime"
"testing"
"github.com/XiaoMi/soar/common"
......@@ -35,6 +37,10 @@ var rEnv *database.Connector
func TestMain(m *testing.M) {
// 初始化 init
if common.DevPath == "" {
_, file, _, _ := runtime.Caller(0)
common.DevPath, _ = filepath.Abs(filepath.Dir(filepath.Join(file, ".."+string(filepath.Separator))))
}
common.BaseDir = common.DevPath
err := common.ParseConfig("")
common.LogIfError(err, "init ParseConfig")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册