]> Cypherpunks repositories - gostls13.git/commitdiff
misc/cgo/testshared: call flag.Parse in TestMain
authorHiroshi Ioka <hirochachacha@gmail.com>
Tue, 15 Aug 2017 11:53:49 +0000 (20:53 +0900)
committerIan Lance Taylor <iant@golang.org>
Tue, 15 Aug 2017 13:58:48 +0000 (13:58 +0000)
Otherwise, some test flags don't work.

Change-Id: Iacf3930d0eec28e4d690cd382adbb2ecf866a0e2
Reviewed-on: https://go-review.googlesource.com/55615
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

misc/cgo/testshared/shared_test.go

index 9e682a2fb5931144c889da4b31fb090589cf0fdd..97cdc80af8aa34a7d61a5d8ad8a14c603e878a0c 100644 (file)
@@ -10,6 +10,7 @@ import (
        "debug/elf"
        "encoding/binary"
        "errors"
+       "flag"
        "fmt"
        "go/build"
        "io"
@@ -161,6 +162,8 @@ func testMain(m *testing.M) (int, error) {
 }
 
 func TestMain(m *testing.M) {
+       flag.Parse()
+
        // Some of the tests install binaries into a custom GOPATH.
        // That won't work if GOBIN is set.
        os.Unsetenv("GOBIN")