1
0
mirror of https://github.com/golang/go synced 2024-11-12 02:50:25 -07:00
go/src/run.bash
Russ Cox 7b848c6964 cmd/dist: cross-compiling fixes
This CL makes it possible to run make.bash with
GOOS and GOARCH set to something other than
the native host GOOS and GOARCH.

As part of the CL, the tool directory moves from bin/tool/
to pkg/tool/goos_goarch where goos and goarch are
the values for the host system (running the build), not
the target.  pkg/ is not technically appropriate, but C objects
are there now tool (pkg/obj/) so this puts all the generated
binaries in one place (rm -rf $GOROOT/pkg cleans everything).
Including goos_goarch in the name allows different systems
to share a single $GOROOT on a shared file system.

Fixes #2920.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5645093
2012-02-13 22:31:51 -05:00

114 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
# 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
eval $(go tool dist env)
unset CDPATH # in case user has it set
# no core files, please
ulimit -c 0
# allow all.bash to avoid double-build of everything
rebuild=true
if [ "$1" = "--no-rebuild" ]; then
shift
else
echo '# Building packages and commands.'
time go install -a -v std
echo
fi
echo '# Testing packages.'
time go test std -short -timeout=120s
echo
echo '# runtime -cpu=1,2,4'
go test runtime -short -timeout=120s -cpu=1,2,4
echo
echo '# sync -cpu=10'
go test sync -short -timeout=120s -cpu=10
xcd() {
echo
echo --- cd $1
builtin cd "$GOROOT"/src/$1
}
BROKEN=true
$BROKEN ||
[ "$CGO_ENABLED" != 1 ] ||
[ "$GOHOSTOS" == windows ] ||
(xcd ../misc/cgo/stdio
"$GOMAKE" clean
./test.bash
) || exit $?
$BROKEN ||
[ "$CGO_ENABLED" != 1 ] ||
(xcd ../misc/cgo/life
"$GOMAKE" clean
./test.bash
) || exit $?
$BROKEN ||
[ "$CGO_ENABLED" != 1 ] ||
(xcd ../misc/cgo/test
"$GOMAKE" clean
gotest
) || exit $?
$BROKEN ||
[ "$CGO_ENABLED" != 1 ] ||
[ "$GOHOSTOS" == windows ] ||
[ "$GOHOSTOS" == darwin ] ||
(xcd ../misc/cgo/testso
"$GOMAKE" clean
./test.bash
) || exit $?
$BROKEN ||
(xcd ../doc/progs
time ./run
) || exit $?
$BROKEN ||
[ "$GOARCH" == arm ] || # uses network, fails under QEMU
(xcd ../doc/codelab/wiki
"$GOMAKE" clean
"$GOMAKE"
"$GOMAKE" test
) || exit $?
$BROKEN ||
for i in ../misc/dashboard/builder ../misc/goplay
do
(xcd $i
"$GOMAKE" clean
"$GOMAKE"
) || exit $?
done
$BROKEN ||
[ "$GOARCH" == arm ] ||
(xcd ../test/bench/shootout
./timing.sh -test
) || exit $?
$BROKEN ||
(xcd ../test/bench/go1
"$GOMAKE" test
) || exit $?
(xcd ../test
./run
) || exit $?
echo
echo ALL TESTS PASSED