Set ErrorActionPreference on all powershell scripts and add explicit error checks.

This commit is contained in:
Daniel Kirchner 2020-09-17 13:08:14 +02:00
parent 23fa0a5387
commit a1de862135
4 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,5 @@
$ErrorActionPreference = "Stop"
cd "$PSScriptRoot\.."
if ("$Env:FORCE_RELEASE") {
@ -9,5 +11,8 @@ mkdir build
cd build
$boost_dir=(Resolve-Path $PSScriptRoot\..\deps\boost\lib\cmake\Boost-*)
..\deps\cmake\bin\cmake -G "Visual Studio 16 2019" -DBoost_DIR="$boost_dir\" -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_INSTALL_PREFIX="$PSScriptRoot\..\upload" ..
if ( -not $? ) { throw "CMake configure failed." }
msbuild solidity.sln /p:Configuration=Release /m:5 /v:minimal
if ( -not $? ) { throw "Build failed." }
..\deps\cmake\bin\cmake --build . -j 5 --target install --config Release
if ( -not $? ) { throw "Install target failed." }

View File

@ -1,7 +1,12 @@
$ErrorActionPreference = "Stop"
cd "$PSScriptRoot\.."
.\build\solc\Release\solc.exe --version
if ( -not $? ) { throw "Cannot execute solc --version." }
mkdir test_results
.\build\test\Release\soltest.exe --color_output=no --show_progress=yes --logger=JUNIT,error,test_results/result.xml -- --no-smt
if ( -not $? ) { throw "Unoptimized soltest run failed." }
.\build\test\Release\soltest.exe --color_output=no --show_progress=yes --logger=JUNIT,error,test_results/result_opt.xml -- --optimize --no-smt
if ( -not $? ) { throw "Optimized soltest run failed." }

View File

@ -1,3 +1,5 @@
$ErrorActionPreference = "Stop"
# Needed for Invoke-WebRequest to work via CI.
$progressPreference = "silentlyContinue"
@ -12,4 +14,5 @@ tar -xf boost.zip
cd boost_1_74_0
.\bootstrap.bat
.\b2 -j4 -d0 link=static runtime-link=static variant=release threading=multi address-model=64 --with-filesystem --with-system --with-program_options --with-test --prefix="$PSScriptRoot\..\deps\boost" install
if ( -not $? ) { throw "Error building boost." }
cd ..

View File

@ -1,3 +1,5 @@
$ErrorActionPreference = "Stop"
# Needed for Invoke-WebRequest to work via CI.
$progressPreference = "silentlyContinue"