tools/go/ssa
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
..
interp go/ssa: support custom TestMain functions in test packages 2016-10-19 17:50:59 +00:00
ssautil go/ssa: support custom TestMain functions in test packages 2016-10-19 17:50:59 +00:00
testdata go/ssa: emit DebugRefs for x, y = z() assignments 2015-10-23 10:25:05 +00:00
blockopt.go go.tools/go/ssa: don't attempt fusion on single-pred blocks with φ-nodes 2014-04-24 09:08:21 -04:00
builder.go go/ssa: fix stale docs for CreateProgram and Build 2016-07-20 18:52:54 +00:00
builder_test.go go/ssa: reduce set of expected indirect imports 2016-04-28 21:42:55 +00:00
const.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
const15.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
create.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
doc.go go/ssa: update package doc to mention ssautil.CreateProgram 2015-07-27 18:48:45 +00:00
dom.go go.tools/go/ssa: use bytes.Buffer instead of io.Writer. 2014-01-28 17:48:10 -05:00
emit.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
example_test.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
func.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
lift.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
lvalue.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
methods.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
mode.go go/ssa: make *BuilderMode satisfy flag.Value 2016-03-07 22:18:09 +00:00
print.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
sanity.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
source.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
source_test.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
ssa.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
stdlib_test.go all: skip slow tests in short mode 2016-01-28 00:14:01 +00:00
testmain.go go/ssa: support custom TestMain functions in test packages 2016-10-19 17:50:59 +00:00
testmain_test.go go/ssa: support custom TestMain functions in test packages 2016-10-19 17:50:59 +00:00
util.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00
wrappers.go tools: switch to standard go/types at tip 2016-01-06 22:15:26 +00:00