diff options
| author | David Symonds <dsymonds@golang.org> | 2012-02-16 15:06:12 +1100 |
|---|---|---|
| committer | David Symonds <dsymonds@golang.org> | 2012-02-16 15:06:12 +1100 |
| commit | 7ec5499d36348925cc294faaf96c64d63b2b0628 (patch) | |
| tree | 45e6ebe3461d7aabf26bfb3ea135331a8b1403e8 /src/pkg/debug | |
| parent | aed20a6951948ef7f6edd1f4160fc8c1d3e8df56 (diff) | |
| download | go-7ec5499d36348925cc294faaf96c64d63b2b0628.tar.xz | |
debug/gosym: more carefully build the test binary.
TBR=r
CC=golang-dev
https://golang.org/cl/5676062
Diffstat (limited to 'src/pkg/debug')
| -rw-r--r-- | src/pkg/debug/gosym/pclntab_test.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pkg/debug/gosym/pclntab_test.go b/src/pkg/debug/gosym/pclntab_test.go index dbd3992ee5..b2400bb3ba 100644 --- a/src/pkg/debug/gosym/pclntab_test.go +++ b/src/pkg/debug/gosym/pclntab_test.go @@ -6,6 +6,7 @@ package gosym import ( "debug/elf" + "fmt" "os" "os/exec" "runtime" @@ -27,7 +28,9 @@ func dotest() bool { // the resulting binary looks like it was built from pclinetest.s, // but we have renamed it to keep it away from the go tool. pclinetestBinary = os.TempDir() + "/pclinetest" - cmd := exec.Command("sh", "-c", "go tool 6a pclinetest.asm && go tool 6l -E main -o "+pclinetestBinary+" pclinetest.6") + command := fmt.Sprintf("go tool 6a -o %s.6 pclinetest.asm && go tool 6l -E main -o %s %s.6", + pclinetestBinary, pclinetestBinary, pclinetestBinary) + cmd := exec.Command("sh", "-c", command) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr if err := cmd.Run(); err != nil { @@ -185,8 +188,8 @@ func TestPCLine(t *testing.T) { t.Logf("off is %d", off) if fn == nil { t.Errorf("failed to get line of PC %#x", pc) - } else if !strings.HasSuffix(file, "pclinetest.s") { - t.Errorf("expected %s (%s) at PC %#x, got %s (%s)", "pclinetest.s", sym.Name, pc, file, fn.Name) + } else if !strings.HasSuffix(file, "pclinetest.asm") { + t.Errorf("expected %s (%s) at PC %#x, got %s (%s)", "pclinetest.asm", sym.Name, pc, file, fn.Name) } else if line != wantLine || fn != sym { t.Errorf("expected :%d (%s) at PC %#x, got :%d (%s)", wantLine, sym.Name, pc, line, fn.Name) } |
