# Testing signals — golang/go

> Canonical page: https://codevetter.com/unpack/go/testing-signals

# Testing signals — golang/go

Scanned commit 12c76d447f576e6c14c566c8524c13a0c0d476b9 (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Testing is massive and layered: package-level Go tests throughout stdlib and cmd, the ~1900-file test/ black-box corpus driven by cmd/internal/testdir with //-directive comments, cmd/go's script-based tests under testdata/script using the cmd/internal/script engine, dist-level orchestration with race/msan/asan/compile-only modes, and API golden tests. CI is not GitHub Actions — .github contains only templates; testing runs on Go's own builder fleet via all.bash/run.bash with sharding support.
- testdir_test.go runs every test/*.go file as a subtest 'Test/<path>' over dirs {., ken, chan, interface, internal/runtime/sys, syntax, dwarf, fixedbugs, codegen, abi, typeparam, arenas, simd}; directives like '// run' and '// errorcheck' in each file control execution; flags -shard/-shards/-target/-update_errors/-all_codegen exist. — [src/cmd/internal/testdir/testdir_test.go#L37-120](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/internal/testdir/testdir_test.go#L37-L120) [test/fixedbugs/bug000.go](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/test/fixedbugs/bug000.go) [test/README.md](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/test/README.md)
- run.bash exports GOENV=off, GOPATH=/nonexist-gopath, disables core dumps, then execs 'go tool dist test -rebuild'; GO_TEST_SHARDS (default 1, or 10 on builders), GO_BUILDER_NAME, GO_TEST_SHORT, GO_TEST_TIMEOUT_SCALE control behavior. — [src/run.bash#L6-60](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/run.bash#L6-L60)
- cmd/dist/test.go's tester supports -race, -msan, -asan, -compile-only, -k (keep going), -run regexp (invertible with '!'), -json output; tests are grouped under headings and run as parallel work items. — [src/cmd/dist/test.go#L27-114](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/dist/test.go#L27-L114)
- cmd/go has extensive tests: go_test.go, plus script-driven tests in src/cmd/go/testdata/script executed by the cmd/internal/script engine (engine.go, conds.go, cmds_*.go). — [src/cmd/go/go_test.go](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/go/go_test.go) [src/cmd/go/testdata/script](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/go/testdata/script) [src/cmd/internal/script/engine.go](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/internal/script/engine.go)
- API compatibility is tested by src/cmd/api: api_test.go TestGolden/TestCompareAPI walks exported symbols and diffs against api/go1*.txt + api/next; boring_test.go covers FIPS API differences. — [src/cmd/api/api_test.go#L22-101](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/api/api_test.go#L22-L101) [src/cmd/api/main_test.go](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/api/main_test.go) [src/cmd/api/boring_test.go](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/api/boring_test.go)
- The compiler backend is heavily unit-tested in-tree: ssacompile has ~30 *_test.go files (prove_test, fuse_test, rewriteCond_test, looprotate_test, regalloc_test, schedule_test, etc.); test/codegen files assert generated-assembly patterns. — [src/cmd/compile/internal/ssacompile/compile.go](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/compile/internal/ssacompile/compile.go) [src/cmd/compile/internal/ssacompile/prove_test.go](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/compile/internal/ssacompile/prove_test.go) [src/cmd/internal/testdir/testdir_test.go#L74](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/internal/testdir/testdir_test.go#L74)
- cmd/go/internal/verylongtest exists as a separate package for tests too slow for normal runs; run.bash's GO_TEST_SHORT plumbing distinguishes short vs long builders. — [src/cmd/go/internal/verylongtest](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/go/internal/verylongtest) [src/run.bash#L17-20](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/run.bash#L17-L20)
- internal/testenv provides test helpers (GoToolPath, Builder) used by testdir and other cmd tests to locate the freshly built toolchain and detect builder environment. — [src/cmd/internal/testdir/testdir_test.go#L96](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/internal/testdir/testdir_test.go#L96) [src/internal/testenv](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/internal/testenv)
- buildall.bash/race.bash/clean.bash in src/ provide cross-compile and race-mode build verification; all.bash chains make.bash + run.bash + 'dist banner'. — [src/all.bash](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/all.bash) [src/buildall.bash](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/buildall.bash) [src/race.bash](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/race.bash)
- There are no GitHub Actions workflows: .github/ contains only CODE_OF_CONDUCT, ISSUE_TEMPLATE, PULL_REQUEST_TEMPLATE, SUPPORT; review runs on Gerrit (codereview.cfg) with LUCI builders — CI config is external to the repo (x/build). (inferred) — [codereview.cfg](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/codereview.cfg) [CONTRIBUTING.md#L29-31](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/CONTRIBUTING.md#L29-L31)
- VCS behavior is tested hermetically: cmd/go/internal/vcweb.Server hosts fake repos (VCSTestRepoURL/VCSTestHosts/VCSTestIsLocalHost hooks in vcs.go) so tests don't hit the network. — [src/cmd/go/internal/vcs/vcs.go#L56-110](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/go/internal/vcs/vcs.go#L56-L110) [src/cmd/go/internal/vcweb](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/go/internal/vcweb)
- Test flag definitions are shared and generated: genflags.go emits flagdefs.go so 'go test' flags and vet/test2json stay consistent; flagdefs_test.go verifies. — [src/cmd/go/internal/test/genflags.go](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/go/internal/test/genflags.go) [src/cmd/go/internal/test/flagdefs.go](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/go/internal/test/flagdefs.go) [src/cmd/go/internal/test/flagdefs_test.go](https://github.com/golang/go/blob/12c76d447f576e6c14c566c8524c13a0c0d476b9/src/cmd/go/internal/test/flagdefs_test.go)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
