tools/go/ssa/interp
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
..
testdata go/ssa: support custom TestMain functions in test packages 2016-10-19 17:50:59 +00:00
external.go go/ssa/interp: turn {strings,bytes}.init into no-ops 2016-09-07 20:36:55 +00:00
external_darwin.go go/ssa/interp: add syscall.Sysctl to Darwin. 2014-03-04 13:34:45 -05:00
external_freebsd.go go.tools/go/ssa/interp: add wrappers for Sysctl{,Uint32} intrinsics on FreeBSD 2014-04-18 15:58:12 -04:00
external_plan9.go all: fix plan9 failures 2016-01-28 00:31:03 +00:00
external_unix.go go/ssa/interp: make os.Pipe intrinsic POSIX-portable; disable on Windows 2016-01-06 19:21:02 +00:00
external_windows.go go/ssa/interp: make os.Pipe intrinsic POSIX-portable; disable on Windows 2016-01-06 19:21:02 +00:00
interp.go go/ssa/interp: add intrinsic for runtime.NumGoroutine 2016-04-28 18:16:55 +00:00
interp_test.go go/ssa: support custom TestMain functions in test packages 2016-10-19 17:50:59 +00:00
map.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
ops.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
reflect.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
value.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00