blob: 8d2ce38a0e790fc38cca6e358d4b5278440c571c [file] [log] [blame]
Anthony Martin38590322012-05-01 22:32:46 -07001#!/bin/rc -e
2# Copyright 2012 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
Anthony Martinf08acae2013-02-26 09:25:46 -08006rfork e
7
8eval `{go env}
9
David du Colombier610dc922014-01-28 06:17:38 +010010GOPATH = () # we disallow local import for non-local packages, if $GOROOT happens
Anthony Martinf08acae2013-02-26 09:25:46 -080011 # to be under $GOPATH, then some tests below will fail
Anthony Martin38590322012-05-01 22:32:46 -070012
13# allow all.rc to avoid double-build of everything
14rebuild = true
15if(~ $1 --no-rebuild)
16 shift
17if not {
Anthony Martinf08acae2013-02-26 09:25:46 -080018 # Run only one process at a time on 9vx.
19 if(~ $sysname vx32)
20 pflag = (-p 1)
Anthony Martin38590322012-05-01 22:32:46 -070021 echo '# Building packages and commands.'
Anthony Martinf08acae2013-02-26 09:25:46 -080022 time go install -a -v $pflag std
Anthony Martin38590322012-05-01 22:32:46 -070023 echo
24}
25
Anthony Martinf08acae2013-02-26 09:25:46 -080026# we must unset GOROOT_FINAL before tests, because runtime/debug requires
27# correct access to source code, so if we have GOROOT_FINAL in effect,
28# at least runtime/debug test will fail.
29GOROOT_FINAL = ()
30
Anthony Martin38590322012-05-01 22:32:46 -070031echo '# Testing packages.'
David du Colombier8c69ce02015-01-07 23:32:34 +010032time go test std -short -timeout 240s
Anthony Martin38590322012-05-01 22:32:46 -070033echo
34
Brad Fitzpatrickabb2aa22015-01-07 20:10:32 -080035# Temporary GCE builder hack until Plan 9 on GCE is fast enough.
36# See https://golang.org/issue/9491
37if(~ $GOTESTONLY std) {
38 echo
39 echo PARTIAL TESTS PASSED: std
40 exit
41}
42
Dmitriy Vyukov13045842014-03-06 13:16:14 +040043# We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code,
44# creation of first goroutines and first garbage collections in the parallel setting.
Brad Fitzpatricke16ab382015-01-07 17:05:51 -080045# TODO(bradfitz,0intro): make this not be 15 minutes once Plan 9 runs quickly on GCE.
46# Linux does 63 seconds on GCE, but Plan 9 was failing with 8 minutes.
47# See issue 8393 and 9491.
48# TODO(bradfitz,0intro): remove -v once we see some a successful build.
Anthony Martin38590322012-05-01 22:32:46 -070049echo '# GOMAXPROCS=2 runtime -cpu=1,2,4'
Brad Fitzpatricke16ab382015-01-07 17:05:51 -080050GOMAXPROCS=2 go test runtime -v -short -timeout 15m -cpu 1,2,4
Anthony Martin38590322012-05-01 22:32:46 -070051echo
52
53echo '# sync -cpu=10'
54go test sync -short -timeout 120s -cpu 10
55echo
56
57fn xcd {
58 echo
59 echo '#' $1
60 cd $"GOROOT/src/$1
61}
62
63echo
Anthony Martin38590322012-05-01 22:32:46 -070064echo '#' ../test/bench/go1
65go test ../test/bench/go1
66
67@{
68 xcd ../test
Anthony Martina7fe1f12014-07-20 13:14:53 +030069 GOMAXPROCS='' time go run run.go -v
Anthony Martin38590322012-05-01 22:32:46 -070070}
71
72echo
73echo ALL TESTS PASSED