1 :: Copyright 2013 The Go Authors. All rights reserved.
2 :: Use of this source code is governed by a BSD-style
3 :: license that can be found in the LICENSE file.
5 :: race.bash tests the standard library under the race detector.
6 :: http://golang.org/doc/articles/race_detector.html
12 if exist make.bat goto ok
13 echo race.bat must be run from go\src
14 :: cannot exit: would kill parent command interpreter
18 call make.bat --dist-tool >NUL
19 if errorlevel 1 goto fail
20 .\cmd\dist\dist env -wp >env.bat
21 if errorlevel 1 goto fail
25 if %GOHOSTARCH% == amd64 goto continue
26 echo Race detector is only supported on windows/amd64.
30 call make.bat --no-banner --no-local
31 if %GOBUILDFAIL%==1 goto end
32 :: golang.org/issue/5537 - we must build a race enabled cmd/cgo before trying to use it.
33 echo # go install -race cmd/cgo
34 go install -race cmd/cgo
35 echo # go install -race std
37 if errorlevel 1 goto fail
38 echo # go test -race -short -std
39 go test -race -short std
40 if errorlevel 1 goto fail
41 echo # go test -race -run=nothingplease -bench=.* -benchtime=.1s -cpu=4 std
42 go test -race -run=nothingplease -bench=.* -benchtime=.1s -cpu=4 std
43 if errorlevel 1 goto fail
52 echo All tests passed.