1 :: Copyright 2012 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.
6 :: Keep environment variables within this script
7 :: unless invoked with --no-local.
8 if x%1==x--no-local goto nolocal
9 if x%2==x--no-local goto nolocal
15 :: we disallow local import for non-local packages, if %GOROOT% happens
16 :: to be under %GOPATH%, then some tests below will fail
19 rem TODO avoid rebuild if possible
21 if x%1==x--no-rebuild goto norebuild
22 echo # Building packages and commands.
24 if errorlevel 1 goto fail
28 :: we must unset GOROOT_FINAL before tests, because runtime/debug requires
29 :: correct access to source code, so if we have GOROOT_FINAL in effect,
30 :: at least runtime/debug test will fail.
35 if errorlevel 1 goto fail
40 echo # Testing packages.
41 go test std -short -timeout=120s
42 if errorlevel 1 goto fail
45 echo # runtime -cpu=1,2,4
46 go test runtime -short -timeout=120s -cpu=1,2,4
47 if errorlevel 1 goto fail
51 go test sync -short -timeout=120s -cpu=10
52 if errorlevel 1 goto fail
55 if not "%GOHOSTOS%-%GOOS%-%GOARCH%-%CGO_ENABLED%" == "windows-windows-amd64-1" goto norace
56 echo # Testing race detector.
58 if errorlevel 1 goto fail
59 go test -race -short flag
60 if errorlevel 1 goto fail
64 echo # ..\misc\dashboard\builder ..\misc\goplay
65 go build ..\misc\dashboard\builder ..\misc\goplay
66 if errorlevel 1 goto fail
69 echo # ..\test\bench\go1
70 go test ..\test\bench\go1
71 if errorlevel 1 goto fail
75 :: issue 4955 - cgo is broken
77 if x%CGO_ENABLED% == x0 goto nocgo
78 echo # ..\misc\cgo\life
79 go run %GOROOT%\test\run.go - ..\misc\cgo\life
80 if errorlevel 1 goto fail
83 echo # ..\misc\cgo\stdio
84 go run %GOROOT%\test\run.go - ..\misc\cgo\stdio
85 if errorlevel 1 goto fail
88 echo # ..\misc\cgo\test
89 go test ..\misc\cgo\test
90 if errorlevel 1 goto fail
95 go run %GOROOT%\test\run.go - ..\doc\progs
96 if errorlevel 1 goto fail
99 :: TODO: The other tests in run.bash.
102 set OLDGOMAXPROCS=%GOMAXPROCS%
109 if errorlevel 1 set FAIL=1
112 if %FAIL%==1 goto fail
114 set GOMAXPROCS=%OLDGOMAXPROCS%
117 echo # Checking API compatibility.
118 go tool api -c ..\api\go1.txt -next ..\api\next.txt -except ..\api\except.txt
119 if errorlevel 1 goto fail
122 echo ALL TESTS PASSED