Add Helpers to PowerShell Scripts (#317)

This commit is contained in:
Nick Banks 2020-04-13 14:49:45 -07:00 коммит произвёл GitHub
Родитель 3dd9a54757
Коммит 41cf853920
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 33 добавлений и 6 удалений

Просмотреть файл

@ -77,7 +77,12 @@ function Log($msg) {
# Make sure the executable is present.
if (!(Test-Path $Path)) {
Write-Error "[$(Get-Date)] $($Path) does not exist!"
Write-Error "$($Path) does not exist!"
}
# Make sure procdump is installed on Windows.
if ($IsWindows -and !(Test-Path ($RootDir + "\bld\tools\procdump64.exe"))) {
Write-Error "Procdump not installed!`n `nRun the following to install it:`n `n $(Join-Path $RootDir ".azure" "scripts" "install-procdump.ps1")`n"
}
# Root directory of the project.

Просмотреть файл

@ -105,7 +105,12 @@ function Log($msg) {
# Make sure the test executable is present.
if (!(Test-Path $Path)) {
Write-Error "[$(Get-Date)] $($Path) does not exist!"
Write-Error "$($Path) does not exist!"
}
# Make sure procdump is installed on Windows.
if ($IsWindows -and !(Test-Path ($RootDir + "\bld\tools\procdump64.exe"))) {
Write-Error "Procdump not installed!`n `nRun the following to install it:`n `n $(Join-Path $RootDir ".azure" "scripts" "install-procdump.ps1")`n"
}
# Root directory of the project.

Просмотреть файл

@ -69,15 +69,20 @@ $RootDir = Split-Path $PSScriptRoot -Parent
$RunExecutable = Join-Path $RootDir ".azure/scripts/run-executable.ps1"
# Path to the quicinterop exectuable.
$SpinQuic = $null
$QuicInterop = $null
if ($IsWindows) {
$SpinQuic = Join-Path $RootDir "\artifacts\windows\$($Arch)_$($Config)_$($Tls)\quicinterop.exe"
$QuicInterop = Join-Path $RootDir "\artifacts\windows\$($Arch)_$($Config)_$($Tls)\quicinterop.exe"
} else {
$SpinQuic = Join-Path $RootDir "/artifacts/linux/$($Arch)_$($Config)_$($Tls)/quicinterop"
$QuicInterop = Join-Path $RootDir "/artifacts/linux/$($Arch)_$($Config)_$($Tls)/quicinterop"
}
# Make sure the build is present.
if (!(Test-Path $QuicInterop)) {
Write-Error "Build does not exist!`n `nRun the following to generate it:`n `n $(Join-Path $RootDir "scripts" "build.ps1") -Config $Config -Arch $Arch -Tls $Tls`n"
}
# Build up all the arguments to pass to the Powershell script.
$Arguments = "-Path $($SpinQuic) -ShowOutput"
$Arguments = "-Path $($QuicInterop) -ShowOutput"
if ($KeepOutputOnSuccess) {
$Arguments += " -KeepOutputOnSuccess"
}

Просмотреть файл

@ -21,6 +21,8 @@ param (
[string]$Configuration
)
#Requires -RunAsAdministrator
Set-StrictMode -Version 'Latest'
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'

Просмотреть файл

@ -82,6 +82,11 @@ if ($IsWindows) {
$SpinQuic = Join-Path $RootDir "/artifacts/linux/$($Arch)_$($Config)_$($Tls)/spinquic"
}
# Make sure the build is present.
if (!(Test-Path $SpinQuic)) {
Write-Error "Build does not exist!`n `nRun the following to generate it:`n `n $(Join-Path $RootDir "scripts" "build.ps1") -Config $Config -Arch $Arch -Tls $Tls`n"
}
# Build up all the arguments to pass to the Powershell script.
$Arguments = "-Path $($SpinQuic) -Arguments 'both -timeout:$($Timeout)' -ShowOutput"
if ($KeepOutputOnSuccess) {

Просмотреть файл

@ -151,6 +151,11 @@ if ($IsWindows) {
$MsQuicPlatTest = Join-Path $RootDir "/artifacts/linux/$($Arch)_$($Config)_$($Tls)/msquicplatformtest"
}
# Make sure the build is present.
if (!(Test-Path $MsQuicTest)) {
Write-Error "Build does not exist!`n `nRun the following to generate it:`n `n $(Join-Path $RootDir "scripts" "build.ps1") -Config $Config -Arch $Arch -Tls $Tls`n"
}
# Build up all the arguments to pass to the Powershell script.
$TestArguments = "-ExecutionMode $($ExecutionMode) -IsolationMode $($IsolationMode)"