These don't use any flags in TestMain itself, so the call is redundant
as M.Run will do it.
Change-Id: I00f2ac7f846dc2c3ad3535eb8177616b2d900149
Reviewed-on: https://go-review.googlesource.com/33275
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
import (
"bytes"
- "flag"
"fmt"
"go/build"
"go/format"
// The TestMain function creates a go command for testing purposes and
// deletes it after the tests have been run.
func TestMain(m *testing.M) {
- flag.Parse()
-
if canRun {
args := []string{"build", "-tags", "testgo", "-o", "testgo" + exeSuffix}
if race.Enabled {
var tmp, exe string // populated by buildObjdump
func TestMain(m *testing.M) {
- flag.Parse()
if !testenv.HasGoBuild() {
return
}
import (
"bytes"
- "flag"
"fmt"
"internal/testenv"
"os"
// We implement TestMain so remove the test binary when all is done.
func TestMain(m *testing.M) {
- flag.Parse()
result := m.Run()
os.Remove(binary)
os.Exit(result)