]> Cypherpunks.ru repositories - gostls13.git/blob - src/run.bat
misc/cgo/{life,stdio}, test/run.go: use test/run.go to do the cgo tests
[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=120s -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 echo # ..\misc\dashboard\builder ..\misc\goplay
56 go build ..\misc\dashboard\builder ..\misc\goplay
57 if errorlevel 1 goto fail
58 echo.
59
60 :: TODO(brainman): disabled, because it fails with: mkdir C:\Users\ADMINI~1\AppData\Local\Temp\2.....\test\bench\: The filename or extension is too long.
61 ::echo # ..\test\bench\go1
62 ::go test ..\test\bench\go1
63 ::if errorlevel 1 goto fail
64 ::echo.
65
66 :: cgo tests
67 :: TODO: Other cgo tests
68 if x%CGO_ENABLED% == x0 goto nocgo
69 echo # ..\misc\cgo\life
70 go run %GOROOT%\test\run.go - ..\misc\cgo\life
71 if errorlevel 1 goto fail
72 echo.
73 :nocgo
74
75 :: TODO: The other tests in run.bash.
76
77 echo # test
78 cd ..\test
79 set FAIL=0
80 go run run.go
81 if errorlevel 1 set FAIL=1
82 cd ..\src
83 echo.
84 if %FAIL%==1 goto fail
85
86 echo # Checking API compatibility.
87 go tool api -c ..\api\go1.txt -next ..\api\next.txt
88 if errorlevel 1 goto fail
89 echo.
90
91 echo ALL TESTS PASSED
92 goto end
93
94 :fail
95 set GOBUILDFAIL=1
96
97 :end