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 set OLDGOMAXPROCS=%GOMAXPROCS%
47 :: We set GOMAXPROCS=2 in addition to -cpu=1,2,4 in order to test runtime bootstrap code,
48 :: creation of first goroutines and first garbage collections in the parallel setting.
49 echo # GOMAXPROCS=2 runtime -cpu=1,2,4
51 go test runtime -short -timeout=300s -cpu=1,2,4
52 if errorlevel 1 goto fail
55 set GOMAXPROCS=%OLDGOMAXPROCS%
59 go test sync -short -timeout=120s -cpu=10
60 if errorlevel 1 goto fail
63 :: Race detector only supported on Linux and OS X,
64 :: and only on amd64, and only when cgo is enabled.
65 if not "%GOHOSTOS%-%GOOS%-%GOARCH%-%CGO_ENABLED%" == "windows-windows-amd64-1" goto norace
66 echo # Testing race detector.
67 go test -race -i runtime/race flag
68 if errorlevel 1 goto fail
69 go test -race -run=Output runtime/race
70 if errorlevel 1 goto fail
71 go test -race -short flag
72 if errorlevel 1 goto fail
76 echo # ..\test\bench\go1
77 go test ..\test\bench\go1
78 if errorlevel 1 goto fail
82 if x%CGO_ENABLED% == x0 goto nocgo
83 echo # ..\misc\cgo\life
84 go run "%GOROOT%\test\run.go" - ..\misc\cgo\life
85 if errorlevel 1 goto fail
88 echo # ..\misc\cgo\stdio
89 go run "%GOROOT%\test\run.go" - ..\misc\cgo\stdio
90 if errorlevel 1 goto fail
93 :: cgo tests inspect the traceback for runtime functions
94 set OLDGOTRACEBACK=%GOTRACEBACK%
97 echo # ..\misc\cgo\test
98 go test ..\misc\cgo\test
99 if errorlevel 1 goto fail
102 set GOTRACEBACK=%OLDGOTRACEBACK%
105 echo # ..\misc\cgo\testso
106 cd ..\misc\cgo\testso
110 if %FAIL%==1 goto fail
115 go run "%GOROOT%\test\run.go" - ..\doc\progs
116 if errorlevel 1 goto fail
119 :: TODO: The other tests in run.bash.
122 set OLDGOMAXPROCS=%GOMAXPROCS%
129 if errorlevel 1 set FAIL=1
132 if %FAIL%==1 goto fail
134 set GOMAXPROCS=%OLDGOMAXPROCS%
137 :: echo # Checking API compatibility.
138 :: go run "%GOROOT%\src\cmd\api\run.go"
139 :: if errorlevel 1 goto fail
141 echo # SKIPPING API COMPATIBILITY UNTIL ALL SYSTEMS BUILD.
144 echo ALL TESTS PASSED