Devon H. O'Dell | 553be84 | 2009-11-14 15:29:09 -0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Russ Cox | bbb00c6 | 2008-10-08 09:46:54 -0700 | [diff] [blame] | 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 |
Russ Cox | aafe474e | 2010-08-24 20:00:33 -0400 | [diff] [blame] | 7 | if [ "$1" = "--no-env" ]; then |
| 8 | # caller has already run env.bash |
| 9 | shift |
| 10 | else |
| 11 | . ./env.bash |
| 12 | fi |
Russ Cox | bbb00c6 | 2008-10-08 09:46:54 -0700 | [diff] [blame] | 13 | |
Russ Cox | 632417e | 2010-08-18 10:22:57 -0400 | [diff] [blame] | 14 | unset MAKEFLAGS # single-threaded make |
Russ Cox | 69fd2a4 | 2010-03-31 19:48:33 -0700 | [diff] [blame] | 15 | unset CDPATH # in case user has it set |
Devon H. O'Dell | 857d4cf | 2009-12-11 15:14:09 -0800 | [diff] [blame] | 16 | |
Russ Cox | da77679 | 2009-11-09 23:11:36 -0800 | [diff] [blame] | 17 | # no core files, please |
| 18 | ulimit -c 0 |
| 19 | |
Russ Cox | 69fd2a4 | 2010-03-31 19:48:33 -0700 | [diff] [blame] | 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 | |
Russ Cox | bbb00c6 | 2008-10-08 09:46:54 -0700 | [diff] [blame] | 27 | xcd() { |
Ken Thompson | b379d54 | 2008-10-24 20:14:28 -0700 | [diff] [blame] | 28 | echo |
Russ Cox | bbb00c6 | 2008-10-08 09:46:54 -0700 | [diff] [blame] | 29 | echo --- cd $1 |
Devon H. O'Dell | 857d4cf | 2009-12-11 15:14:09 -0800 | [diff] [blame] | 30 | builtin cd "$GOROOT"/src/$1 |
Russ Cox | bbb00c6 | 2008-10-08 09:46:54 -0700 | [diff] [blame] | 31 | } |
| 32 | |
Russ Cox | b9f9476 | 2011-02-14 09:27:02 -0500 | [diff] [blame] | 33 | if $rebuild; then |
| 34 | (xcd pkg |
| 35 | gomake clean |
| 36 | time gomake |
| 37 | gomake install |
| 38 | ) || exit $i |
| 39 | fi |
Russ Cox | 079c00a | 2008-11-17 12:34:03 -0800 | [diff] [blame] | 40 | |
Russ Cox | b9f9476 | 2011-02-14 09:27:02 -0500 | [diff] [blame] | 41 | (xcd pkg |
| 42 | gomake test |
| 43 | ) || exit $? |
Russ Cox | 5014da7 | 2008-11-20 10:54:11 -0800 | [diff] [blame] | 44 | |
Rob Pike | d90e7cb | 2009-06-09 09:53:44 -0700 | [diff] [blame] | 45 | (xcd pkg/sync; |
Russ Cox | 69fd2a4 | 2010-03-31 19:48:33 -0700 | [diff] [blame] | 46 | if $rebuild; then |
Christian Himpel | 5c603db | 2010-08-30 15:40:56 -0400 | [diff] [blame] | 47 | gomake clean; |
| 48 | time gomake |
Russ Cox | 69fd2a4 | 2010-03-31 19:48:33 -0700 | [diff] [blame] | 49 | fi |
Christian Himpel | 5c603db | 2010-08-30 15:40:56 -0400 | [diff] [blame] | 50 | GOMAXPROCS=10 gomake test |
Russ Cox | bf3dd3f | 2008-12-04 12:51:36 -0800 | [diff] [blame] | 51 | ) || exit $? |
| 52 | |
Russ Cox | b7cb844 | 2010-09-22 15:30:42 +1000 | [diff] [blame] | 53 | [ "$GOARCH" == arm ] || |
Robert Griesemer | d8e4446 | 2009-06-16 12:03:32 -0700 | [diff] [blame] | 54 | (xcd cmd/gofmt |
Russ Cox | 69fd2a4 | 2010-03-31 19:48:33 -0700 | [diff] [blame] | 55 | if $rebuild; then |
Christian Himpel | 5c603db | 2010-08-30 15:40:56 -0400 | [diff] [blame] | 56 | gomake clean; |
| 57 | time gomake |
Russ Cox | 69fd2a4 | 2010-03-31 19:48:33 -0700 | [diff] [blame] | 58 | fi |
Christian Himpel | 5c603db | 2010-08-30 15:40:56 -0400 | [diff] [blame] | 59 | time gomake smoketest |
Rob Pike | e8e894b | 2009-03-03 16:09:40 -0800 | [diff] [blame] | 60 | ) || exit $? |
Rob Pike | 8452340 | 2008-10-14 22:16:45 -0700 | [diff] [blame] | 61 | |
Robert Griesemer | 7b7b83b | 2009-07-13 10:26:58 -0700 | [diff] [blame] | 62 | (xcd cmd/ebnflint |
Russ Cox | 69fd2a4 | 2010-03-31 19:48:33 -0700 | [diff] [blame] | 63 | if $rebuild; then |
Christian Himpel | 5c603db | 2010-08-30 15:40:56 -0400 | [diff] [blame] | 64 | gomake clean; |
| 65 | time gomake |
Russ Cox | 69fd2a4 | 2010-03-31 19:48:33 -0700 | [diff] [blame] | 66 | fi |
Christian Himpel | 5c603db | 2010-08-30 15:40:56 -0400 | [diff] [blame] | 67 | time gomake test |
Robert Griesemer | 7b7b83b | 2009-07-13 10:26:58 -0700 | [diff] [blame] | 68 | ) || exit $? |
| 69 | |
Russ Cox | b7cb844 | 2010-09-22 15:30:42 +1000 | [diff] [blame] | 70 | [ "$GOARCH" == arm ] || |
Alex Brainman | 642c774 | 2011-02-09 12:37:08 +1100 | [diff] [blame] | 71 | [ "$GOHOSTOS" == windows ] || |
Russ Cox | 2d72b39 | 2009-10-03 11:33:51 -0700 | [diff] [blame] | 72 | (xcd ../misc/cgo/stdio |
Alex Brainman | 642c774 | 2011-02-09 12:37:08 +1100 | [diff] [blame] | 73 | gomake clean |
| 74 | ./test.bash |
Russ Cox | 2d72b39 | 2009-10-03 11:33:51 -0700 | [diff] [blame] | 75 | ) || exit $? |
| 76 | |
Russ Cox | 0cd3475 | 2010-12-17 09:51:55 -0800 | [diff] [blame] | 77 | [ "$GOARCH" == arm ] || |
Alex Brainman | 642c774 | 2011-02-09 12:37:08 +1100 | [diff] [blame] | 78 | [ "$GOHOSTOS" == windows ] || |
Russ Cox | 0cd3475 | 2010-12-17 09:51:55 -0800 | [diff] [blame] | 79 | (xcd ../misc/cgo/life |
Alex Brainman | 642c774 | 2011-02-09 12:37:08 +1100 | [diff] [blame] | 80 | gomake clean |
| 81 | ./test.bash |
Russ Cox | 0cd3475 | 2010-12-17 09:51:55 -0800 | [diff] [blame] | 82 | ) || exit $? |
| 83 | |
Russ Cox | 2b7fde3 | 2009-10-14 18:10:43 -0700 | [diff] [blame] | 84 | (xcd pkg/exp/ogle |
Christian Himpel | 5c603db | 2010-08-30 15:40:56 -0400 | [diff] [blame] | 85 | gomake clean |
| 86 | time gomake ogle |
Austin Clements | 3c8a1de | 2009-09-25 11:36:27 -0700 | [diff] [blame] | 87 | ) || exit $? |
| 88 | |
Alex Brainman | 642c774 | 2011-02-09 12:37:08 +1100 | [diff] [blame] | 89 | [ "$GOHOSTOS" == windows ] || |
Rob Pike | 8d21004 | 2009-01-06 15:49:27 -0800 | [diff] [blame] | 90 | (xcd ../doc/progs |
Alex Brainman | 642c774 | 2011-02-09 12:37:08 +1100 | [diff] [blame] | 91 | time ./run |
Rob Pike | 8d21004 | 2009-01-06 15:49:27 -0800 | [diff] [blame] | 92 | ) || exit $? |
| 93 | |
Alex Brainman | 642c774 | 2011-02-09 12:37:08 +1100 | [diff] [blame] | 94 | [ "$GOHOSTOS" == windows ] || |
Andrew Gerrand | add4e16 | 2011-01-26 14:56:52 +1000 | [diff] [blame] | 95 | (xcd ../doc/codelab/wiki |
Rob Pike | 6c03b0d | 2011-02-09 12:46:49 -0800 | [diff] [blame] | 96 | gomake clean |
| 97 | gomake |
Alex Brainman | 642c774 | 2011-02-09 12:37:08 +1100 | [diff] [blame] | 98 | gomake test |
Alex Brainman | 3bfd35b | 2011-01-31 15:58:44 +1100 | [diff] [blame] | 99 | ) || exit $? |
Andrew Gerrand | add4e16 | 2011-01-26 14:56:52 +1000 | [diff] [blame] | 100 | |
Andrew Gerrand | 06492d4 | 2010-10-21 10:46:10 +1100 | [diff] [blame] | 101 | for i in ../misc/dashboard/builder ../misc/goplay |
| 102 | do |
| 103 | (xcd $i |
| 104 | gomake clean |
| 105 | gomake |
| 106 | ) || exit $? |
| 107 | done |
| 108 | |
Russ Cox | b7cb844 | 2010-09-22 15:30:42 +1000 | [diff] [blame] | 109 | [ "$GOARCH" == arm ] || |
Alex Brainman | 642c774 | 2011-02-09 12:37:08 +1100 | [diff] [blame] | 110 | [ "$GOHOSTOS" == windows ] || |
Rob Pike | 266a2c4 | 2009-08-09 14:31:05 -0700 | [diff] [blame] | 111 | (xcd ../test/bench |
Alex Brainman | 642c774 | 2011-02-09 12:37:08 +1100 | [diff] [blame] | 112 | ./timing.sh -test |
Rob Pike | 266a2c4 | 2009-08-09 14:31:05 -0700 | [diff] [blame] | 113 | ) || exit $? |
| 114 | |
Alex Brainman | 642c774 | 2011-02-09 12:37:08 +1100 | [diff] [blame] | 115 | [ "$GOHOSTOS" == windows ] || |
Russ Cox | bbb00c6 | 2008-10-08 09:46:54 -0700 | [diff] [blame] | 116 | (xcd ../test |
Alex Brainman | 642c774 | 2011-02-09 12:37:08 +1100 | [diff] [blame] | 117 | ./run |
Russ Cox | 527669e | 2008-10-29 15:23:29 -0700 | [diff] [blame] | 118 | ) || exit $? |
Russ Cox | bbb00c6 | 2008-10-08 09:46:54 -0700 | [diff] [blame] | 119 | |
Russ Cox | b9f9476 | 2011-02-14 09:27:02 -0500 | [diff] [blame] | 120 | echo |
| 121 | echo ALL TESTS PASSED |