blob: 2613621556700ee0431e9ed1d786f78741a9ad26 [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.'
32time go test std -short -timeout 120s
33echo
34
Dmitriy Vyukov13045842014-03-06 13:16:14 +040035# We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code,
36# creation of first goroutines and first garbage collections in the parallel setting.
Anthony Martin38590322012-05-01 22:32:46 -070037echo '# GOMAXPROCS=2 runtime -cpu=1,2,4'
Anthony Martinf08acae2013-02-26 09:25:46 -080038GOMAXPROCS=2 go test runtime -short -timeout 240s -cpu 1,2,4
Anthony Martin38590322012-05-01 22:32:46 -070039echo
40
41echo '# sync -cpu=10'
42go test sync -short -timeout 120s -cpu 10
43echo
44
45fn xcd {
46 echo
47 echo '#' $1
48 cd $"GOROOT/src/$1
49}
50
51echo
Andrew Gerrand5f1af162013-08-01 13:49:00 +100052echo '#' ../misc/goplay
David du Colombier610dc922014-01-28 06:17:38 +010053go build ../misc/goplay
Anthony Martin38590322012-05-01 22:32:46 -070054
55echo
56echo '#' ../test/bench/go1
57go test ../test/bench/go1
58
59@{
60 xcd ../test
Dave Cheney36c4a732012-11-15 11:40:10 +110061 GOMAXPROCS='' time go run run.go
Anthony Martin38590322012-05-01 22:32:46 -070062}
63
64echo
65echo ALL TESTS PASSED