blob: 0b37031c2bf0c64ceb220fb21125404ff5484d16 [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 Cox5014da72008-11-20 10:54:11 -080033maketest() {
34 for i
35 do
36 (
37 xcd $i
Russ Cox69fd2a42010-03-31 19:48:33 -070038 if $rebuild; then
39 "$GOBIN"/gomake clean
40 time "$GOBIN"/gomake
41 "$GOBIN"/gomake install
42 fi
Devon H. O'Dell857d4cf2009-12-11 15:14:09 -080043 "$GOBIN"/gomake test
Russ Cox5014da72008-11-20 10:54:11 -080044 ) || exit $?
45 done
46}
Russ Cox079c00a2008-11-17 12:34:03 -080047
Russ Cox5014da72008-11-20 10:54:11 -080048maketest \
Rob Piked90e7cb2009-06-09 09:53:44 -070049 pkg \
Rob Pike536b1f22008-10-23 17:13:34 -070050
Russ Cox5014da72008-11-20 10:54:11 -080051# all of these are subtly different
52# from what maketest does.
53
Rob Piked90e7cb2009-06-09 09:53:44 -070054(xcd pkg/sync;
Russ Cox69fd2a42010-03-31 19:48:33 -070055if $rebuild; then
56 "$GOBIN"/gomake clean;
57 time "$GOBIN"/gomake
58fi
Devon H. O'Dell857d4cf2009-12-11 15:14:09 -080059GOMAXPROCS=10 "$GOBIN"/gomake test
Russ Coxbf3dd3f2008-12-04 12:51:36 -080060) || exit $?
61
Robert Griesemerd8e44462009-06-16 12:03:32 -070062(xcd cmd/gofmt
Russ Cox69fd2a42010-03-31 19:48:33 -070063if $rebuild; then
64 "$GOBIN"/gomake clean;
65 time "$GOBIN"/gomake
66fi
Devon H. O'Dell857d4cf2009-12-11 15:14:09 -080067time "$GOBIN"/gomake smoketest
Rob Pikee8e894b2009-03-03 16:09:40 -080068) || exit $?
Rob Pike84523402008-10-14 22:16:45 -070069
Robert Griesemer7b7b83b2009-07-13 10:26:58 -070070(xcd cmd/ebnflint
Russ Cox69fd2a42010-03-31 19:48:33 -070071if $rebuild; then
72 "$GOBIN"/gomake clean;
73 time "$GOBIN"/gomake
74fi
Devon H. O'Dell857d4cf2009-12-11 15:14:09 -080075time "$GOBIN"/gomake test
Robert Griesemer7b7b83b2009-07-13 10:26:58 -070076) || exit $?
77
Russ Cox2d72b392009-10-03 11:33:51 -070078(xcd ../misc/cgo/stdio
Devon H. O'Dell857d4cf2009-12-11 15:14:09 -080079"$GOBIN"/gomake clean
Russ Cox168777d2009-10-03 15:02:11 -070080./test.bash
Russ Cox2d72b392009-10-03 11:33:51 -070081) || exit $?
82
Russ Cox2b7fde32009-10-14 18:10:43 -070083(xcd pkg/exp/ogle
Devon H. O'Dell857d4cf2009-12-11 15:14:09 -080084"$GOBIN"/gomake clean
85time "$GOBIN"/gomake ogle
Austin Clements3c8a1de2009-09-25 11:36:27 -070086) || exit $?
87
Rob Pike8d210042009-01-06 15:49:27 -080088(xcd ../doc/progs
Ken Thompsonb0f627a2009-01-06 17:31:24 -080089time ./run
Rob Pike8d210042009-01-06 15:49:27 -080090) || exit $?
91
Rob Pike266a2c42009-08-09 14:31:05 -070092(xcd ../test/bench
93./timing.sh -test
94) || exit $?
95
Russ Coxbbb00c62008-10-08 09:46:54 -070096(xcd ../test
97./run
Russ Cox527669e2008-10-29 15:23:29 -070098) || exit $?
Russ Coxbbb00c62008-10-08 09:46:54 -070099