cmd/dist: execute misc/cgo/testso again on windows

Fixes #10072

Change-Id: I1f73c8829a89144d49433a36a4e64223c74af954
Reviewed-on: https://go-review.googlesource.com/6585
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Alex Brainman 2015-03-04 16:16:26 +11:00
parent 2587520797
commit d2918cbcaa
2 changed files with 19 additions and 17 deletions

View File

@ -13,6 +13,6 @@ main.exe
goto :end
:fail
:: echo FAIL
echo FAIL
:end
del /F cgoso_c.o libcgosotest.dll main.exe 2>NUL

34
src/cmd/dist/test.go vendored
View File

@ -267,22 +267,7 @@ func (t *tester) registerTests() {
t.tests = append(t.tests, distTest{
name: "testso",
heading: "../misc/cgo/testso",
fn: func() error {
// TODO(brainman): finish this; https://golang.org/issue/10072
return nil
cmd := t.dirCmd("misc/cgo/testso", "./test.bat")
var buf bytes.Buffer
cmd.Stdout = &buf
cmd.Stderr = &buf
err := cmd.Run()
s := buf.String()
fmt.Println(s)
if err == nil && strings.Contains(s, "FAIL") {
return errors.New("test failed")
}
return err
},
fn: t.cgoTestSOWindows,
})
} else if t.hasBash() {
t.registerTest("testso", "../misc/cgo/testso", "./test.bash")
@ -517,6 +502,23 @@ func (t *tester) cgoTest() error {
return nil
}
func (t *tester) cgoTestSOWindows() error {
cmd := t.dirCmd("misc/cgo/testso", `.\test`)
var buf bytes.Buffer
cmd.Stdout = &buf
cmd.Stderr = &buf
err := cmd.Run()
s := buf.String()
fmt.Println(s)
if err != nil {
return err
}
if strings.Contains(s, "FAIL") {
return errors.New("test failed")
}
return nil
}
func (t *tester) hasBash() bool {
switch t.gohostos {
case "windows", "plan9":