...
Run Format

Text file src/run.bat

Documentation: Index

     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	:: Issue 14340: ignore GOBIN during all.bat.
    19	set GOBIN=
    20	set GOFLAGS=
    21	
    22	rem TODO avoid rebuild if possible
    23	
    24	if x%1==x--no-rebuild goto norebuild
    25	echo ##### Building packages and commands.
    26	go install -a -v std cmd
    27	if errorlevel 1 goto fail
    28	echo.
    29	:norebuild
    30	
    31	:: we must unset GOROOT_FINAL before tests, because runtime/debug requires
    32	:: correct access to source code, so if we have GOROOT_FINAL in effect,
    33	:: at least runtime/debug test will fail.
    34	set GOROOT_FINAL=
    35	
    36	:: get CGO_ENABLED
    37	go env > env.bat
    38	if errorlevel 1 goto fail
    39	call env.bat
    40	del env.bat
    41	echo.
    42	
    43	go tool dist test
    44	if errorlevel 1 goto fail
    45	echo.
    46	
    47	goto end
    48	
    49	:fail
    50	set GOBUILDFAIL=1
    51	
    52	:end

View as plain text