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

View as plain text