2012-05-01 23:32:46 -06:00
|
|
|
#!/bin/rc -e
|
|
|
|
# Copyright 2012 The Go Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style
|
|
|
|
# license that can be found in the LICENSE file.
|
|
|
|
|
2013-02-26 10:25:46 -07:00
|
|
|
rfork e
|
|
|
|
|
|
|
|
eval `{go env}
|
|
|
|
|
2014-01-27 22:17:38 -07:00
|
|
|
GOPATH = () # we disallow local import for non-local packages, if $GOROOT happens
|
2013-02-26 10:25:46 -07:00
|
|
|
# to be under $GOPATH, then some tests below will fail
|
2012-05-01 23:32:46 -06:00
|
|
|
|
|
|
|
# allow all.rc to avoid double-build of everything
|
|
|
|
rebuild = true
|
|
|
|
if(~ $1 --no-rebuild)
|
|
|
|
shift
|
|
|
|
if not {
|
2013-02-26 10:25:46 -07:00
|
|
|
# Run only one process at a time on 9vx.
|
|
|
|
if(~ $sysname vx32)
|
|
|
|
pflag = (-p 1)
|
2012-05-01 23:32:46 -06:00
|
|
|
echo '# Building packages and commands.'
|
2015-02-22 10:41:32 -07:00
|
|
|
time go install -a -v $pflag std cmd
|
2012-05-01 23:32:46 -06:00
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
2013-02-26 10:25:46 -07:00
|
|
|
# we must unset GOROOT_FINAL before tests, because runtime/debug requires
|
|
|
|
# correct access to source code, so if we have GOROOT_FINAL in effect,
|
|
|
|
# at least runtime/debug test will fail.
|
|
|
|
GOROOT_FINAL = ()
|
|
|
|
|
2012-05-01 23:32:46 -06:00
|
|
|
echo '# Testing packages.'
|
2015-02-27 09:51:25 -07:00
|
|
|
time go test std cmd -short -timeout 120s
|
2012-05-01 23:32:46 -06:00
|
|
|
echo
|
|
|
|
|
2015-01-07 21:10:32 -07:00
|
|
|
# Temporary GCE builder hack until Plan 9 on GCE is fast enough.
|
|
|
|
# See https://golang.org/issue/9491
|
|
|
|
if(~ $GOTESTONLY std) {
|
|
|
|
echo
|
|
|
|
echo PARTIAL TESTS PASSED: std
|
|
|
|
exit
|
|
|
|
}
|
|
|
|
|
2014-03-06 02:16:14 -07:00
|
|
|
# We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code,
|
|
|
|
# creation of first goroutines and first garbage collections in the parallel setting.
|
2012-05-01 23:32:46 -06:00
|
|
|
echo '# GOMAXPROCS=2 runtime -cpu=1,2,4'
|
2015-02-27 09:51:25 -07:00
|
|
|
GOMAXPROCS=2 go test runtime -short -timeout 240s -cpu 1,2,4
|
2012-05-01 23:32:46 -06:00
|
|
|
echo
|
|
|
|
|
|
|
|
echo '# sync -cpu=10'
|
|
|
|
go test sync -short -timeout 120s -cpu 10
|
|
|
|
echo
|
|
|
|
|
|
|
|
fn xcd {
|
|
|
|
echo
|
|
|
|
echo '#' $1
|
|
|
|
cd $"GOROOT/src/$1
|
|
|
|
}
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo '#' ../test/bench/go1
|
|
|
|
go test ../test/bench/go1
|
|
|
|
|
|
|
|
@{
|
|
|
|
xcd ../test
|
2014-07-20 04:14:53 -06:00
|
|
|
GOMAXPROCS='' time go run run.go -v
|
2012-05-01 23:32:46 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo ALL TESTS PASSED
|