Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/go/packages: Test packages not fully substituted #27670

Closed
ianthehat opened this issue Sep 14, 2018 · 1 comment
Closed

x/tools/go/packages: Test packages not fully substituted #27670

ianthehat opened this issue Sep 14, 2018 · 1 comment

Comments

@ianthehat
Copy link

When processing an xtest that depends on packages that themselves depend on the package under test, they all need to be substituted with special test versions.
go list does this correctly in 1.11, but the 1.10 fallback code does not.
gopackages -mode Syntax -test debug/dwarf
with 1.10 produces

Go package "debug/dwarf_test [debug/dwarf.test]":
	package dwarf_test
	has complete exported type info and typed ASTs
	file /usr/lib/go/src/debug/dwarf/entry_test.go
	file /usr/lib/go/src/debug/dwarf/line_test.go
	file /usr/lib/go/src/debug/dwarf/type_test.go
	import "debug/dwarf" => "debug/dwarf [debug/dwarf.test]"
	import "debug/elf"
	import "debug/macho"
	import "debug/pe"
	import "io"
	import "reflect"
	import "strings"
	import "testing"
	/usr/lib/go/src/debug/dwarf/type_test.go:55:9: cannot use d (variable of type *debug/dwarf.Data) as *debug/dwarf.Data value in return statement
	/usr/lib/go/src/debug/dwarf/type_test.go:68:9: cannot use d (variable of type *debug/dwarf.Data) as *debug/dwarf.Data value in return statement
	/usr/lib/go/src/debug/dwarf/type_test.go:81:9: cannot use d (variable of type *debug/dwarf.Data) as *debug/dwarf.Data value in return statement

whereas in 1.11 the imports are

Go package "debug/dwarf_test [debug/dwarf.test]":
        package dwarf_test
        has complete exported type info and typed ASTs
        file /Users/iancottrell/sdk/go1.11/src/debug/dwarf/entry_test.go
        file /Users/iancottrell/sdk/go1.11/src/debug/dwarf/line_test.go
        file /Users/iancottrell/sdk/go1.11/src/debug/dwarf/type_test.go
        import "debug/dwarf" => "debug/dwarf [debug/dwarf.test]"
        import "debug/elf" => "debug/elf [debug/dwarf.test]"
        import "debug/macho" => "debug/macho [debug/dwarf.test]"
        import "debug/pe" => "debug/pe [debug/dwarf.test]"
        import "io"
        import "reflect"
        import "strings"
        import "testing"
@gopherbot gopherbot added this to the Unreleased milestone Sep 14, 2018
@gopherbot
Copy link

Change https://golang.org/cl/136176 mentions this issue: go/packages: add missing test variants to fallback loader

@golang golang locked and limited conversation to collaborators Sep 25, 2019
@rsc rsc unassigned matloob Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants