@@ -22,21 +22,29 @@ import (
22
22
"golang.org/x/tools/internal/testenv"
23
23
)
24
24
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
-
35
25
var packagesFlag = flag .String ("packages" , "" , "set of packages for TestEverything" )
36
26
37
27
// TestEverything invokes the inliner on every single call site in a
38
28
// given package. and checks that it produces either a reasonable
39
29
// 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.
40
48
func TestEverything (t * testing.T ) {
41
49
testenv .NeedsGoPackages (t )
42
50
if testing .Short () {
@@ -48,7 +56,6 @@ func TestEverything(t *testing.T) {
48
56
49
57
// Load this package plus dependencies from typed syntax.
50
58
cfg := & packages.Config {
51
- Dir : "../../.." , // root of x/tools
52
59
Mode : packages .LoadAllSyntax ,
53
60
Env : append (os .Environ (),
54
61
"GO111MODULES=on" ,
0 commit comments