]> Cypherpunks.ru repositories - gostls13.git/blob - src/run.bat
[dev.link] all: merge branch 'master' into dev.link
[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
5 @echo off
6
7 if exist ..\bin\go goto ok
8 echo Must run run.bat from Go src directory after installing cmd/go.
9 goto fail
10 :ok
11
12 :: Keep environment variables within this script
13 :: unless invoked with --no-local.
14 if x%1==x--no-local goto nolocal
15 if x%2==x--no-local goto nolocal
16 setlocal
17 :nolocal
18
19 set GOBUILDFAIL=0
20
21 :: we disallow local import for non-local packages, if %GOROOT% happens
22 :: to be under %GOPATH%, then some tests below will fail
23 set GOPATH=
24 :: Issue 14340: ignore GOBIN during all.bat.
25 set GOBIN=
26 set GOFLAGS=
27 set GO111MODULE=
28
29 rem TODO avoid rebuild if possible
30
31 if x%1==x--no-rebuild goto norebuild
32 echo ##### Building packages and commands.
33 go install -a -v std cmd
34 if errorlevel 1 goto fail
35 echo.
36 :norebuild
37
38 :: we must unset GOROOT_FINAL before tests, because runtime/debug requires
39 :: correct access to source code, so if we have GOROOT_FINAL in effect,
40 :: at least runtime/debug test will fail.
41 set GOROOT_FINAL=
42
43 :: get CGO_ENABLED
44 ..\bin\go env > env.bat
45 if errorlevel 1 goto fail
46 call env.bat
47 del env.bat
48 echo.
49
50 ..\bin\go tool dist test
51 if errorlevel 1 goto fail
52 echo.
53
54 goto end
55
56 :fail
57 set GOBUILDFAIL=1
58
59 :end