1
0
mirror of https://github.com/golang/go synced 2024-11-19 00:54:42 -07:00
go/go
Alan Donovan e779aa49e3 go/ssa/interp: make tests fast and robust
The go/ssa/interp tests have been a maintenance nightmare for years
because the interpreter requires intrinsics for all low-level or
non-Go code functions, and the set of such functions in the standard
library naturally changes from day to day.

This CL finally drops support for interpreting real packages (which
has anyway been broken for ages) and restricts the test suite to small
programs that use a handful of simple functions in packages bytes,
strings, errors, runtime, reflect, and unicode. These functions are
declared in a tiny fake standard libary in testdata/src, and the
implementations of these functions are provided by interpreter
intrinsics that delegate to the real Go implementation---all their
parameters and results are basic datatypes.

The test suite is now very fast and should be easy to maintain going
forward. It is still possible that a change to some file in
$GOROOT/test/*.go adds a dependency to a symbol not present in our
standard library, but this is rare. I will either delete the test or
add the intrinsic on a case-by-case basis.

We no longer attempt to interpret major functionality like
fmt.Sprintf or "testing".

The interpreter always pretends to be in linux/amd64 mode.

Happy Christmas, Brad. ;)

Fixes golang/go#27292

Change-Id: I715cf63e3534e2e0dab4666a5d7c669bf1d92674
Reviewed-on: https://go-review.googlesource.com/c/tools/+/168898
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-22 17:29:27 +00:00
..
analysis go/analysis/passes/tests: break out of loop when we find a method 2019-03-22 16:28:07 +00:00
ast go/ast/inspector: fix a small typo 2019-01-10 14:16:07 +00:00
buildutil go/buildutil: get tests to pass when run from a module 2019-02-14 18:55:18 +00:00
callgraph go/...: use recommended issue tracker URLs 2018-12-05 01:41:16 +00:00
cfg go/cfg: a syntactic control-flow graph (CFG) 2018-09-26 00:57:46 +00:00
expect go/expect: rewrite the expectation parser 2018-11-30 19:57:46 +00:00
gccgoexportdata go/gccgoexportdata: correctly handle archive files containing string tables 2016-11-09 21:28:38 +00:00
gcexportdata go/gcexportdata: fix gcexportdata example for new compiler behavior 2019-03-19 23:21:07 +00:00
internal go/internal/gcimporter: write export data for go/types 2019-01-30 20:35:36 +00:00
loader go/...: use recommended issue tracker URLs 2018-12-05 01:41:16 +00:00
packages go/packages: fix the build 2019-03-21 23:23:50 +00:00
pointer go/...: use recommended issue tracker URLs 2018-12-05 01:41:16 +00:00
ssa go/ssa/interp: make tests fast and robust 2019-03-22 17:29:27 +00:00
types go/analysis/passes/printf: changes for analysis API 2018-10-16 19:44:49 +00:00
vcs go/vcs: remove go.googlesource.com vcsPath entry 2019-01-28 23:20:29 +00:00