github.com/spotify/syslog-redirector-golang@v0.0.0-20140320174030-4859f03d829a/src/run.rc (about)

     1  #!/bin/rc -e
     2  # Copyright 2012 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  
     6  rfork e
     7  
     8  eval `{go env}
     9  
    10  GOPATH = () # we disallow local import for non-local packges, if $GOROOT happens
    11              # to be under $GOPATH, then some tests below will fail
    12  
    13  # allow all.rc to avoid double-build of everything
    14  rebuild = true
    15  if(~ $1 --no-rebuild)
    16  	shift
    17  if not {
    18  	# Run only one process at a time on 9vx.
    19  	if(~ $sysname vx32)
    20  		pflag = (-p 1)
    21  	echo '# Building packages and commands.'
    22  	time go install -a -v $pflag std
    23  	echo
    24  }
    25  
    26  # we must unset GOROOT_FINAL before tests, because runtime/debug requires
    27  # correct access to source code, so if we have GOROOT_FINAL in effect,
    28  # at least runtime/debug test will fail.
    29  GOROOT_FINAL = ()
    30  
    31  echo '# Testing packages.'
    32  time go test std -short -timeout 120s
    33  echo
    34  
    35  echo '# GOMAXPROCS=2 runtime -cpu=1,2,4'
    36  GOMAXPROCS=2 go test runtime -short -timeout 240s -cpu 1,2,4
    37  echo
    38  
    39  echo '# sync -cpu=10'
    40  go test sync -short -timeout 120s -cpu 10
    41  echo
    42  
    43  fn xcd {
    44  	echo
    45  	echo '#' $1
    46  	cd $"GOROOT/src/$1
    47  }
    48  
    49  echo
    50  echo '#' ../misc/goplay
    51  go build ../misc/gplay
    52  
    53  echo
    54  echo '#' ../test/bench/go1
    55  go test ../test/bench/go1
    56  
    57  @{
    58  	xcd ../test
    59  	GOMAXPROCS='' time go run run.go
    60  }
    61  
    62  echo
    63  echo ALL TESTS PASSED