...
Run Format

Text file src/run.bash

Documentation: Index

     1#!/usr/bin/env bash
     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.
     5
     6set -e
     7
     8eval $(go env)
     9export GOROOT   # the api test requires GOROOT to be set.
    10
    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.
    18GOPATH=$GOROOT/nonexistentpath
    19export GOPATH
    20
    21unset CDPATH	# in case user has it set
    22unset GOBIN     # Issue 14340
    23unset GOFLAGS
    24unset GO111MODULE
    25
    26export GOHOSTOS
    27export CC
    28
    29# no core files, please
    30ulimit -c 0
    31
    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'.
    35#
    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)
    43
    44# Thread count limit on NetBSD 7.
    45if ulimit -T &> /dev/null; then
    46	[ "$(ulimit -H -T)" = "unlimited" ] || ulimit -S -T $(ulimit -H -T)
    47fi
    48
    49exec go tool dist test -rebuild "$@"

View as plain text