github.com/Azareal/Gosora@v0.0.0-20210729070923-553e66b59003/run_tests.bat (about)

     1  @echo off
     2  rem TODO: Make these deletes a little less noisy
     3  del "template_*.go"
     4  del "tmpl_*.go"
     5  del "gen_*.go"
     6  del ".\tmpl_client\template_*"
     7  del ".\tmpl_client\tmpl_*"
     8  del ".\common\gen_extend.go"
     9  del "gosora.exe"
    10  
    11  echo Generating the dynamic code
    12  go generate
    13  if %errorlevel% neq 0 (
    14  	pause
    15  	exit /b %errorlevel%
    16  )
    17  
    18  echo Building the router generator
    19  go build -ldflags="-s -w" ./router_gen
    20  if %errorlevel% neq 0 (
    21  	pause
    22  	exit /b %errorlevel%
    23  )
    24  echo Running the router generator
    25  router_gen.exe
    26  if %errorlevel% neq 0 (
    27  	pause
    28  	exit /b %errorlevel%
    29  )
    30  
    31  echo Building the hook stub generator
    32  go build -ldflags="-s -w" "./cmd/hook_stub_gen"
    33  if %errorlevel% neq 0 (
    34  	pause
    35  	exit /b %errorlevel%
    36  )
    37  echo Running the hook stub generator
    38  hook_stub_gen.exe
    39  if %errorlevel% neq 0 (
    40  	pause
    41  	exit /b %errorlevel%
    42  )
    43  
    44  echo Generating the JSON handlers
    45  easyjson -pkg common
    46  
    47  echo Building the hook generator
    48  go build -tags hookgen -ldflags="-s -w" "./cmd/hook_gen"
    49  if %errorlevel% neq 0 (
    50  	pause
    51  	exit /b %errorlevel%
    52  )
    53  echo Running the hook generator
    54  hook_gen.exe
    55  if %errorlevel% neq 0 (
    56  	pause
    57  	exit /b %errorlevel%
    58  )
    59  
    60  echo Building the query generator
    61  go build -ldflags="-s -w" "./cmd/query_gen"
    62  if %errorlevel% neq 0 (
    63  	pause
    64  	exit /b %errorlevel%
    65  )
    66  echo Running the query generator
    67  query_gen.exe
    68  if %errorlevel% neq 0 (
    69  	pause
    70  	exit /b %errorlevel%
    71  )
    72  
    73  echo Building the executable
    74  go test
    75  if %errorlevel% neq 0 (
    76  	pause
    77  	exit /b %errorlevel%
    78  )
    79  pause