Skip to content

Commit

Permalink
test: switch fieldtrack test to use GOEXPERIMENT
Browse files Browse the repository at this point in the history
Now that we can set GOEXPERIMENT at build time, we no longer need
-d=fieldtrack in the compiler to enabled field tracking at build time.
Switch the one test that uses -d=fieldtrack to use GOEXPERIMENT
instead so we can eliminate this debug flag and centralize on
GOEXPERIMENT.

Updates #42681.

Change-Id: I14c352c9a97187b9c5ec8027ff672d685f22f543
Reviewed-on: https://go-review.googlesource.com/c/go/+/302969
Trust: Austin Clements <[email protected]>
Run-TryBot: Austin Clements <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Reviewed-by: Matthew Dempsky <[email protected]>
  • Loading branch information
aclements committed Mar 18, 2021
1 parent bdbba22 commit d3ab6b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/fixedbugs/issue42686.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// compile -d=fieldtrack
// compile -goexperiment fieldtrack

// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
Expand Down
6 changes: 5 additions & 1 deletion test/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ func (t *test) run() {
return
}

var args, flags []string
var args, flags, runenv []string
var tim int
wantError := false
wantAuto := false
Expand Down Expand Up @@ -572,6 +572,9 @@ func (t *test) run() {
if err != nil {
t.err = fmt.Errorf("need number of seconds for -t timeout, got %s instead", args[0])
}
case "-goexperiment": // set GOEXPERIMENT environment
args = args[1:]
runenv = append(runenv, "GOEXPERIMENT="+args[0])

default:
flags = append(flags, args[0])
Expand Down Expand Up @@ -628,6 +631,7 @@ func (t *test) run() {
if tempDirIsGOPATH {
cmd.Env = append(cmd.Env, "GOPATH="+t.tempDir)
}
cmd.Env = append(cmd.Env, runenv...)

var err error

Expand Down

0 comments on commit d3ab6b5

Please sign in to comment.