Compare commits
2 Commits
d166a0b03e
...
934d5f2cf7
Author | SHA1 | Date | |
---|---|---|---|
|
934d5f2cf7 | ||
|
5a08865de3 |
@ -582,13 +582,30 @@ func testTraceProg(t *testing.T, progName string, extra func(t *testing.T, trace
|
||||
testPath := filepath.Join("./testdata/testprog", progName)
|
||||
testName := progName
|
||||
runTest := func(t *testing.T, stress bool, extraGODEBUG string) {
|
||||
// Run the program and capture the trace, which is always written to stdout.
|
||||
cmd := testenv.Command(t, testenv.GoToolPath(t), "run")
|
||||
if race.Enabled {
|
||||
cmd.Args = append(cmd.Args, "-race")
|
||||
// Build the program.
|
||||
binFile, err := os.CreateTemp("", progName)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create temporary output file: %v", err)
|
||||
}
|
||||
cmd.Args = append(cmd.Args, testPath)
|
||||
cmd.Env = append(os.Environ(), "GOEXPERIMENT=rangefunc")
|
||||
bin := binFile.Name()
|
||||
binFile.Close()
|
||||
t.Cleanup(func() {
|
||||
os.Remove(bin)
|
||||
})
|
||||
buildCmd := testenv.CommandContext(t, t.Context(), testenv.GoToolPath(t), "build", "-o", bin)
|
||||
if race.Enabled {
|
||||
buildCmd.Args = append(buildCmd.Args, "-race")
|
||||
}
|
||||
buildCmd.Args = append(buildCmd.Args, testPath)
|
||||
buildCmd.Env = append(os.Environ(), "GOEXPERIMENT=rangefunc")
|
||||
buildOutput, err := buildCmd.CombinedOutput()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to build %s: %v: output:\n%s", testPath, err, buildOutput)
|
||||
}
|
||||
|
||||
// Run the program and capture the trace, which is always written to stdout.
|
||||
cmd := testenv.CommandContext(t, t.Context(), bin)
|
||||
|
||||
// Add a stack ownership check. This is cheap enough for testing.
|
||||
godebug := "tracecheckstackownership=1"
|
||||
if stress {
|
||||
|
@ -24,9 +24,6 @@ import (
|
||||
// BUG(mikio): On JS and Plan 9, methods and functions related
|
||||
// to IPConn are not implemented.
|
||||
|
||||
// BUG(mikio): On Windows, the File method of IPConn is not
|
||||
// implemented.
|
||||
|
||||
// IPAddr represents the address of an IP end point.
|
||||
type IPAddr struct {
|
||||
IP IP
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// BUG(mikio): On JS and Windows, the File method of TCPConn and
|
||||
// BUG(mikio): On JS, the File method of TCPConn and
|
||||
// TCPListener is not implemented.
|
||||
|
||||
// TCPAddr represents the address of a TCP end point.
|
||||
|
@ -14,9 +14,6 @@ import (
|
||||
// BUG(mikio): On Plan 9, the ReadMsgUDP and
|
||||
// WriteMsgUDP methods of UDPConn are not implemented.
|
||||
|
||||
// BUG(mikio): On Windows, the File method of UDPConn is not
|
||||
// implemented.
|
||||
|
||||
// BUG(mikio): On JS, methods and functions related to UDPConn are not
|
||||
// implemented.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user