tools/go
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
..
ast/astutil go/ast/astutil: do not remove imports in AddNamedImport 2016-10-18 18:48:44 +00:00
buildutil x/tools: s/oracle/guru/g in various comments 2016-10-13 18:54:04 +00:00
callgraph x/tools: delete x/tools/go/types and dependent packages/client files 2016-04-06 21:52:49 +00:00
gcimporter15 go/gcimporter15: update exportdata.go to match latest version from std lib 2016-10-06 19:19:18 +00:00
loader x/tools: s/oracle/guru/g in various comments 2016-10-13 18:54:04 +00:00
pointer go/ssa: support custom TestMain functions in test packages 2016-10-19 17:50:59 +00:00
ssa go/ssa: support custom TestMain functions in test packages 2016-10-19 17:50:59 +00:00
types/typeutil x/tools: delete x/tools/go/types and dependent packages/client files 2016-04-06 21:52:49 +00:00
vcs go/vcs: accept plain file for .vcs (instead of directory) 2016-10-13 13:57:49 +00:00