summaryrefslogtreecommitdiff
path: root/src/run.rc
blob: 765b331aae6c131d3d109e3226904f0c9045de76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/rc -e
# Copyright 2012 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

rfork e

eval `{go env}

GOPATH = () # we disallow local import for non-local packges, if $GOROOT happens
            # to be under $GOPATH, then some tests below will fail

# allow all.rc to avoid double-build of everything
rebuild = true
if(~ $1 --no-rebuild)
	shift
if not {
	# Run only one process at a time on 9vx.
	if(~ $sysname vx32)
		pflag = (-p 1)
	echo '# Building packages and commands.'
	time go install -a -v $pflag std
	echo
}

# we must unset GOROOT_FINAL before tests, because runtime/debug requires
# correct access to source code, so if we have GOROOT_FINAL in effect,
# at least runtime/debug test will fail.
GOROOT_FINAL = ()

echo '# Testing packages.'
time go test std -short -timeout 120s
echo

echo '# GOMAXPROCS=2 runtime -cpu=1,2,4'
GOMAXPROCS=2 go test runtime -short -timeout 240s -cpu 1,2,4
echo

echo '# sync -cpu=10'
go test sync -short -timeout 120s -cpu 10
echo

fn xcd {
	echo
	echo '#' $1
	cd $"GOROOT/src/$1
}

echo
echo '#' ../misc/goplay
go build ../misc/gplay

echo
echo '#' ../test/bench/go1
go test ../test/bench/go1

@{
	xcd ../test
	GOMAXPROCS='' time go run run.go
}

echo
echo ALL TESTS PASSED