summaryrefslogtreecommitdiff
path: root/src/run.bash
blob: 4eb4a476b5a3c3a73148ccce239b39cda88923ca (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
#!/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
. ./env.bash

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
}

maketest() {
	for i
	do
		(
			xcd $i
			if $rebuild; then
				"$GOBIN"/gomake clean
				time "$GOBIN"/gomake
				"$GOBIN"/gomake install
			fi
			"$GOBIN"/gomake test
		) || exit $?
	done
}

maketest \
	pkg \

# all of these are subtly different
# from what maketest does.

(xcd pkg/sync;
if $rebuild; then
	"$GOBIN"/gomake clean;
	time "$GOBIN"/gomake
fi
GOMAXPROCS=10 "$GOBIN"/gomake test
) || exit $?

(xcd cmd/gofmt
if $rebuild; then
	"$GOBIN"/gomake clean;
	time "$GOBIN"/gomake
fi
time "$GOBIN"/gomake smoketest
) || exit $?

(xcd cmd/ebnflint
if $rebuild; then
	"$GOBIN"/gomake clean;
	time "$GOBIN"/gomake
fi
time "$GOBIN"/gomake test
) || exit $?

(xcd ../misc/cgo/stdio
"$GOBIN"/gomake clean
./test.bash
) || exit $?

(xcd pkg/exp/ogle
"$GOBIN"/gomake clean
time "$GOBIN"/gomake ogle
) || exit $?

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

(xcd ../test/bench
./timing.sh -test
) || exit $?

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