2012-02-03 22:48:31 -07:00
|
|
|
:: Copyright 2012 The Go Authors. All rights reserved.
|
|
|
|
:: Use of this source code is governed by a BSD-style
|
|
|
|
:: license that can be found in the LICENSE file.
|
|
|
|
@echo off
|
|
|
|
|
2012-02-15 16:44:55 -07:00
|
|
|
:: Keep environment variables within this script
|
|
|
|
:: unless invoked with --no-local.
|
|
|
|
if x%1==x--no-local goto nolocal
|
|
|
|
if x%2==x--no-local goto nolocal
|
|
|
|
setlocal
|
|
|
|
:nolocal
|
|
|
|
|
2012-02-03 22:48:31 -07:00
|
|
|
set GOBUILDFAIL=0
|
|
|
|
|
2012-03-20 10:47:27 -06:00
|
|
|
:: we disallow local import for non-local packages, if %GOROOT% happens
|
|
|
|
:: to be under %GOPATH%, then some tests below will fail
|
|
|
|
set GOPATH=
|
|
|
|
|
2012-02-03 22:48:31 -07:00
|
|
|
rem TODO avoid rebuild if possible
|
|
|
|
|
|
|
|
if x%1==x--no-rebuild goto norebuild
|
2014-12-10 08:45:59 -07:00
|
|
|
echo ##### Building packages and commands.
|
2015-02-22 10:41:32 -07:00
|
|
|
go install -a -v std cmd
|
2012-02-03 22:48:31 -07:00
|
|
|
if errorlevel 1 goto fail
|
2012-02-16 13:49:50 -07:00
|
|
|
echo.
|
2012-02-03 22:48:31 -07:00
|
|
|
:norebuild
|
|
|
|
|
2012-04-04 09:14:54 -06:00
|
|
|
:: we must unset GOROOT_FINAL before tests, because runtime/debug requires
|
|
|
|
:: correct access to source code, so if we have GOROOT_FINAL in effect,
|
|
|
|
:: at least runtime/debug test will fail.
|
|
|
|
set GOROOT_FINAL=
|
|
|
|
|
2012-08-06 19:38:35 -06:00
|
|
|
:: get CGO_ENABLED
|
|
|
|
go env > env.bat
|
|
|
|
if errorlevel 1 goto fail
|
|
|
|
call env.bat
|
|
|
|
del env.bat
|
|
|
|
echo.
|
|
|
|
|
2015-03-02 18:07:11 -07:00
|
|
|
go tool dist test --no-rebuild
|
2012-02-03 22:48:31 -07:00
|
|
|
if errorlevel 1 goto fail
|
2012-02-16 13:49:50 -07:00
|
|
|
echo.
|
2012-02-03 22:48:31 -07:00
|
|
|
|
|
|
|
goto end
|
|
|
|
|
|
|
|
:fail
|
|
|
|
set GOBUILDFAIL=1
|
|
|
|
|
|
|
|
:end
|