package objabi
-import "testing"
+import (
+ "internal/testenv"
+ "os/exec"
+ "strings"
+ "testing"
+)
func TestPathToPrefix(t *testing.T) {
tests := []struct {
}
}
}
+
+func TestRuntimePackageList(t *testing.T) {
+ // Test that all packages imported by the runtime are marked as runtime
+ // packages.
+ testenv.MustHaveGoBuild(t)
+ goCmd, err := testenv.GoTool()
+ if err != nil {
+ t.Fatal(err)
+ }
+ pkgList, err := exec.Command(goCmd, "list", "-deps", "runtime").Output()
+ if err != nil {
+ if err, ok := err.(*exec.ExitError); ok {
+ t.Log(string(err.Stderr))
+ }
+ t.Fatal(err)
+ }
+ for _, pkg := range strings.Split(strings.TrimRight(string(pkgList), "\n"), "\n") {
+ if pkg == "unsafe" {
+ continue
+ }
+ if !LookupPkgSpecial(pkg).Runtime {
+ t.Errorf("package %s is imported by runtime, but not marked Runtime", pkg)
+ }
+ }
+}
//
// This should be set for runtime and all packages it imports, and may be
// set for additional packages.
- //
- // TODO(austin): Test that all of `go list -deps runtime` is marked Runtime.
Runtime bool
// AllowAsmABI indicates that assembly in this package is allowed to use ABI
"internal/coverage/rtcov",
"internal/cpu",
"internal/goarch",
+ "internal/godebugs",
+ "internal/goexperiment",
"internal/goos",
}