1 #!/usr/bin/env bash
2 # Copyright 2009 The Go Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style
4 # license that can be found in the LICENSE file.
5
6 set -e
7 if [ "$1" = "--no-env" ]; then
8 # caller has already run env.bash
9 shift
10 else
11 . ./env.bash
12 fi
13
14 unset MAKEFLAGS # single-threaded make
15 unset CDPATH # in case user has it set
16
17 # no core files, please
18 ulimit -c 0
19
20 # allow make.bash to avoid double-build of everything
21 rebuild=true
22 if [ "$1" = "--no-rebuild" ]; then
23 rebuild=false
24 shift
25 fi
26
27 xcd() {
28 echo
29 echo --- cd $1
30 builtin cd "$GOROOT"/src/$1
31 }
32
33 if $rebuild; then
34 (xcd pkg
35 gomake clean
36 time gomake install
37 ) || exit $?
38 fi
39
40 (xcd pkg
41 gomake testshort
42 ) || exit $?
43
44 (xcd pkg/sync;
45 GOMAXPROCS=10 gomake testshort
46 ) || exit $?
47
48 (xcd cmd/ebnflint
49 time gomake test
50 ) || exit $?
51
52 [ "$CGO_ENABLED" != 1 ] ||
53 [ "$GOHOSTOS" == windows ] ||
54 (xcd ../misc/cgo/stdio
55 gomake clean
56 ./test.bash
57 ) || exit $?
58
59 [ "$CGO_ENABLED" != 1 ] ||
60 (xcd ../misc/cgo/life
61 gomake clean
62 ./test.bash
63 ) || exit $?
64
65 [ "$CGO_ENABLED" != 1 ] ||
66 [ "$GOHOSTOS" == windows ] ||
67 (xcd ../misc/cgo/test
68 gomake clean
69 gotest
70 ) || exit $?
71
72 (xcd ../doc/progs
73 time ./run
74 ) || exit $?
75
76 [ "$GOARCH" == arm ] || # uses network, fails under QEMU
77 (xcd ../doc/codelab/wiki
78 gomake clean
79 gomake
80 gomake test
81 ) || exit $?
82
83 for i in ../misc/dashboard/builder ../misc/goplay
84 do
85 (xcd $i
86 gomake clean
87 gomake
88 ) || exit $?
89 done
90
91 [ "$GOARCH" == arm ] ||
92 (xcd ../test/bench
93 ./timing.sh -test
94 ) || exit $?
95
96 [ "$GOHOSTOS" == windows ] ||
97 (xcd ../test
98 ./run
99 ) || exit $?
100
101 echo
102 echo ALL TESTS PASSED