]> Cypherpunks.ru repositories - gostls13.git/blob - src/run.bat
build: unset GOPATH before 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 echo # Testing packages.
29 go test std -short -timeout=120s
30 if errorlevel 1 goto fail
31 echo.
32
33 echo # runtime -cpu=1,2,4
34 go test runtime -short -timeout=120s -cpu=1,2,4
35 if errorlevel 1 goto fail
36 echo.
37
38 echo # sync -cpu=10
39 go test sync -short -timeout=120s -cpu=10
40 if errorlevel 1 goto fail
41 echo.
42
43 echo # ..\misc\dashboard\builder ..\misc\goplay
44 go build ..\misc\dashboard\builder ..\misc\goplay
45 if errorlevel 1 goto fail
46 echo.
47
48 :: 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.
49 ::echo # ..\test\bench\go1
50 ::go test ..\test\bench\go1
51 ::if errorlevel 1 goto fail
52 ::echo.
53
54 :: TODO: The other tests in run.bash.
55
56 echo # test
57 cd ..\test
58 set FAIL=0
59 go run run.go
60 if errorlevel 1 set FAIL=1
61 cd ..\src
62 echo.
63 if %FAIL%==1 goto fail
64
65 echo # Checking API compatibility.
66 go tool api -c ..\api\go1.txt
67 if errorlevel 1 goto fail
68 echo.
69
70 echo ALL TESTS PASSED
71 goto end
72
73 :fail
74 set GOBUILDFAIL=1
75
76 :end