Skip to content

Commit b53e95a

Browse files
committed
src: add race.bash
Add race.bash so anyone with suitable hardware can run a race detector build. race.bash can be called from the dashboard builder by passing -cmd="race.bash". Original source for race.bash is here, http://code.google.com/p/go-wiki/wiki/DashboardBuilders TODO: add race.bat for windows/amd64 R=dvyukov, minux.ma, adg, rsc CC=fullung, golang-dev https://golang.org/cl/7179052
1 parent 1da07a7 commit b53e95a

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

src/race.bash

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2013 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+
# race.bash tests the standard library under the race detector.
7+
# http://golang.org/doc/articles/race_detector.html
8+
9+
set -e
10+
11+
function usage {
12+
echo 'race detector is only supported on linux/amd64 and darwin/amd64' 1>&2
13+
exit 1
14+
}
15+
16+
case $(uname) in
17+
"Darwin")
18+
# why Apple? why?
19+
if sysctl machdep.cpu.extfeatures | grep -qv EM64T; then
20+
usage
21+
fi
22+
;;
23+
"Linux")
24+
if [ $(uname -m) != "x86_64" ]; then
25+
usage
26+
fi
27+
;;
28+
*)
29+
usage
30+
;;
31+
esac
32+
33+
if [ ! -f make.bash ]; then
34+
echo 'race.bash must be run from $GOROOT/src' 1>&2
35+
exit 1
36+
fi
37+
. ./make.bash --no-banner
38+
go install -race std
39+
go test -race -short std
40+
go test -race -run=nothingplease -bench=.* -benchtime=.1s -cpu=4 std

0 commit comments

Comments
 (0)