• Home
  • Raw
  • Download

Lines Matching +full:bad +full:- +full:build +full:- +full:check

2 // Use of this source code is governed by a BSD-style
5 //go:build ignore
6 // +build ignore
36 buildRelease = flag.Bool("buildRelease", false, "build release binaries")
50 golangLatest = golangVersions[len(golangVersions)-1]
60 // purgeTimeout determines the maximum age of unused sub-directories.
76 // Fail the test late, so we can test uncommitted changes with -failfast.
81 gitUntracked := mustRunCommand(t, "git", "ls-files", "--others", "--exclude-standard")
86 // Do the relatively fast checks up-front.
88 diff := mustRunCommand(t, "go", "run", "-tags", "protolegacy", "./internal/cmd/generate-types")
92 diff = mustRunCommand(t, "go", "run", "-tags", "protolegacy", "./internal/cmd/generate-protos")
98 files := strings.Split(strings.TrimSpace(mustRunCommand(t, "git", "ls-files", "*.go")), "\n")
99 diff := mustRunCommand(t, append([]string{"gofmt", "-d"}, files...)...)
105 …files := strings.Split(strings.TrimSpace(mustRunCommand(t, "git", "ls-files", "*.go", "*.proto")),…
116 sema <- true
119 defer func() { <-sema }()
128 runGo("Normal", command{Dir: workDir}, "go", "test", "-race", "./...")
129 runGo("PureGo", command{Dir: workDir}, "go", "test", "-race", "-tags", "purego", "./...")
130 runGo("Reflect", command{Dir: workDir}, "go", "test", "-race", "-tags", "protoreflect", "./...")
132 …runGo("ProtoLegacy", command{Dir: workDir}, "go", "test", "-race", "-tags", "protolegacy", "./...")
133 runGo("ProtocGenGo", command{Dir: "cmd/protoc-gen-go/testdata"}, "go", "test")
134 runGo("Conformance", command{Dir: "internal/conformance"}, "go", "test", "-execute")
136 // Only run the 32-bit compatibility tests for Linux;
148 "-SA1019", // disable deprecated usage check
149 "-S*", // disable code simplification checks
150 "-ST*", // disable coding style checks
151 "-U*", // disable unused declaration checks
153 …out := mustRunCommand(t, "staticcheck", "-checks="+strings.Join(checks, ","), "-fail=none", "./...…
181 check := func(err error) {
190 check(err)
192 check(os.MkdirAll(testDir, 0775))
194 // Delete the current directory if non-empty,
200 os.RemoveAll(workingDir) // best-effort
212 // Delete other sub-directories that are no longer relevant.
219 os.Chtimes(dir, now, now) // best-effort
226 os.RemoveAll(dir) // best-effort
233 check(os.RemoveAll(binPath))
234 check(os.Mkdir(binPath, 0775))
235 check(os.Setenv("PATH", binPath+":"+os.Getenv("PATH")))
237 check(os.Symlink(path, filepath.Join(binPath, name)))
241 // Download and build the protobuf toolchain.
242 // We avoid downloading the pre-compiled binaries since they do not contain
244 protobufPath = startWork("protobuf-" + protobufVersion)
252 …tRun(t, "git", "clone", "https://github.com/protocolbuffers/protobuf", "protobuf-"+protobufVersion)
255 fmt.Printf("build %v\n", filepath.Base(protobufPath))
256 …command{Dir: protobufPath}.mustRun(t, "bazel", "build", ":protoc", "//conformance:conformance_test…
258 check(os.Setenv("PROTOBUF_ROOT", protobufPath)) // for generate-protos
259 …registerBinary("conform-test-runner", filepath.Join(protobufPath, "bazel-bin", "conformance", "con…
260 registerBinary("protoc", filepath.Join(protobufPath, "bazel-bin", "protoc"))
268 url := fmt.Sprintf("https://dl.google.com/go/go%v.%v-%v.tar.gz", v, runtime.GOOS, runtime.GOARCH)
269 …downloadArchive(check, goDir, url, "go", "") // skip SHA256 check as we fetch over https from a tr…
278 checkDir := startWork("staticcheck-" + staticcheckVersion)
281 …url := fmt.Sprintf("https://github.com/dominikh/go-tools/releases/download/%v/staticcheck_%v_%v.ta…
282 …downloadArchive(check, checkDir, url, "staticcheck", staticcheckSHA256s[runtime.GOOS+"/"+runtime.G…
289 check(os.Unsetenv("GOROOT"))
292 check(os.Setenv("GOCACHE", filepath.Join(repoRoot, ".gocache")))
294 // Setup GOPATH for pre-module support (i.e., go1.10 and earlier).
296 …modulePath = strings.TrimSpace(command{Dir: testDir}.mustRun(t, "go", "list", "-m", "-f", "{{.Path…
297 check(os.RemoveAll(filepath.Join(goPath, "src")))
298 check(os.MkdirAll(filepath.Join(goPath, "src", filepath.Dir(modulePath)), 0775))
299 check(os.Symlink(repoRoot, filepath.Join(goPath, "src", modulePath)))
302 check(os.Setenv("GOPATH", goPath))
306 func downloadFile(check func(error), dstPath, srcURL string) {
308 check(err)
311 check(os.MkdirAll(filepath.Dir(dstPath), 0775))
313 check(err)
316 check(err)
319 func downloadArchive(check func(error), dstPath, srcURL, skipPrefix, wantSHA256 string) {
320 check(os.RemoveAll(dstPath))
323 check(err)
329 check(err)
333 check(fmt.Errorf("checksum validation error:\ngot %v\nwant %v", gotSHA256, wantSHA256))
338 check(err)
346 check(err)
364 check(err)
365 check(ioutil.WriteFile(path, b, mode))
367 check(os.Mkdir(path, mode))
375 …fmt.Print(mustRunCommand(t, "go", "run", "-tags", "protolegacy", "./internal/cmd/generate-types", …
376 …fmt.Print(mustRunCommand(t, "go", "run", "-tags", "protolegacy", "./internal/cmd/generate-protos",…
377 files := strings.Split(strings.TrimSpace(mustRunCommand(t, "git", "ls-files", "*.go")), "\n")
378 mustRunCommand(t, append([]string{"gofmt", "-w"}, files...)...)
391 binPath := filepath.Join("bin", fmt.Sprintf("protoc-gen-go.%v.%v.%v", v, goos, goarch))
393 // Build the binary.
395 …cmd.mustRun(t, "go", "build", "-trimpath", "-ldflags", "-s -w -buildid=", "-o", binPath, "./cmd/pr…
404 comment := fmt.Sprintf("protoc-gen-go VERSION=%v GOOS=%v GOARCH=%v", v, goos, goarch)
410 fw, _ := zw.Create("protoc-gen-go.exe")
419 Name: "protoc-gen-go",
441 // Use of this source code is governed by a BSD-style
445 regexp.MustCompile(`^// Protocol Buffers - Google's data interchange format
451 var bad []string
463 bad = append(bad, file)
465 if len(bad) > 0 {
466 t.Fatalf("files with missing/bad copyright headers:\n %v", strings.Join(bad, "\n "))