1
0
mirror of https://github.com/golang/go synced 2024-11-18 09:04:49 -07:00
go/cmd
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
..
benchcmp benchmark/parser, cmd/benchcmp: improve names of exported identifiers 2015-01-15 01:28:17 +00:00
bundle cmd/bundle: add flag to rewrite golang.org/ to golang_org/ in imports 2016-09-13 16:37:30 +00:00
callgraph go/ssa: support custom TestMain functions in test packages 2016-10-19 17:50:59 +00:00
cover all: address vet issues, fix print calls 2016-03-27 20:36:34 +00:00
digraph tools: add import comments. 2014-12-09 22:42:16 +00:00
eg refactor/eg: refactor to break dependency on go/loader 2015-09-01 14:26:06 +00:00
fiximports cmd/godoc, cmd/fiximports: fix or skip failing tests at tip 2016-10-12 15:24:30 +00:00
godex x/tools: delete x/tools/go/types and dependent packages/client files 2016-04-06 21:52:49 +00:00
godoc cmd/godoc: increase test timeout 2016-10-12 16:04:38 +00:00
goimports cmd/goimports: work around lack of runtime/trace in gccgo 2016-08-13 05:07:58 +00:00
gomvpkg go/buildutil: TagsFlag provides a flag.Value for setting build.Context.BuildTags from -tags flag. 2015-04-23 14:10:21 +00:00
gorename cmd/gorename: -d flag prints diffs instead of rewriting files 2015-12-30 15:25:00 +00:00
gotype x/tools: delete x/tools/go/types and dependent packages/client files 2016-04-06 21:52:49 +00:00
goyacc cmd/goyacc: remove hardcoded NTYPES 2016-10-07 17:45:45 +00:00
guru go/ssa: support custom TestMain functions in test packages 2016-10-19 17:50:59 +00:00
heapview x/tools/cmd/heapview: add a sidebar to hold navigation 2016-08-16 17:33:40 +00:00
html2article tools: fix 'Split called after Scan' 2016-05-04 16:29:22 +00:00
present present: make code in slides editable only with -edit 2016-10-07 20:29:58 +00:00
ssadump go/ssa: support custom TestMain functions in test packages 2016-10-19 17:50:59 +00:00
stress all: fix plan9 failures 2016-01-28 00:31:03 +00:00
stringer cmd/stringer: fixed usage line typo 2016-04-17 02:19:27 +00:00
tip tip/doc: update doc to match latest gcloud syntax 2016-08-03 14:42:34 +00:00