forked from microsoft/msquic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDotNetTest.ps1
46 lines (34 loc) · 1.15 KB
/
DotNetTest.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<#
.SYNOPSIS
This script runs .NET tests using previously built MsQuic binaries
#>
param (
[Parameter(Mandatory = $false)]
[ValidateSet("Debug", "Release")]
[string]$Config = "Debug",
[Parameter(Mandatory = $false)]
[ValidateSet("x86", "x64", "arm", "arm64", "universal")]
[string]$Arch = "",
[Parameter(Mandatory = $false)]
[ValidateSet("schannel", "openssl")]
[string]$Tls = "",
[Parameter(Mandatory = $false)]
[string]$ExtraArtifactDir = ""
)
Set-StrictMode -Version 'Latest'
$PSDefaultParameterValues['*:ErrorAction'] = 'Stop'
$BuildConfig = & (Join-Path $PSScriptRoot get-buildconfig.ps1) -Tls $Tls -Arch $Arch -ExtraArtifactDir $ExtraArtifactDir -Config $Config
$Tls = $BuildConfig.Tls
$Arch = $BuildConfig.Arch
$RootArtifactDir = $BuildConfig.ArtifactsDir
if ($IsWindows) {
$LibName = "msquic.dll"
} elseif ($IsMacOS) {
$LibName = "libmsquic.dylib"
} else {
$LibName = "libmsquic.so"
}
# Root directory of the project.
$RootDir = Split-Path $PSScriptRoot -Parent
dotnet build (Join-Path $RootDir src cs)
dotnet run --project (Join-Path $RootDir src cs tool) -- (Join-Path $RootArtifactDir $LibName)