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