param([Parameter(Mandatory=$true)][string]$Toolchain) $ErrorActionPreference='Stop' & "$PSScriptRoot/build.ps1" -Toolchain $Toolchain $oldVBCC=$env:VBCC $oldPath=$env:PATH try { $env:VBCC=Join-Path $PSScriptRoot 'build/vbcc' $env:PATH=(Join-Path $Toolchain 'bin')+';'+$env:PATH & (Join-Path $Toolchain 'bin/vc.exe') +boing -O2 -c99 -o "$PSScriptRoot/build/CoreTests" "$PSScriptRoot/core-tests.c" "$PSScriptRoot/terminal.c" if($LASTEXITCODE -ne 0){throw 'Test build failed.'} & (Join-Path $Toolchain 'bin/vc.exe') +boing -O2 -c99 -o "$PSScriptRoot/build/BellTest" "$PSScriptRoot/bell-smoke.c" if($LASTEXITCODE -ne 0){throw 'Bell test build failed.'} } finally {$env:VBCC=$oldVBCC;$env:PATH=$oldPath}