Skip to content

Commit 6a38a5f

Browse files
committed
internal/refactor/inline: use default working directory
Also, tweak comments. Change-Id: I5051eb902eb0cbd07fb10ae820b2e01bce2fe14e Reviewed-on: https://go-review.googlesource.com/c/tools/+/532275 Reviewed-by: Robert Findley <[email protected]> Auto-Submit: Alan Donovan <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent c6d331d commit 6a38a5f

File tree

1 file changed

+18
-11
lines changed

1 file changed

+18
-11
lines changed

internal/refactor/inline/everything_test.go

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,29 @@ import (
2222
"golang.org/x/tools/internal/testenv"
2323
)
2424

25-
// Run with this command:
26-
//
27-
// $ go test ./internal/refactor/inline/ -run=Everything -v -packages=./internal/...
28-
29-
// TODO(adonovan):
30-
// - report counters (number of attempts, failed AnalyzeCallee, failed
31-
// Inline, etc.)
32-
// - Make a pretty log of the entire output so that we can peruse it
33-
// for opportunities for systematic improvement.
34-
3525
var packagesFlag = flag.String("packages", "", "set of packages for TestEverything")
3626

3727
// TestEverything invokes the inliner on every single call site in a
3828
// given package. and checks that it produces either a reasonable
3929
// error, or output that parses and type-checks.
30+
//
31+
// It does nothing during ordinary testing, but may be used to find
32+
// inlining bugs in large corpora.
33+
//
34+
// Use this command to inline everything in golang.org/x/tools:
35+
//
36+
// $ go test ./internal/refactor/inline/ -run=Everything -v -packages=../../../
37+
//
38+
// And these commands to inline everything in the kubernetes repository:
39+
//
40+
// $ go build -o /tmp/everything ./internal/refactor/inline/
41+
// $ (cd kubernetes && /tmp/everything -run=Everything -v -packages=./...)
42+
//
43+
// TODO(adonovan):
44+
// - report counters (number of attempts, failed AnalyzeCallee, failed
45+
// Inline, etc.)
46+
// - Make a pretty log of the entire output so that we can peruse it
47+
// for opportunities for systematic improvement.
4048
func TestEverything(t *testing.T) {
4149
testenv.NeedsGoPackages(t)
4250
if testing.Short() {
@@ -48,7 +56,6 @@ func TestEverything(t *testing.T) {
4856

4957
// Load this package plus dependencies from typed syntax.
5058
cfg := &packages.Config{
51-
Dir: "../../..", // root of x/tools
5259
Mode: packages.LoadAllSyntax,
5360
Env: append(os.Environ(),
5461
"GO111MODULES=on",

0 commit comments

Comments
 (0)