aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/debug
diff options
context:
space:
mode:
authorRémy Oudompheng <oudomphe@phare.normalesup.org>2013-01-27 00:24:09 +0100
committerRémy Oudompheng <oudomphe@phare.normalesup.org>2013-01-27 00:24:09 +0100
commit75104237c82f943bffc41334acd179cf28f30ea2 (patch)
treef0729cc4e295f7994932262ea84abe06c7cb01df /src/pkg/debug
parentc48f7d6b8af8b1a8ced44453a9970801faeeb9f5 (diff)
downloadgo-75104237c82f943bffc41334acd179cf28f30ea2.tar.xz
all: make tests able to run multiple times.
It is now possible to run "go test -cpu=1,2,4 std" successfully. Fixes #3185. R=golang-dev, dave, minux.ma, bradfitz CC=golang-dev https://golang.org/cl/7196052
Diffstat (limited to 'src/pkg/debug')
-rw-r--r--src/pkg/debug/gosym/pclntab_test.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/pkg/debug/gosym/pclntab_test.go b/src/pkg/debug/gosym/pclntab_test.go
index 5f2242eba0..20acba612f 100644
--- a/src/pkg/debug/gosym/pclntab_test.go
+++ b/src/pkg/debug/gosym/pclntab_test.go
@@ -52,6 +52,14 @@ func dotest() bool {
return true
}
+func endtest() {
+ if pclineTempDir != "" {
+ os.RemoveAll(pclineTempDir)
+ pclineTempDir = ""
+ pclinetestBinary = ""
+ }
+}
+
func getTable(t *testing.T) *Table {
f, tab := crack(os.Args[0], t)
f.Close()
@@ -95,6 +103,7 @@ func TestLineFromAline(t *testing.T) {
if !dotest() {
return
}
+ defer endtest()
tab := getTable(t)
@@ -142,6 +151,7 @@ func TestLineAline(t *testing.T) {
if !dotest() {
return
}
+ defer endtest()
tab := getTable(t)
@@ -183,7 +193,7 @@ func TestPCLine(t *testing.T) {
if !dotest() {
return
}
- defer os.RemoveAll(pclineTempDir)
+ defer endtest()
f, tab := crack(pclinetestBinary, t)
text := f.Section(".text")