Commit a6a0ed3c authored by Russ Cox's avatar Russ Cox

misc/cgo: disable testcarchive, testplugin during -short test (including all.bash)

These tests take 20 seconds each to rebuild the entire world
in their respective modes. That's too much for short mode,
including all.bash on developer machines.

Keep doing it on builders and if someone runs 'go test' by hand
in that directory.

For #26473.

Change-Id: I3dc6955bc3aa7a20fd170efcde72a7d19b37bdbf
Reviewed-on: https://go-review.googlesource.com/c/go/+/177417
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 018d9b42
...@@ -8,6 +8,7 @@ import ( ...@@ -8,6 +8,7 @@ import (
"bufio" "bufio"
"bytes" "bytes"
"debug/elf" "debug/elf"
"flag"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"log" "log"
...@@ -36,6 +37,11 @@ var GOOS, GOARCH, GOPATH string ...@@ -36,6 +37,11 @@ var GOOS, GOARCH, GOPATH string
var libgodir string var libgodir string
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
flag.Parse()
if testing.Short() && os.Getenv("GO_BUILDER_NAME") == "" {
fmt.Printf("SKIP - short mode and $GO_BUILDER_NAME not set\n")
os.Exit(0)
}
log.SetFlags(log.Lshortfile) log.SetFlags(log.Lshortfile)
os.Exit(testMain(m)) os.Exit(testMain(m))
} }
......
...@@ -7,6 +7,7 @@ package cshared_test ...@@ -7,6 +7,7 @@ package cshared_test
import ( import (
"bytes" "bytes"
"debug/elf" "debug/elf"
"flag"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"log" "log"
...@@ -36,6 +37,11 @@ func TestMain(m *testing.M) { ...@@ -36,6 +37,11 @@ func TestMain(m *testing.M) {
func testMain(m *testing.M) int { func testMain(m *testing.M) int {
log.SetFlags(log.Lshortfile) log.SetFlags(log.Lshortfile)
flag.Parse()
if testing.Short() && os.Getenv("GO_BUILDER_NAME") == "" {
fmt.Printf("SKIP - short mode and $GO_BUILDER_NAME not set\n")
os.Exit(0)
}
GOOS = goEnv("GOOS") GOOS = goEnv("GOOS")
GOARCH = goEnv("GOARCH") GOARCH = goEnv("GOARCH")
......
...@@ -7,6 +7,7 @@ package plugin_test ...@@ -7,6 +7,7 @@ package plugin_test
import ( import (
"bytes" "bytes"
"context" "context"
"flag"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"log" "log"
...@@ -22,6 +23,11 @@ import ( ...@@ -22,6 +23,11 @@ import (
var gcflags string = os.Getenv("GO_GCFLAGS") var gcflags string = os.Getenv("GO_GCFLAGS")
func TestMain(m *testing.M) { func TestMain(m *testing.M) {
flag.Parse()
if testing.Short() && os.Getenv("GO_BUILDER_NAME") == "" {
fmt.Printf("SKIP - short mode and $GO_BUILDER_NAME not set\n")
os.Exit(0)
}
log.SetFlags(log.Lshortfile) log.SetFlags(log.Lshortfile)
os.Exit(testMain(m)) os.Exit(testMain(m))
} }
......
...@@ -991,7 +991,7 @@ func (t *tester) runHostTest(dir, pkg string) error { ...@@ -991,7 +991,7 @@ func (t *tester) runHostTest(dir, pkg string) error {
if err := cmd.Run(); err != nil { if err := cmd.Run(); err != nil {
return err return err
} }
return t.dirCmd(dir, "./test.test").Run() return t.dirCmd(dir, "./test.test", "-test.short").Run()
} }
func (t *tester) cgoTest(dt *distTest) error { func (t *tester) cgoTest(dt *distTest) error {
......
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