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.
|
|
|
|
|
|
2019-05-05 02:25:42 +00:00
|
|
|
# Environment variables that control run.bash:
|
|
|
|
|
#
|
|
|
|
|
# GO_TEST_SHARDS: number of "dist test" test shards that the
|
|
|
|
|
# $GOROOT/test directory will be sliced up into for parallel
|
|
|
|
|
# execution. Defaults to 1, unless GO_BUILDER_NAME is also specified,
|
|
|
|
|
# in which case it defaults to 10.
|
|
|
|
|
#
|
|
|
|
|
# GO_BUILDER_NAME: the name of the Go builder that's running the tests.
|
|
|
|
|
# Some tests are conditionally enabled or disabled based on the builder
|
|
|
|
|
# name or the builder name being non-empty.
|
|
|
|
|
|
2008-10-08 09:46:54 -07:00
|
|
|
set -e
|
|
|
|
|
|
2020-03-17 10:22:39 -04:00
|
|
|
if [ ! -f ../bin/go ]; then
|
|
|
|
|
echo 'run.bash must be run from $GOROOT/src after installing cmd/go' 1>&2
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2022-07-28 15:29:38 -04:00
|
|
|
export GOENV=off
|
2022-04-05 14:25:34 -04:00
|
|
|
eval $(../bin/go tool dist env)
|
2020-03-17 10:22:39 -04:00
|
|
|
export GOROOT # The api test requires GOROOT to be set, so set it to match ../bin/go.
|
2017-02-22 06:56:26 -08:00
|
|
|
|
2010-03-31 19:48:33 -07:00
|
|
|
unset CDPATH # in case user has it set
|
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.
|
2018-04-01 16:01:52 +00:00
|
|
|
# See longer discussion on golang.org/issue/7381.
|
2017-03-10 17:15:46 +00:00
|
|
|
[ "$(ulimit -H -n)" = "unlimited" ] || ulimit -S -n $(ulimit -H -n)
|
|
|
|
|
[ "$(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
|
2017-03-10 17:15:46 +00:00
|
|
|
[ "$(ulimit -H -T)" = "unlimited" ] || ulimit -S -T $(ulimit -H -T)
|
2013-06-17 19:31:58 +10:00
|
|
|
fi
|
|
|
|
|
|
2022-04-05 14:25:34 -04:00
|
|
|
export GOPATH=/nonexist-gopath
|
2020-03-17 10:22:39 -04:00
|
|
|
exec ../bin/go tool dist test -rebuild "$@"
|