Commit e6cbf98d authored by Hiroshi Ioka's avatar Hiroshi Ioka Committed by Ian Lance Taylor

misc/cgo/testshared: call flag.Parse in TestMain

Otherwise, some test flags don't work.

Change-Id: Iacf3930d0eec28e4d690cd382adbb2ecf866a0e2
Reviewed-on: https://go-review.googlesource.com/55615Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent c59b4959
...@@ -10,6 +10,7 @@ import ( ...@@ -10,6 +10,7 @@ import (
"debug/elf" "debug/elf"
"encoding/binary" "encoding/binary"
"errors" "errors"
"flag"
"fmt" "fmt"
"go/build" "go/build"
"io" "io"
...@@ -161,6 +162,8 @@ func testMain(m *testing.M) (int, error) { ...@@ -161,6 +162,8 @@ func testMain(m *testing.M) (int, error) {
} }
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
flag.Parse()
// Some of the tests install binaries into a custom GOPATH. // Some of the tests install binaries into a custom GOPATH.
// That won't work if GOBIN is set. // That won't work if GOBIN is set.
os.Unsetenv("GOBIN") os.Unsetenv("GOBIN")
......
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