1
0
mirror of https://github.com/golang/go synced 2024-11-18 18:44:42 -07:00
go/cmd/guru
Alan Donovan 8e53eb937b go/ssa: support custom TestMain functions in test packages
Supporting user-defined TestMain functions requires that we generate a
"testmain" package for each testable package, rather than a single one
for the entire program.  This entails these API changes:

1. (*ssa.Program).{CreateTestMainPackage,FindTests} both now
   accept only a single package.  Existing clients that pass them
   multiple packages must call them from a loop.

2. (*ssa.Program).FindTests returns an additional result, the the
   optional TestMain *ssa.Function.  Existing clients may discard it.

Also:
- Test the new logic using the SSA interpreter
- add ssautil.MainPackages helper
- callgraph: allow multiple main packages, and analyze them all
- ssadump -run: allow multiple main/test packages, and run each in a new interpreter
- minor simplifications to some callers (e.g. guru)

Fixes golang/go#9553

Change-Id: Ia7de9bd27448fb08b8d172ba5cdbcf37a762b7a0
Reviewed-on: https://go-review.googlesource.com/25102
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-10-19 17:50:59 +00:00
..
serial cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
testdata/src cmd/guru: show correct definition for embedded type. 2016-08-24 12:03:13 +00:00
callees.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
callers.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
callstack.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
definition.go cmd/guru: show correct definition for embedded type. 2016-08-24 12:03:13 +00:00
describe.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
freevars.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
guru_test.go cmd/guru: suppress failing test on plan9 2016-07-18 14:28:24 +00:00
guru.go go/ssa: support custom TestMain functions in test packages 2016-10-19 17:50:59 +00:00
implements.go cmd/guru: implements: if selected expr is a value, use its type 2016-04-28 14:33:14 +00:00
main.go cmd/guru: update link to documentation 2016-07-08 22:10:47 +00:00
peers.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
pointsto.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
pos.go cmd/guru: fix nil deref when position is not in Go source 2016-03-07 15:53:42 +00:00
referrers.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00
what.go cmd/guru: what: include imported package names in sameids 2016-07-15 18:55:24 +00:00
whicherrs.go cmd/guru: support streaming plain and -json output 2016-04-11 19:51:55 +00:00