1
0
mirror of https://github.com/golang/go synced 2024-11-20 00:44:45 -07:00

runtime/race: add Windows support

This is copy of https://golang.org/cl/6810080
but sent from another account (dvyukov@gmail.com is not in CONTRIBUTORS).

R=rsc
CC=golang-dev
https://golang.org/cl/6827060
This commit is contained in:
Dmitriy Vyukov 2012-11-07 23:59:09 +04:00
parent f8614a6645
commit 1ebf2d85ba
4 changed files with 12 additions and 3 deletions

View File

@ -1840,8 +1840,8 @@ func raceInit() {
if !buildRace { if !buildRace {
return return
} }
if goarch != "amd64" || goos != "linux" && goos != "darwin" { if goarch != "amd64" || goos != "linux" && goos != "darwin" && goos != "windows" {
fmt.Fprintf(os.Stderr, "go %s: -race is only supported on linux/amd64 and darwin/amd64\n", flag.Args()[0]) fmt.Fprintf(os.Stderr, "go %s: -race is only supported on linux/amd64, darwin/amd64 and windows/amd64\n", flag.Args()[0])
os.Exit(2) os.Exit(2)
} }
buildGcflags = append(buildGcflags, "-b") buildGcflags = append(buildGcflags, "-b")

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build race,linux,amd64 race,darwin,amd64 // +build race,linux,amd64 race,darwin,amd64 race,windows,amd64
// Package race provides low-level facilities for data race detection. // Package race provides low-level facilities for data race detection.
package race package race

Binary file not shown.

View File

@ -52,6 +52,15 @@ go test sync -short -timeout=120s -cpu=10
if errorlevel 1 goto fail if errorlevel 1 goto fail
echo. echo.
if not "%GOHOSTOS%-%GOOS%-%GOARCH%-%CGO_ENABLED%" == "windows-windows-amd64-1" goto norace
echo # Testing race detector.
go test -race -i flag
if errorlevel 1 goto fail
go test -race -short flag
if errorlevel 1 goto fail
echo.
:norace
echo # ..\misc\dashboard\builder ..\misc\goplay echo # ..\misc\dashboard\builder ..\misc\goplay
go build ..\misc\dashboard\builder ..\misc\goplay go build ..\misc\dashboard\builder ..\misc\goplay
if errorlevel 1 goto fail if errorlevel 1 goto fail