|
|
@ -8,6 +8,7 @@ import (
|
|
|
|
"testing"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/tal-tech/go-zero/core/logx"
|
|
|
|
"github.com/tal-tech/go-zero/core/logx"
|
|
|
|
"github.com/tal-tech/go-zero/core/stringx"
|
|
|
|
"github.com/tal-tech/go-zero/core/stringx"
|
|
|
|
conf "github.com/tal-tech/go-zero/tools/goctl/config"
|
|
|
|
conf "github.com/tal-tech/go-zero/tools/goctl/config"
|
|
|
@ -45,7 +46,7 @@ func TestRpcGenerate(t *testing.T) {
|
|
|
|
|
|
|
|
|
|
|
|
// case go path
|
|
|
|
// case go path
|
|
|
|
t.Run("GOPATH", func(t *testing.T) {
|
|
|
|
t.Run("GOPATH", func(t *testing.T) {
|
|
|
|
err = g.Generate("./test.proto", projectDir, []string{common, src}, "Mbase/common.proto=./base")
|
|
|
|
err = g.Generate("./test.proto", projectDir, []string{common}, "Mbase/common.proto=./base")
|
|
|
|
assert.Nil(t, err)
|
|
|
|
assert.Nil(t, err)
|
|
|
|
_, err = execx.Run("go test "+projectName, projectDir)
|
|
|
|
_, err = execx.Run("go test "+projectName, projectDir)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
@ -66,7 +67,7 @@ func TestRpcGenerate(t *testing.T) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
projectDir = filepath.Join(workDir, projectName)
|
|
|
|
projectDir = filepath.Join(workDir, projectName)
|
|
|
|
err = g.Generate("./test.proto", projectDir, []string{common, src}, "Mbase/common.proto=./base")
|
|
|
|
err = g.Generate("./test.proto", projectDir, []string{common}, "Mbase/common.proto=./base")
|
|
|
|
assert.Nil(t, err)
|
|
|
|
assert.Nil(t, err)
|
|
|
|
_, err = execx.Run("go test "+projectName, projectDir)
|
|
|
|
_, err = execx.Run("go test "+projectName, projectDir)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|