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
echo # Building packages and commands.
go install -a -v std
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-02-03 22:48:31 -07:00
echo # Testing packages.
go test std -short -timeout=120s
if errorlevel 1 goto fail
2012-02-16 13:49:50 -07:00
echo .
2012-02-03 22:48:31 -07:00
echo # runtime -cpu=1,2,4
go test runtime -short -timeout=120s -cpu=1,2,4
if errorlevel 1 goto fail
2012-02-16 13:49:50 -07:00
echo .
2012-02-03 22:48:31 -07:00
echo # sync -cpu=10
go test sync -short -timeout=120s -cpu=10
if errorlevel 1 goto fail
2012-02-16 13:49:50 -07:00
echo .
2012-02-03 22:48:31 -07:00
2012-03-19 21:04:20 -06:00
echo # ..\misc\dashboard\builder ..\misc\goplay
go build ..\misc\dashboard\builder ..\misc\goplay
if errorlevel 1 goto fail
echo .
2012-03-19 21:59:51 -06:00
: : 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.
: :echo # ..\test\bench\go1
: :go test ..\test\bench\go1
: :if errorlevel 1 goto fail
: :echo.
2012-03-19 21:04:20 -06:00
2012-03-05 20:47:23 -07:00
: : TODO: The other tests in run.bash.
echo # test
2012-03-12 19:51:28 -06:00
cd ..\test
set FAIL = 0
2012-03-05 20:47:23 -07:00
go run run.go
2012-03-12 19:51:28 -06:00
if errorlevel 1 set FAIL = 1
cd ..\src
2012-03-05 20:47:23 -07:00
echo .
2012-03-12 19:51:28 -06:00
if %FAIL% == 1 goto fail
2012-02-03 22:48:31 -07:00
2012-03-19 21:04:20 -06:00
echo # Checking API compatibility.
2012-05-22 19:41:20 -06:00
go tool api -c ..\api\go1.txt -next ..\api\next.txt
2012-03-19 21:04:20 -06:00
if errorlevel 1 goto fail
echo .
2012-02-03 22:48:31 -07:00
echo ALL TESTS PASSED
goto end
: fail
set GOBUILDFAIL = 1
: end