]> Cypherpunks.ru repositories - gostls13.git/blob - src/run.bat
build: disable race detector test in run.bat on windows
[gostls13.git] / src / run.bat
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.
4 @echo off
5
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
10 setlocal
11 :nolocal
12
13 set GOBUILDFAIL=0
14
15 :: we disallow local import for non-local packages, if %GOROOT% happens
16 :: to be under %GOPATH%, then some tests below will fail
17 set GOPATH=
18
19 rem TODO avoid rebuild if possible
20
21 if x%1==x--no-rebuild goto norebuild
22 echo # Building packages and commands.
23 go install -a -v std
24 if errorlevel 1 goto fail
25 echo.
26 :norebuild
27
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.
31 set GOROOT_FINAL=
32
33 :: get CGO_ENABLED
34 go env > env.bat
35 if errorlevel 1 goto fail
36 call env.bat
37 del env.bat
38 echo.
39
40 echo # Testing packages.
41 go test std -short -timeout=120s
42 if errorlevel 1 goto fail
43 echo.
44
45 echo # runtime -cpu=1,2,4
46 go test runtime -short -timeout=300s -cpu=1,2,4
47 if errorlevel 1 goto fail
48 echo.
49
50 echo # sync -cpu=10
51 go test sync -short -timeout=120s -cpu=10
52 if errorlevel 1 goto fail
53 echo.
54
55 # Race detector only supported on Linux and OS X,
56 # and only on amd64, and only when cgo is enabled.
57 # Disabled due to golang.org/issue/7334; remove XXX below
58 # and in run.bash to reenable.
59 if not "%GOHOSTOS%-%GOOS%-%GOARCH%-%CGO_ENABLED%" == "XXXwindows-windows-amd64-1" goto norace
60 echo # Testing race detector.
61 go test -race -i runtime/race flag
62 if errorlevel 1 goto fail
63 go test -race -run=Output runtime/race
64 if errorlevel 1 goto fail
65 go test -race -short flag
66 if errorlevel 1 goto fail
67 echo.
68 :norace
69
70 echo # ..\misc\goplay
71 go build ..\misc\goplay
72 if errorlevel 1 goto fail
73 echo.
74
75 echo # ..\test\bench\go1
76 go test ..\test\bench\go1
77 if errorlevel 1 goto fail
78 echo.
79
80 :: cgo tests
81 if x%CGO_ENABLED% == x0 goto nocgo
82 echo # ..\misc\cgo\life
83 go run "%GOROOT%\test\run.go" - ..\misc\cgo\life
84 if errorlevel 1 goto fail
85 echo.
86
87 echo # ..\misc\cgo\stdio
88 go run "%GOROOT%\test\run.go" - ..\misc\cgo\stdio
89 if errorlevel 1 goto fail
90 echo.
91
92 echo # ..\misc\cgo\test
93 go test ..\misc\cgo\test
94 if errorlevel 1 goto fail
95 echo.
96
97 echo # ..\misc\cgo\testso
98 cd ..\misc\cgo\testso
99 set FAIL=0
100 call test.bat
101 cd ..\..\..\src
102 if %FAIL%==1 goto fail
103 echo.
104 :nocgo
105
106 echo # ..\doc\progs
107 go run "%GOROOT%\test\run.go" - ..\doc\progs
108 if errorlevel 1 goto fail
109 echo.
110
111 :: TODO: The other tests in run.bash.
112
113
114 set OLDGOMAXPROCS=%GOMAXPROCS%
115
116 echo # ..\test
117 cd ..\test
118 set FAIL=0
119 set GOMAXPROCS=
120 go run run.go
121 if errorlevel 1 set FAIL=1
122 cd ..\src
123 echo.
124 if %FAIL%==1 goto fail
125
126 set GOMAXPROCS=%OLDGOMAXPROCS%
127 set OLDGOMAXPROCS=
128
129 echo # Checking API compatibility.
130 go run "%GOROOT%\src\cmd\api\run.go"
131 if errorlevel 1 goto fail
132 echo.
133
134 echo ALL TESTS PASSED
135 goto end
136
137 :fail
138 set GOBUILDFAIL=1
139
140 :end