]> Cypherpunks.ru repositories - gostls13.git/commitdiff
go/types: migrate importer usage in tests
authorMichael Matloob <matloob@golang.org>
Wed, 12 Oct 2022 23:09:43 +0000 (19:09 -0400)
committerMichael Matloob <matloob@golang.org>
Tue, 18 Oct 2022 20:41:52 +0000 (20:41 +0000)
To use an importer that knows where to find stdlib .a files based on
their new locations once the checked-in .a files are removed.

Change-Id: I981812306b3512380d58cb0f599a9a61b27ba0d7
Reviewed-on: https://go-review.googlesource.com/c/go/+/442695
Reviewed-by: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/go/types/issues_test.go
src/go/types/self_test.go
src/go/types/sizes_test.go
src/go/types/typestring_test.go

index 85362fb7b9e719adf7ed3284745047213e8a75bc..de8e0ad5f1a3594b68227f7cebd902dc1ea158a3 100644 (file)
@@ -578,6 +578,8 @@ func TestIssue44515(t *testing.T) {
 func TestIssue43124(t *testing.T) {
        // TODO(rFindley) move this to testdata by enhancing support for importing.
 
+       testenv.MustHaveGoBuild(t) // The go command is needed for the importer to determine the locations of stdlib .a files.
+
        // All involved packages have the same name (template). Error messages should
        // disambiguate between text/template and html/template by printing the full
        // path.
index 7a1e77083043d2ff5b2d3dae0b15e8cdd344e161..a63f2b74f5f96d251bd7da22778719f3fcf286f8 100644 (file)
@@ -9,6 +9,7 @@ import (
        "go/importer"
        "go/parser"
        "go/token"
+       "internal/testenv"
        "path"
        "path/filepath"
        "testing"
@@ -18,6 +19,8 @@ import (
 )
 
 func TestSelf(t *testing.T) {
+       testenv.MustHaveGoBuild(t) // The Go command is needed for the importer to determine the locations of stdlib .a files.
+
        fset := token.NewFileSet()
        files, err := pkgFiles(fset, ".")
        if err != nil {
@@ -32,6 +35,8 @@ func TestSelf(t *testing.T) {
 }
 
 func BenchmarkCheck(b *testing.B) {
+       testenv.MustHaveGoBuild(b) // The Go command is needed for the importer to determine the locations of stdlib .a files.
+
        for _, p := range []string{
                "net/http",
                "go/parser",
index 740072f1dc31ef536792209d1e3411d1024d647c..3ac124acf1071c704c7ce469b245d166dccf8d3c 100644 (file)
@@ -12,6 +12,7 @@ import (
        "go/parser"
        "go/token"
        "go/types"
+       "internal/testenv"
        "testing"
 )
 
@@ -116,6 +117,8 @@ const _ = unsafe.Offsetof(struct{ x int64 }{}.x)
 
 // Issue #53884.
 func TestAtomicAlign(t *testing.T) {
+       testenv.MustHaveGoBuild(t) // The Go command is needed for the importer to determine the locations of stdlib .a files.
+
        const src = `
 package main
 
index d8f81ecf5af5a49eeee5805d51caeb7bd5109711..dcbaa47709399ec3dc9c44de94168ccef99701ad 100644 (file)
@@ -125,6 +125,7 @@ var dependentTestTypes = []testEntry{
 }
 
 func TestTypeString(t *testing.T) {
+       // The Go command is needed for the importer to determine the locations of stdlib .a files.
        testenv.MustHaveGoBuild(t)
 
        var tests []testEntry