Commit 3ca788de authored by Alex Brainman's avatar Alex Brainman

os/signal: use unique program name during TestCtrlBreak

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/84650047
parent 8d1b63ab
...@@ -6,6 +6,7 @@ package signal ...@@ -6,6 +6,7 @@ package signal
import ( import (
"bytes" "bytes"
"io/ioutil"
"os" "os"
"os/exec" "os/exec"
"path/filepath" "path/filepath"
...@@ -55,9 +56,15 @@ func main() { ...@@ -55,9 +56,15 @@ func main() {
} }
} }
` `
name := filepath.Join(os.TempDir(), "ctlbreak") tmp, err := ioutil.TempDir("", "TestCtrlBreak")
if err != nil {
t.Fatal("TempDir failed: ", err)
}
defer os.RemoveAll(tmp)
// write ctrlbreak.go
name := filepath.Join(tmp, "ctlbreak")
src := name + ".go" src := name + ".go"
defer os.Remove(src)
f, err := os.Create(src) f, err := os.Create(src)
if err != nil { if err != nil {
t.Fatalf("Failed to create %v: %v", src, err) t.Fatalf("Failed to create %v: %v", src, err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment