|
@@ -48,8 +48,8 @@ func Test(t *testing.T) {
|
|
|
|
|
|
|
|
if *regenerate {
|
|
if *regenerate {
|
|
|
t.Run("Generate", func(t *testing.T) {
|
|
t.Run("Generate", func(t *testing.T) {
|
|
|
- fmt.Print(mustRunCommand(t, "go", "run", "-tags", "proto1_legacy", "./internal/cmd/generate-types", "-execute"))
|
|
|
|
|
- fmt.Print(mustRunCommand(t, "go", "run", "-tags", "proto1_legacy", "./internal/cmd/generate-protos", "-execute"))
|
|
|
|
|
|
|
+ fmt.Print(mustRunCommand(t, "go", "run", "-tags", "protolegacy", "./internal/cmd/generate-types", "-execute"))
|
|
|
|
|
+ fmt.Print(mustRunCommand(t, "go", "run", "-tags", "protolegacy", "./internal/cmd/generate-protos", "-execute"))
|
|
|
files := strings.Split(strings.TrimSpace(mustRunCommand(t, "git", "ls-files", "*.go")), "\n")
|
|
files := strings.Split(strings.TrimSpace(mustRunCommand(t, "git", "ls-files", "*.go")), "\n")
|
|
|
mustRunCommand(t, append([]string{"gofmt", "-w"}, files...)...)
|
|
mustRunCommand(t, append([]string{"gofmt", "-w"}, files...)...)
|
|
|
})
|
|
})
|
|
@@ -79,7 +79,7 @@ func Test(t *testing.T) {
|
|
|
runGo("PureGo", workDir, "go", "test", "-race", "-tags", "purego", "./...")
|
|
runGo("PureGo", workDir, "go", "test", "-race", "-tags", "purego", "./...")
|
|
|
runGo("Reflect", workDir, "go", "test", "-race", "-tags", "protoreflect", "./...")
|
|
runGo("Reflect", workDir, "go", "test", "-race", "-tags", "protoreflect", "./...")
|
|
|
if goVersion == golangLatest {
|
|
if goVersion == golangLatest {
|
|
|
- runGo("Proto1Legacy", workDir, "go", "test", "-race", "-tags", "proto1_legacy", "./...")
|
|
|
|
|
|
|
+ runGo("ProtoLegacy", workDir, "go", "test", "-race", "-tags", "protolegacy", "./...")
|
|
|
runGo("ProtocGenGo", "cmd/protoc-gen-go/testdata", "go", "test")
|
|
runGo("ProtocGenGo", "cmd/protoc-gen-go/testdata", "go", "test")
|
|
|
runGo("ProtocGenGoGRPC", "cmd/protoc-gen-go-grpc/testdata", "go", "test")
|
|
runGo("ProtocGenGoGRPC", "cmd/protoc-gen-go-grpc/testdata", "go", "test")
|
|
|
}
|
|
}
|
|
@@ -94,11 +94,11 @@ func Test(t *testing.T) {
|
|
|
mustRunCommand(t, runner, "--failure_list", failureList, "--enforce_recommended", driver)
|
|
mustRunCommand(t, runner, "--failure_list", failureList, "--enforce_recommended", driver)
|
|
|
})
|
|
})
|
|
|
t.Run("GeneratedGoFiles", func(t *testing.T) {
|
|
t.Run("GeneratedGoFiles", func(t *testing.T) {
|
|
|
- diff := mustRunCommand(t, "go", "run", "-tags", "proto1_legacy", "./internal/cmd/generate-types")
|
|
|
|
|
|
|
+ diff := mustRunCommand(t, "go", "run", "-tags", "protolegacy", "./internal/cmd/generate-types")
|
|
|
if strings.TrimSpace(diff) != "" {
|
|
if strings.TrimSpace(diff) != "" {
|
|
|
t.Fatalf("stale generated files:\n%v", diff)
|
|
t.Fatalf("stale generated files:\n%v", diff)
|
|
|
}
|
|
}
|
|
|
- diff = mustRunCommand(t, "go", "run", "-tags", "proto1_legacy", "./internal/cmd/generate-protos")
|
|
|
|
|
|
|
+ diff = mustRunCommand(t, "go", "run", "-tags", "protolegacy", "./internal/cmd/generate-protos")
|
|
|
if strings.TrimSpace(diff) != "" {
|
|
if strings.TrimSpace(diff) != "" {
|
|
|
t.Fatalf("stale generated files:\n%v", diff)
|
|
t.Fatalf("stale generated files:\n%v", diff)
|
|
|
}
|
|
}
|