2009-11-14 16:29:09 -07:00
|
|
|
#!/usr/bin/env bash
|
2008-10-08 10:46:54 -06:00
|
|
|
# Copyright 2009 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.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2012-02-13 20:31:51 -07:00
|
|
|
eval $(go tool dist env)
|
2012-02-03 22:54:08 -07:00
|
|
|
|
2010-03-31 20:48:33 -06:00
|
|
|
unset CDPATH # in case user has it set
|
2009-12-11 16:14:09 -07:00
|
|
|
|
2009-11-10 00:11:36 -07:00
|
|
|
# no core files, please
|
|
|
|
ulimit -c 0
|
|
|
|
|
2012-02-03 22:54:08 -07:00
|
|
|
# allow all.bash to avoid double-build of everything
|
2010-03-31 20:48:33 -06:00
|
|
|
rebuild=true
|
|
|
|
if [ "$1" = "--no-rebuild" ]; then
|
|
|
|
shift
|
2012-02-03 22:54:08 -07:00
|
|
|
else
|
|
|
|
echo '# Building packages and commands.'
|
2012-01-30 21:43:46 -07:00
|
|
|
time go install -a -v std
|
2012-02-03 22:54:08 -07:00
|
|
|
echo
|
2011-02-14 07:27:02 -07:00
|
|
|
fi
|
2008-11-20 11:54:11 -07:00
|
|
|
|
2012-02-03 22:54:08 -07:00
|
|
|
echo '# Testing packages.'
|
2012-02-02 22:45:51 -07:00
|
|
|
time go test std -short -timeout=120s
|
2012-01-30 21:43:46 -07:00
|
|
|
echo
|
2012-02-03 22:54:08 -07:00
|
|
|
|
2012-03-05 14:40:27 -07:00
|
|
|
echo '# GOMAXPROCS=2 runtime -cpu=1,2,4'
|
|
|
|
GOMAXPROCS=2 go test runtime -short -timeout=120s -cpu=1,2,4
|
2012-01-30 21:43:46 -07:00
|
|
|
echo
|
2012-02-03 22:54:08 -07:00
|
|
|
|
2012-01-30 21:43:46 -07:00
|
|
|
echo '# sync -cpu=10'
|
2012-02-02 22:45:51 -07:00
|
|
|
go test sync -short -timeout=120s -cpu=10
|
2008-12-04 13:51:36 -07:00
|
|
|
|
2012-02-03 22:54:08 -07:00
|
|
|
xcd() {
|
|
|
|
echo
|
2012-03-06 21:27:30 -07:00
|
|
|
echo '#' $1
|
2012-02-03 22:54:08 -07:00
|
|
|
builtin cd "$GOROOT"/src/$1
|
|
|
|
}
|
2012-01-30 21:43:46 -07:00
|
|
|
|
2011-08-10 19:36:48 -06:00
|
|
|
[ "$CGO_ENABLED" != 1 ] ||
|
2011-02-08 18:37:08 -07:00
|
|
|
[ "$GOHOSTOS" == windows ] ||
|
2009-10-03 12:33:51 -06:00
|
|
|
(xcd ../misc/cgo/stdio
|
2011-02-08 18:37:08 -07:00
|
|
|
./test.bash
|
2009-10-03 12:33:51 -06:00
|
|
|
) || exit $?
|
|
|
|
|
2011-08-10 19:36:48 -06:00
|
|
|
[ "$CGO_ENABLED" != 1 ] ||
|
2010-12-17 10:51:55 -07:00
|
|
|
(xcd ../misc/cgo/life
|
2011-02-08 18:37:08 -07:00
|
|
|
./test.bash
|
2010-12-17 10:51:55 -07:00
|
|
|
) || exit $?
|
|
|
|
|
2011-08-10 19:36:48 -06:00
|
|
|
[ "$CGO_ENABLED" != 1 ] ||
|
2011-03-11 13:09:32 -07:00
|
|
|
(xcd ../misc/cgo/test
|
2012-03-06 21:27:30 -07:00
|
|
|
go test
|
2011-03-11 13:09:32 -07:00
|
|
|
) || exit $?
|
|
|
|
|
2011-11-22 07:57:49 -07:00
|
|
|
[ "$CGO_ENABLED" != 1 ] ||
|
|
|
|
[ "$GOHOSTOS" == windows ] ||
|
2012-03-07 08:15:20 -07:00
|
|
|
[ "$GOHOSTOS" == darwin ] ||
|
2011-11-22 07:57:49 -07:00
|
|
|
(xcd ../misc/cgo/testso
|
2012-03-07 08:15:20 -07:00
|
|
|
./test.bash
|
2011-11-22 07:57:49 -07:00
|
|
|
) || exit $?
|
|
|
|
|
2009-01-06 16:49:27 -07:00
|
|
|
(xcd ../doc/progs
|
2011-02-08 18:37:08 -07:00
|
|
|
time ./run
|
2009-01-06 16:49:27 -07:00
|
|
|
) || exit $?
|
|
|
|
|
2011-03-27 21:39:42 -06:00
|
|
|
[ "$GOARCH" == arm ] || # uses network, fails under QEMU
|
2012-03-07 15:23:56 -07:00
|
|
|
(xcd ../doc/articles/wiki
|
|
|
|
make clean
|
2012-03-07 20:04:49 -07:00
|
|
|
./test.bash
|
2011-01-30 21:58:44 -07:00
|
|
|
) || exit $?
|
2011-01-25 21:56:52 -07:00
|
|
|
|
2012-03-07 15:23:56 -07:00
|
|
|
echo
|
|
|
|
echo '#' ../misc/dashboard/builder ../misc/goplay
|
|
|
|
go build ../misc/dashboard/builder ../misc/goplay || exit $?
|
2010-10-20 17:46:10 -06:00
|
|
|
|
2010-09-21 23:30:42 -06:00
|
|
|
[ "$GOARCH" == arm ] ||
|
2011-12-13 15:46:54 -07:00
|
|
|
(xcd ../test/bench/shootout
|
2011-02-08 18:37:08 -07:00
|
|
|
./timing.sh -test
|
2009-08-09 15:31:05 -06:00
|
|
|
) || exit $?
|
|
|
|
|
2012-03-07 15:23:56 -07:00
|
|
|
echo
|
|
|
|
echo '#' ../test/bench/go1
|
|
|
|
go test ../test/bench/go1 || exit $?
|
2011-12-15 10:32:59 -07:00
|
|
|
|
2008-10-08 10:46:54 -06:00
|
|
|
(xcd ../test
|
2012-03-05 20:47:23 -07:00
|
|
|
time go run run.go
|
2008-10-29 16:23:29 -06:00
|
|
|
) || exit $?
|
2008-10-08 10:46:54 -06:00
|
|
|
|
2011-02-14 07:27:02 -07:00
|
|
|
echo
|
|
|
|
echo ALL TESTS PASSED
|