blob: a3e90cc4f830e6fa79ee13bcea1f5091bf26fbc9 [file] [log] [blame]
Devon H. O'Dell553be842009-11-14 15:29:09 -08001#!/usr/bin/env bash
Russ Coxbbb00c62008-10-08 09:46:54 -07002# 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
6set -e
Russ Coxaafe474e2010-08-24 20:00:33 -04007if [ "$1" = "--no-env" ]; then
8 # caller has already run env.bash
9 shift
10else
11 . ./env.bash
12fi
Russ Coxbbb00c62008-10-08 09:46:54 -070013
Russ Cox632417e2010-08-18 10:22:57 -040014unset MAKEFLAGS # single-threaded make
Russ Cox69fd2a42010-03-31 19:48:33 -070015unset CDPATH # in case user has it set
Devon H. O'Dell857d4cf2009-12-11 15:14:09 -080016
Russ Coxda776792009-11-09 23:11:36 -080017# no core files, please
18ulimit -c 0
19
Russ Cox69fd2a42010-03-31 19:48:33 -070020# allow make.bash to avoid double-build of everything
21rebuild=true
22if [ "$1" = "--no-rebuild" ]; then
23 rebuild=false
24 shift
25fi
26
Russ Coxbbb00c62008-10-08 09:46:54 -070027xcd() {
Ken Thompsonb379d542008-10-24 20:14:28 -070028 echo
Russ Coxbbb00c62008-10-08 09:46:54 -070029 echo --- cd $1
Devon H. O'Dell857d4cf2009-12-11 15:14:09 -080030 builtin cd "$GOROOT"/src/$1
Russ Coxbbb00c62008-10-08 09:46:54 -070031}
32
Russ Coxb9f94762011-02-14 09:27:02 -050033if $rebuild; then
34 (xcd pkg
35 gomake clean
36 time gomake
37 gomake install
38 ) || exit $i
39fi
Russ Cox079c00a2008-11-17 12:34:03 -080040
Russ Coxb9f94762011-02-14 09:27:02 -050041(xcd pkg
42gomake test
43) || exit $?
Russ Cox5014da72008-11-20 10:54:11 -080044
Rob Piked90e7cb2009-06-09 09:53:44 -070045(xcd pkg/sync;
Russ Cox69fd2a42010-03-31 19:48:33 -070046if $rebuild; then
Christian Himpel5c603db2010-08-30 15:40:56 -040047 gomake clean;
48 time gomake
Russ Cox69fd2a42010-03-31 19:48:33 -070049fi
Christian Himpel5c603db2010-08-30 15:40:56 -040050GOMAXPROCS=10 gomake test
Russ Coxbf3dd3f2008-12-04 12:51:36 -080051) || exit $?
52
Russ Coxb7cb8442010-09-22 15:30:42 +100053[ "$GOARCH" == arm ] ||
Robert Griesemerd8e44462009-06-16 12:03:32 -070054(xcd cmd/gofmt
Russ Cox69fd2a42010-03-31 19:48:33 -070055if $rebuild; then
Christian Himpel5c603db2010-08-30 15:40:56 -040056 gomake clean;
57 time gomake
Russ Cox69fd2a42010-03-31 19:48:33 -070058fi
Christian Himpel5c603db2010-08-30 15:40:56 -040059time gomake smoketest
Rob Pikee8e894b2009-03-03 16:09:40 -080060) || exit $?
Rob Pike84523402008-10-14 22:16:45 -070061
Robert Griesemer7b7b83b2009-07-13 10:26:58 -070062(xcd cmd/ebnflint
Russ Cox69fd2a42010-03-31 19:48:33 -070063if $rebuild; then
Christian Himpel5c603db2010-08-30 15:40:56 -040064 gomake clean;
65 time gomake
Russ Cox69fd2a42010-03-31 19:48:33 -070066fi
Christian Himpel5c603db2010-08-30 15:40:56 -040067time gomake test
Robert Griesemer7b7b83b2009-07-13 10:26:58 -070068) || exit $?
69
Russ Coxb7cb8442010-09-22 15:30:42 +100070[ "$GOARCH" == arm ] ||
Alex Brainman642c7742011-02-09 12:37:08 +110071[ "$GOHOSTOS" == windows ] ||
Russ Cox2d72b392009-10-03 11:33:51 -070072(xcd ../misc/cgo/stdio
Alex Brainman642c7742011-02-09 12:37:08 +110073gomake clean
74./test.bash
Russ Cox2d72b392009-10-03 11:33:51 -070075) || exit $?
76
Russ Cox0cd34752010-12-17 09:51:55 -080077[ "$GOARCH" == arm ] ||
Alex Brainman642c7742011-02-09 12:37:08 +110078[ "$GOHOSTOS" == windows ] ||
Russ Cox0cd34752010-12-17 09:51:55 -080079(xcd ../misc/cgo/life
Alex Brainman642c7742011-02-09 12:37:08 +110080gomake clean
81./test.bash
Russ Cox0cd34752010-12-17 09:51:55 -080082) || exit $?
83
Russ Cox2b7fde32009-10-14 18:10:43 -070084(xcd pkg/exp/ogle
Christian Himpel5c603db2010-08-30 15:40:56 -040085gomake clean
86time gomake ogle
Austin Clements3c8a1de2009-09-25 11:36:27 -070087) || exit $?
88
Alex Brainman642c7742011-02-09 12:37:08 +110089[ "$GOHOSTOS" == windows ] ||
Rob Pike8d210042009-01-06 15:49:27 -080090(xcd ../doc/progs
Alex Brainman642c7742011-02-09 12:37:08 +110091time ./run
Rob Pike8d210042009-01-06 15:49:27 -080092) || exit $?
93
Alex Brainman642c7742011-02-09 12:37:08 +110094[ "$GOHOSTOS" == windows ] ||
Andrew Gerrandadd4e162011-01-26 14:56:52 +100095(xcd ../doc/codelab/wiki
Rob Pike6c03b0d2011-02-09 12:46:49 -080096gomake clean
97gomake
Alex Brainman642c7742011-02-09 12:37:08 +110098gomake test
Alex Brainman3bfd35b2011-01-31 15:58:44 +110099) || exit $?
Andrew Gerrandadd4e162011-01-26 14:56:52 +1000100
Andrew Gerrand06492d42010-10-21 10:46:10 +1100101for i in ../misc/dashboard/builder ../misc/goplay
102do
103 (xcd $i
104 gomake clean
105 gomake
106 ) || exit $?
107done
108
Russ Coxb7cb8442010-09-22 15:30:42 +1000109[ "$GOARCH" == arm ] ||
Alex Brainman642c7742011-02-09 12:37:08 +1100110[ "$GOHOSTOS" == windows ] ||
Rob Pike266a2c42009-08-09 14:31:05 -0700111(xcd ../test/bench
Alex Brainman642c7742011-02-09 12:37:08 +1100112./timing.sh -test
Rob Pike266a2c42009-08-09 14:31:05 -0700113) || exit $?
114
Alex Brainman642c7742011-02-09 12:37:08 +1100115[ "$GOHOSTOS" == windows ] ||
Russ Coxbbb00c62008-10-08 09:46:54 -0700116(xcd ../test
Alex Brainman642c7742011-02-09 12:37:08 +1100117./run
Russ Cox527669e2008-10-29 15:23:29 -0700118) || exit $?
Russ Coxbbb00c62008-10-08 09:46:54 -0700119
Russ Coxb9f94762011-02-14 09:27:02 -0500120echo
121echo ALL TESTS PASSED