]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: make test default to --no-rebuild
authorRuss Cox <rsc@golang.org>
Sun, 20 Dec 2015 19:29:20 +0000 (14:29 -0500)
committerRuss Cox <rsc@golang.org>
Tue, 29 Dec 2015 15:20:00 +0000 (15:20 +0000)
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/18084
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/dist/test.go
src/race.bash
src/race.bat
src/run.bash
src/run.bat
src/run.rc

index f2b0796130370e123243090f8ed5f2eb4050a7a4..fc08cf7e694d296ebf2438a5d888bd553c168c56 100644 (file)
@@ -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
index e0917369f393f37ae3eee550e10fdddc1f6b3975..adf2297c2fd5b093f895af5522e7b9ea02e0e762 100755 (executable)
@@ -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
index 33db692878f8a79d0a2b85e7797e271d3c1c7b6b..e8df480811c88e1bf5c38f8cf16e4682c902d69b 100644 (file)
@@ -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
index f35ec789826ffa73eb0907248c2c9018662274da..3acf46a9961a2dcc4b889c156303ec1bf0f85648 100755 (executable)
@@ -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 "$@"
index 495711102e69a232912bb844fa4c0259affa0643..01a66bc574876aefd021e707a494620e853178e8 100644 (file)
@@ -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.
 
index d0ba866e7dd1e870527c71c577cb3d419a508a05..d314808f3f28a7c2b3c7001324921ee318404ee9 100755 (executable)
@@ -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 $*