2009-11-14 15:29:09 -08:00
|
|
|
#!/usr/bin/env bash
|
2008-10-08 09:46:54 -07:00
|
|
|
# Copyright 2009 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.
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
2012-03-10 03:42:23 +08:00
|
|
|
eval $(go env)
|
2014-04-29 14:43:10 -04:00
|
|
|
export GOROOT # the api test requires GOROOT to be set.
|
2012-02-04 00:54:08 -05:00
|
|
|
|
2010-03-31 19:48:33 -07:00
|
|
|
unset CDPATH # in case user has it set
|
2012-03-21 00:47:27 +08:00
|
|
|
unset GOPATH # we disallow local import for non-local packages, if $GOROOT happens
|
|
|
|
|
# to be under $GOPATH, then some tests below will fail
|
2009-12-11 15:14:09 -08:00
|
|
|
|
2015-03-02 17:07:11 -08:00
|
|
|
export GOHOSTOS
|
|
|
|
|
export CC
|
|
|
|
|
|
2009-11-09 23:11:36 -08:00
|
|
|
# no core files, please
|
|
|
|
|
ulimit -c 0
|
|
|
|
|
|
2012-09-17 01:11:28 +08:00
|
|
|
# Raise soft limits to hard limits for NetBSD/OpenBSD.
|
|
|
|
|
# We need at least 256 files and ~300 MB of bss.
|
|
|
|
|
# On OS X ulimit -S -n rejects 'unlimited'.
|
2014-02-24 16:44:35 -05:00
|
|
|
#
|
|
|
|
|
# Note that ulimit -S -n may fail if ulimit -H -n is set higher than a
|
|
|
|
|
# non-root process is allowed to set the high limit.
|
|
|
|
|
# This is a system misconfiguration and should be fixed on the
|
|
|
|
|
# broken system, not "fixed" by ignoring the failure here.
|
|
|
|
|
# See longer discussion on golang.org/issue/7381.
|
2012-09-17 01:11:28 +08:00
|
|
|
[ "$(ulimit -H -n)" == "unlimited" ] || ulimit -S -n $(ulimit -H -n)
|
2012-09-17 01:26:57 +08:00
|
|
|
[ "$(ulimit -H -d)" == "unlimited" ] || ulimit -S -d $(ulimit -H -d)
|
2012-09-17 01:11:28 +08:00
|
|
|
|
2013-06-17 19:31:58 +10:00
|
|
|
# Thread count limit on NetBSD 7.
|
|
|
|
|
if ulimit -T &> /dev/null; then
|
|
|
|
|
[ "$(ulimit -H -T)" == "unlimited" ] || ulimit -S -T $(ulimit -H -T)
|
|
|
|
|
fi
|
|
|
|
|
|
2015-05-08 12:18:52 -07:00
|
|
|
exec go tool dist test "$@"
|