summaryrefslogtreecommitdiff
path: root/src/run.bash
blob: d818751b2c68fd2a4a19e6df01964f287acae528 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/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

eval $(go tool dist env)

unset CDPATH	# in case user has it set

# no core files, please
ulimit -c 0

# allow all.bash to avoid double-build of everything
rebuild=true
if [ "$1" = "--no-rebuild" ]; then
	shift
else
	echo '# Building packages and commands.'
	time go install -a -v std
	echo
fi

echo '# Testing packages.'
time go test std -short -timeout=120s
echo

echo '# runtime -cpu=1,2,4'
go test runtime -short -timeout=120s -cpu=1,2,4
echo

echo '# sync -cpu=10'
go test sync -short -timeout=120s -cpu=10

xcd() {
	echo
	echo --- cd $1
	builtin cd "$GOROOT"/src/$1
}

BROKEN=true

$BROKEN ||
[ "$CGO_ENABLED" != 1 ] ||
[ "$GOHOSTOS" == windows ] ||
(xcd ../misc/cgo/stdio
"$GOMAKE" clean
./test.bash
) || exit $?

$BROKEN ||
[ "$CGO_ENABLED" != 1 ] ||
(xcd ../misc/cgo/life
"$GOMAKE" clean
./test.bash
) || exit $?

$BROKEN ||
[ "$CGO_ENABLED" != 1 ] ||
(xcd ../misc/cgo/test
"$GOMAKE" clean
gotest
) || exit $?

$BROKEN ||
[ "$CGO_ENABLED" != 1 ] ||
[ "$GOHOSTOS" == windows ] ||
[ "$GOHOSTOS" == darwin ] ||
(xcd ../misc/cgo/testso
"$GOMAKE" clean
./test.bash
) || exit $?

$BROKEN ||
(xcd ../doc/progs
time ./run
) || exit $?

$BROKEN ||
[ "$GOARCH" == arm ] ||  # uses network, fails under QEMU
(xcd ../doc/codelab/wiki
"$GOMAKE" clean
"$GOMAKE"
"$GOMAKE" test
) || exit $?

$BROKEN ||
for i in ../misc/dashboard/builder ../misc/goplay
do
	(xcd $i
	"$GOMAKE" clean
	"$GOMAKE"
	) || exit $?
done

$BROKEN ||
[ "$GOARCH" == arm ] ||
(xcd ../test/bench/shootout
./timing.sh -test
) || exit $?

$BROKEN ||
(xcd ../test/bench/go1
"$GOMAKE" test
) || exit $?

(xcd ../test
./run
) || exit $?

echo
echo ALL TESTS PASSED