Commit d2918cbc authored by Alex Brainman's avatar Alex Brainman

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

Fixes #10072

Change-Id: I1f73c8829a89144d49433a36a4e64223c74af954
Reviewed-on: https://go-review.googlesource.com/6585Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 25875207
......@@ -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
......@@ -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":
......
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