From 39b0b1a1a6506c8c25fcff56f4d70a85739dcb6a Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 11 Sep 2019 14:41:22 +0200 Subject: all: make unit tests work with Go 1.13 (#20053) Most of these changes are related to the Go 1.13 changes to test binary flag handling. * cmd/geth: make attach tests more reliable This makes the test wait for the endpoint to come up by polling it instead of waiting for two seconds. * tests: fix test binary flags for Go 1.13 Calling flag.Parse during package initialization is prohibited as of Go 1.13 and causes test failures. Call it in TestMain instead. * crypto/ecies: remove useless -dump flag in tests * p2p/simulations: fix test binary flags for Go 1.13 Calling flag.Parse during package initialization is prohibited as of Go 1.13 and causes test failures. Call it in TestMain instead. * build: remove workaround for ./... vendor matching This workaround was necessary for Go 1.8. The Go 1.9 release changed the expansion rules to exclude vendored packages. * Makefile: use relative path for GOBIN This makes the "Run ./build/bin/..." line look nicer. * les: fix test binary flags for Go 1.13 Calling flag.Parse during package initialization is prohibited as of Go 1.13 and causes test failures. Call it in TestMain instead. --- crypto/ecies/ecies_test.go | 9 --------- 1 file changed, 9 deletions(-) (limited to 'crypto') diff --git a/crypto/ecies/ecies_test.go b/crypto/ecies/ecies_test.go index 2836b8126..2def505d0 100644 --- a/crypto/ecies/ecies_test.go +++ b/crypto/ecies/ecies_test.go @@ -35,7 +35,6 @@ import ( "crypto/rand" "crypto/sha256" "encoding/hex" - "flag" "fmt" "math/big" "testing" @@ -43,14 +42,6 @@ import ( "github.com/ethereum/go-ethereum/crypto" ) -var dumpEnc bool - -func init() { - flDump := flag.Bool("dump", false, "write encrypted test message to file") - flag.Parse() - dumpEnc = *flDump -} - // Ensure the KDF generates appropriately sized keys. func TestKDF(t *testing.T) { msg := []byte("Hello, world") -- cgit v1.2.3