1
0
mirror of https://github.com/golang/go synced 2024-11-19 08:24:41 -07:00
go/src/run.bash
Rob Pike d406f8f650 testing: set up structure for faster testing using the new -test.short flag.
New make target "testshort" runs "gotest -test.short" and is invoked
by run.bash, which is invoked by all.bash.

Use -test.short to make one package (crypto ecdsa) run much faster.
More changes to come.

Once this is in, I will update the long-running tests to use the new flag.

R=rsc
CC=golang-dev
https://golang.org/cl/4317043
2011-03-25 14:50:44 -07:00

128 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/env bash
# 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
if [ "$1" = "--no-env" ]; then
# caller has already run env.bash
shift
else
. ./env.bash
fi
unset MAKEFLAGS # single-threaded make
unset CDPATH # in case user has it set
# no core files, please
ulimit -c 0
# allow make.bash to avoid double-build of everything
rebuild=true
if [ "$1" = "--no-rebuild" ]; then
rebuild=false
shift
fi
xcd() {
echo
echo --- cd $1
builtin cd "$GOROOT"/src/$1
}
if $rebuild; then
(xcd pkg
gomake clean
time gomake
gomake install
) || exit $i
fi
(xcd pkg
gomake testshort
) || exit $?
(xcd pkg/sync;
if $rebuild; then
gomake clean;
time gomake
fi
GOMAXPROCS=10 gomake testshort
) || exit $?
[ "$GOARCH" == arm ] ||
(xcd cmd/gofmt
if $rebuild; then
gomake clean;
time gomake
fi
time gomake smoketest
) || exit $?
(xcd cmd/ebnflint
if $rebuild; then
gomake clean;
time gomake
fi
time gomake test
) || exit $?
[ "$GOARCH" == arm ] ||
[ "$GOHOSTOS" == windows ] ||
(xcd ../misc/cgo/stdio
gomake clean
./test.bash
) || exit $?
[ "$GOARCH" == arm ] ||
[ "$GOHOSTOS" == windows ] ||
(xcd ../misc/cgo/life
gomake clean
./test.bash
) || exit $?
[ "$GOARCH" == arm ] ||
[ "$GOHOSTOS" == windows ] ||
(xcd ../misc/cgo/test
gomake clean
gotest
) || exit $?
(xcd pkg/exp/ogle
gomake clean
time gomake ogle
) || exit $?
[ "$GOHOSTOS" == windows ] ||
(xcd ../doc/progs
time ./run
) || exit $?
(xcd ../doc/codelab/wiki
gomake clean
gomake
gomake test
) || exit $?
for i in ../misc/dashboard/builder ../misc/goplay
do
(xcd $i
gomake clean
gomake
) || exit $?
done
[ "$GOARCH" == arm ] ||
[ "$GOHOSTOS" == windows ] ||
(xcd ../test/bench
./timing.sh -test
) || exit $?
[ "$GOHOSTOS" == windows ] ||
(xcd ../test
./run
) || exit $?
echo
echo ALL TESTS PASSED