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.
8eval $(go env)
9export GOROOT # the api test requires GOROOT to be set.
11# We disallow local import for non-local packages, if $GOROOT happens
12# to be under $GOPATH, then some tests below will fail. $GOPATH needs
13# to be set to a non-empty string, else Go will set a default value
14# that may also conflict with $GOROOT. The $GOPATH value doesn't need
15# to point to an actual directory, it just needs to pass the semantic
16# checks performed by Go. Use $GOROOT to define $GOPATH so that we
17# don't blunder into a user-defined symbolic link.
21unset CDPATH # in case user has it set
22unset GOBIN # Issue 14340
29# no core files, please
30ulimit -c 0
32# Raise soft limits to hard limits for NetBSD/OpenBSD.
33# We need at least 256 files and ~300 MB of bss.
34# On OS X ulimit -S -n rejects 'unlimited'.
36# Note that ulimit -S -n may fail if ulimit -H -n is set higher than a
37# non-root process is allowed to set the high limit.
38# This is a system misconfiguration and should be fixed on the
39# broken system, not "fixed" by ignoring the failure here.
40# See longer discussion on golang.org/issue/7381.
41[ "$(ulimit -H -n)" = "unlimited" ] || ulimit -S -n $(ulimit -H -n)
42[ "$(ulimit -H -d)" = "unlimited" ] || ulimit -S -d $(ulimit -H -d)
44# Thread count limit on NetBSD 7.
45if ulimit -T &> /dev/null; then
46 [ "$(ulimit -H -T)" = "unlimited" ] || ulimit -S -T $(ulimit -H -T)
49exec go tool dist test -rebuild "$@"
View as plain text