Commit f70f2778 authored by Russ Cox's avatar Russ Cox

cmd/dist: make test default to --no-rebuild

I'm tired of having to remember it on every command.
Rebuilding everything is the wrong default.

This CL updates the build script, but the builders may
(or may not) need work, depending on whether they
rebuild using the test command (I doubt it).

Change-Id: I21f202a2f13e73df3f6bd54ae6a317c467b68151
Reviewed-on: https://go-review.googlesource.com/18084Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 6766a293
......@@ -22,8 +22,10 @@ import (
func cmdtest() {
var t tester
var noRebuild bool
flag.BoolVar(&t.listMode, "list", false, "list available tests")
flag.BoolVar(&t.noRebuild, "no-rebuild", false, "don't rebuild std and cmd packages")
flag.BoolVar(&t.rebuild, "rebuild", false, "rebuild everything first")
flag.BoolVar(&noRebuild, "no-rebuild", false, "overrides -rebuild (historical dreg)")
flag.BoolVar(&t.keepGoing, "k", false, "keep going even when error occurred")
flag.BoolVar(&t.race, "race", false, "run in race builder mode (different set of tests)")
flag.StringVar(&t.banner, "banner", "##### ", "banner prefix; blank means no section banners")
......@@ -31,6 +33,9 @@ func cmdtest() {
"run only those tests matching the regular expression; empty means to run all. "+
"Special exception: if the string begins with '!', the match is inverted.")
xflagparse(-1) // any number of args
if noRebuild {
t.rebuild = false
}
t.run()
}
......@@ -38,7 +43,7 @@ func cmdtest() {
type tester struct {
race bool
listMode bool
noRebuild bool
rebuild bool
keepGoing bool
runRxStr string
runRx *regexp.Regexp
......@@ -97,7 +102,7 @@ func (t *tester) run() {
}
}
if !t.noRebuild {
if t.rebuild {
t.out("Building packages and commands.")
cmd := exec.Command("go", "install", "-a", "-v", "std", "cmd")
cmd.Stdout = os.Stdout
......
......@@ -41,4 +41,4 @@ if [ ! -f make.bash ]; then
fi
. ./make.bash --no-banner
go install -race std
go tool dist test -no-rebuild -race
go tool dist test -race
......@@ -34,7 +34,7 @@ echo # go install -race std
go install -race std
if errorlevel 1 goto fail
go tool dist test -no-rebuild -race
go tool dist test -race
if errorlevel 1 goto fail
goto succ
......
......@@ -35,4 +35,4 @@ if ulimit -T &> /dev/null; then
[ "$(ulimit -H -T)" == "unlimited" ] || ulimit -S -T $(ulimit -H -T)
fi
exec go tool dist test "$@"
exec go tool dist test -rebuild "$@"
......@@ -37,7 +37,7 @@ call env.bat
del env.bat
echo.
go tool dist test --no-rebuild
go tool dist test
if errorlevel 1 goto fail
echo.
......
......@@ -10,4 +10,4 @@ eval `{go env}
GOPATH = () # we disallow local import for non-local packages, if $GOROOT happens
# to be under $GOPATH, then some tests below will fail
exec go tool dist test $*
exec go tool dist test -rebuild $*
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