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
|
2010-08-24 20:00:33 -04:00
|
|
|
if [ "$1" = "--no-env" ]; then
|
|
|
|
|
# caller has already run env.bash
|
|
|
|
|
shift
|
|
|
|
|
else
|
|
|
|
|
. ./env.bash
|
|
|
|
|
fi
|
2008-10-08 09:46:54 -07:00
|
|
|
|
2010-08-18 10:22:57 -04:00
|
|
|
unset MAKEFLAGS # single-threaded make
|
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
|
|
|
|
|
|
2010-03-31 19:48:33 -07:00
|
|
|
# allow make.bash to avoid double-build of everything
|
|
|
|
|
rebuild=true
|
|
|
|
|
if [ "$1" = "--no-rebuild" ]; then
|
|
|
|
|
rebuild=false
|
|
|
|
|
shift
|
|
|
|
|
fi
|
|
|
|
|
|
2008-10-08 09:46:54 -07:00
|
|
|
xcd() {
|
2008-10-24 20:14:28 -07:00
|
|
|
echo
|
2008-10-08 09:46:54 -07:00
|
|
|
echo --- cd $1
|
2009-12-11 15:14:09 -08:00
|
|
|
builtin cd "$GOROOT"/src/$1
|
2008-10-08 09:46:54 -07:00
|
|
|
}
|
|
|
|
|
|
2011-02-14 09:27:02 -05:00
|
|
|
if $rebuild; then
|
2011-12-20 16:50:13 -05:00
|
|
|
if $USE_GO_TOOL; then
|
|
|
|
|
echo
|
|
|
|
|
echo '# Package builds'
|
2012-01-09 16:44:01 -08:00
|
|
|
time go install -a -v std
|
2011-12-20 16:50:13 -05:00
|
|
|
else
|
|
|
|
|
(xcd pkg
|
|
|
|
|
gomake clean
|
|
|
|
|
time gomake install
|
|
|
|
|
) || exit $?
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if $USE_GO_TOOL; then
|
|
|
|
|
echo
|
|
|
|
|
echo '# Package tests'
|
2011-12-21 07:47:12 -05:00
|
|
|
time go test std -short
|
2011-12-20 16:50:13 -05:00
|
|
|
else
|
2011-02-14 09:27:02 -05:00
|
|
|
(xcd pkg
|
2011-12-20 16:50:13 -05:00
|
|
|
gomake testshort
|
2011-06-30 09:44:16 +10:00
|
|
|
) || exit $?
|
2011-02-14 09:27:02 -05:00
|
|
|
fi
|
2008-11-20 10:54:11 -08:00
|
|
|
|
2011-12-20 16:50:13 -05:00
|
|
|
if $USE_GO_TOOL; then
|
|
|
|
|
echo
|
|
|
|
|
echo '# runtime -cpu=1,2,4'
|
|
|
|
|
go test runtime -short -cpu=1,2,4
|
|
|
|
|
else
|
|
|
|
|
(xcd pkg/runtime;
|
2012-01-30 14:46:31 -08:00
|
|
|
go test -short -cpu=1,2,4
|
2011-12-20 16:50:13 -05:00
|
|
|
) || exit $?
|
|
|
|
|
fi
|
2008-10-23 17:13:34 -07:00
|
|
|
|
2011-12-20 16:50:13 -05:00
|
|
|
if $USE_GO_TOOL; then
|
|
|
|
|
echo
|
|
|
|
|
echo '# sync -cpu=10'
|
|
|
|
|
go test sync -short -cpu=10
|
|
|
|
|
else
|
|
|
|
|
(xcd pkg/sync;
|
|
|
|
|
GOMAXPROCS=10 gomake testshort
|
|
|
|
|
) || exit $?
|
|
|
|
|
fi
|
2011-10-12 13:23:34 -04:00
|
|
|
|
2011-12-20 16:50:13 -05:00
|
|
|
if $USE_GO_TOOL; then
|
|
|
|
|
echo
|
|
|
|
|
echo '# Build bootstrap scripts'
|
|
|
|
|
./buildscript.sh
|
|
|
|
|
fi
|
2008-12-04 12:51:36 -08:00
|
|
|
|
2011-10-11 17:43:10 -07:00
|
|
|
(xcd pkg/exp/ebnflint
|
2010-08-30 15:40:56 -04:00
|
|
|
time gomake test
|
2009-07-13 10:26:58 -07:00
|
|
|
) || exit $?
|
|
|
|
|
|
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
|
|
|
gomake clean
|
|
|
|
|
./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
|
|
|
gomake clean
|
|
|
|
|
./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
|
|
|
|
|
gomake clean
|
2012-01-30 15:34:34 -08:00
|
|
|
gomake test
|
2011-03-11 15:09:32 -05:00
|
|
|
) || exit $?
|
|
|
|
|
|
2011-11-22 17:57:49 +03:00
|
|
|
[ "$CGO_ENABLED" != 1 ] ||
|
|
|
|
|
[ "$GOHOSTOS" == windows ] ||
|
|
|
|
|
[ "$GOHOSTOS" == darwin ] ||
|
|
|
|
|
(xcd ../misc/cgo/testso
|
|
|
|
|
gomake clean
|
2011-12-09 11:00:49 +11: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
|
2011-01-26 14:56:52 +10:00
|
|
|
(xcd ../doc/codelab/wiki
|
2011-02-09 12:46:49 -08:00
|
|
|
gomake clean
|
|
|
|
|
gomake
|
2011-02-09 12:37:08 +11:00
|
|
|
gomake test
|
2011-01-31 15:58:44 +11:00
|
|
|
) || exit $?
|
2011-01-26 14:56:52 +10:00
|
|
|
|
2010-10-21 10:46:10 +11:00
|
|
|
for i in ../misc/dashboard/builder ../misc/goplay
|
|
|
|
|
do
|
|
|
|
|
(xcd $i
|
|
|
|
|
gomake clean
|
|
|
|
|
gomake
|
|
|
|
|
) || exit $?
|
|
|
|
|
done
|
|
|
|
|
|
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 $?
|
|
|
|
|
|
2011-12-15 12:32:59 -05:00
|
|
|
(xcd ../test/bench/go1
|
|
|
|
|
gomake test
|
|
|
|
|
) || exit $?
|
|
|
|
|
|
2008-10-08 09:46:54 -07:00
|
|
|
(xcd ../test
|
2011-02-09 12:37:08 +11:00
|
|
|
./run
|
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
|