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
|
|
|
|
echo --- cd $1
|
|
|
|
builtin cd "$GOROOT"/src/$1
|
|
|
|
}
|
2012-01-30 21:43:46 -07:00
|
|
|
|
|
|
|
BROKEN=true
|
2009-07-13 11:26:58 -06:00
|
|
|
|
2012-01-30 21:43:46 -07:00
|
|
|
$BROKEN ||
|
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
|
2012-01-30 21:43:46 -07:00
|
|
|
"$GOMAKE" clean
|
2011-02-08 18:37:08 -07:00
|
|
|
./test.bash
|
2009-10-03 12:33:51 -06:00
|
|
|
) || exit $?
|
|
|
|
|
2012-01-30 21:43:46 -07:00
|
|
|
$BROKEN ||
|
2011-08-10 19:36:48 -06:00
|
|
|
[ "$CGO_ENABLED" != 1 ] ||
|
2010-12-17 10:51:55 -07:00
|
|
|
(xcd ../misc/cgo/life
|
2012-01-30 21:43:46 -07:00
|
|
|
"$GOMAKE" clean
|
2011-02-08 18:37:08 -07:00
|
|
|
./test.bash
|
2010-12-17 10:51:55 -07:00
|
|
|
) || exit $?
|
|
|
|
|
2012-01-30 21:43:46 -07:00
|
|
|
$BROKEN ||
|
2011-08-10 19:36:48 -06:00
|
|
|
[ "$CGO_ENABLED" != 1 ] ||
|
2011-03-11 13:09:32 -07:00
|
|
|
(xcd ../misc/cgo/test
|
2012-01-30 21:43:46 -07:00
|
|
|
"$GOMAKE" clean
|
|
|
|
gotest
|
2011-03-11 13:09:32 -07:00
|
|
|
) || exit $?
|
|
|
|
|
2012-01-30 21:43:46 -07:00
|
|
|
$BROKEN ||
|
2011-11-22 07:57:49 -07:00
|
|
|
[ "$CGO_ENABLED" != 1 ] ||
|
|
|
|
[ "$GOHOSTOS" == windows ] ||
|
|
|
|
[ "$GOHOSTOS" == darwin ] ||
|
|
|
|
(xcd ../misc/cgo/testso
|
2012-01-30 21:43:46 -07:00
|
|
|
"$GOMAKE" clean
|
2011-12-08 17:00:49 -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 $?
|
|
|
|
|
2012-01-30 21:43:46 -07:00
|
|
|
$BROKEN ||
|
2011-03-27 21:39:42 -06:00
|
|
|
[ "$GOARCH" == arm ] || # uses network, fails under QEMU
|
2011-01-25 21:56:52 -07:00
|
|
|
(xcd ../doc/codelab/wiki
|
2012-01-30 21:43:46 -07:00
|
|
|
"$GOMAKE" clean
|
|
|
|
"$GOMAKE"
|
|
|
|
"$GOMAKE" test
|
2011-01-30 21:58:44 -07:00
|
|
|
) || exit $?
|
2011-01-25 21:56:52 -07:00
|
|
|
|
2012-01-30 21:43:46 -07:00
|
|
|
$BROKEN ||
|
2010-10-20 17:46:10 -06:00
|
|
|
for i in ../misc/dashboard/builder ../misc/goplay
|
|
|
|
do
|
|
|
|
(xcd $i
|
2012-01-30 21:43:46 -07:00
|
|
|
"$GOMAKE" clean
|
|
|
|
"$GOMAKE"
|
2010-10-20 17:46:10 -06:00
|
|
|
) || exit $?
|
|
|
|
done
|
|
|
|
|
2012-01-30 21:43:46 -07:00
|
|
|
$BROKEN ||
|
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-01-30 21:43:46 -07:00
|
|
|
$BROKEN ||
|
2011-12-15 10:32:59 -07:00
|
|
|
(xcd ../test/bench/go1
|
2012-01-30 21:43:46 -07:00
|
|
|
"$GOMAKE" test
|
2011-12-15 10:32:59 -07:00
|
|
|
) || exit $?
|
|
|
|
|
2008-10-08 10:46:54 -06:00
|
|
|
(xcd ../test
|
2011-02-08 18:37:08 -07:00
|
|
|
./run
|
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
|