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.
|
2022-12-02 13:30:06 -05:00
|
|
|
#
|
|
|
|
|
# GO_TEST_SHORT: if set to a non-empty, false-ish string, run tests in "-short=false" mode.
|
|
|
|
|
# This environment variable is an internal implementation detail between the
|
|
|
|
|
# Go build system (x/build) and cmd/dist for the purpose of longtest builders,
|
|
|
|
|
# and will be removed if it stops being needed. See go.dev/issue/12508.
|
|
|
|
|
#
|
|
|
|
|
# GO_TEST_TIMEOUT_SCALE: a non-negative integer factor to scale test timeout by.
|
2022-12-02 13:40:49 -05:00
|
|
|
# Defaults to 1.
|
2019-05-05 02:25:42 +00:00
|
|
|
|
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)
|
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.
|
2024-05-14 18:09:04 -07:00
|
|
|
# We need at least ~300 MB of bss.
|
2017-03-10 17:15:46 +00: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
|
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 "$@"
|