Commit 22538477 authored by Hiroshi Ioka's avatar Hiroshi Ioka Committed by Brad Fitzpatrick

cmd/go: use filepath.Base for getting $CC name in TestCgoContainsSpace

Change-Id: If7329b81073d7c98fdcb8a2c0b35f8708000606e
Reviewed-on: https://go-review.googlesource.com/43332
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 482da518
...@@ -4055,7 +4055,9 @@ func TestCgoFlagContainsSpace(t *testing.T) { ...@@ -4055,7 +4055,9 @@ func TestCgoFlagContainsSpace(t *testing.T) {
tg := testgo(t) tg := testgo(t)
defer tg.cleanup() defer tg.cleanup()
tg.tempFile(fmt.Sprintf("src/%s/main.go", testCC), fmt.Sprintf(`package main ccName := filepath.Base(testCC)
tg.tempFile(fmt.Sprintf("src/%s/main.go", ccName), fmt.Sprintf(`package main
import ( import (
"os" "os"
"os/exec" "os/exec"
...@@ -4095,9 +4097,9 @@ func TestCgoFlagContainsSpace(t *testing.T) { ...@@ -4095,9 +4097,9 @@ func TestCgoFlagContainsSpace(t *testing.T) {
} }
} }
`, testCC)) `, testCC))
tg.cd(tg.path(fmt.Sprintf("src/%s", testCC))) tg.cd(tg.path(fmt.Sprintf("src/%s", ccName)))
tg.run("build") tg.run("build")
tg.setenv("CC", tg.path(fmt.Sprintf("src/%s/%s", testCC, testCC))) tg.setenv("CC", tg.path(fmt.Sprintf("src/%s/%s", ccName, ccName)))
tg.tempFile("src/cgo/main.go", `package main tg.tempFile("src/cgo/main.go", `package main
// #cgo CFLAGS: -I"c flags" // #cgo CFLAGS: -I"c flags"
......
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