|
| 1 | +# Dump the environment to see what we're working with. |
| 2 | +& "$Env:SYSTEM_DEFAULTWORKINGDIRECTORY\xamarin-macios\tools\devops\automation\scripts\show_env.ps1" |
| 3 | + |
| 4 | +# Set a few variables |
| 5 | +$Env:DOTNET = "$Env:BUILD_SOURCESDIRECTORY\xamarin-macios\tests\dotnet\Windows\bin\dotnet\dotnet.exe" |
| 6 | +$Env:DOTNET_DIR = "$Env:BUILD_SOURCESDIRECTORY\xamarin-macios\tests\dotnet\Windows\bin\dotnet\" |
| 7 | +$Env:TESTS_USE_SYSTEM = "1" |
| 8 | + |
| 9 | +# Compute the <platform>_NUGET_VERSION_NO_METADATA variables and set them in the environment |
| 10 | +$configurationDotNetPlatforms = $Env:CONFIGURATION_DOTNET_PLATFORMS |
| 11 | +$dotnetPlatforms = $configurationDotNetPlatforms.Split(' ', [StringSplitOptions]::RemoveEmptyEntries) |
| 12 | +foreach ($platform in $dotnetPlatforms) { |
| 13 | + $manifestPath = "$Env:BUILD_SOURCESDIRECTORY\artifacts\AssetManifests\$($platform)\AssetManifest.xml" |
| 14 | + $productVersion = Select-Xml -Path "$manifestPath" -XPath "/Build/Package[@Id='Microsoft.$($platform).Sdk']/@Version" | ForEach-Object { $_.Node.Value } |
| 15 | + $variableName = "$($platform.ToUpper())_NUGET_VERSION_NO_METADATA" |
| 16 | + [Environment]::SetEnvironmentVariable($variableName, $productVersion) |
| 17 | + Write-Host "$variableName = $productVersion" |
| 18 | +} |
| 19 | + |
| 20 | +# Tell the tests how they can execute the C# compiler |
| 21 | +$csc = Get-ChildItem "$Env:BUILD_SOURCESDIRECTORY\xamarin-macios\tests\dotnet\Windows\bin\dotnet" -Include csc.dll -Recurse -File | %{$_.FullName} |
| 22 | +$Env:DOTNET_CSC_COMMAND = "$Env:DOTNET exec $csc".Replace("\", "/") |
| 23 | +Write-Host "DOTNET_CSC_COMMAND: $Env:DOTNET_CSC_COMMAND" |
| 24 | + |
| 25 | +# Tell the tests where the BCL is |
| 26 | +$Env:DOTNET_BCL_DIR = Get-ChildItem "$Env:BUILD_SOURCESDIRECTORY\xamarin-macios\tests\dotnet\Windows\bin\dotnet\packs\Microsoft.NETCore.App.Ref" -Include System.dll -Recurse -File | %{$_.DirectoryName} |
| 27 | +Write-Host "DOTNET_BCL_DIR: $Env:DOTNET_BCL_DIR" |
| 28 | + |
| 29 | +# Finally we can run the tests |
| 30 | +& $Env:BUILD_SOURCESDIRECTORY\xamarin-macios\tests\dotnet\Windows\bin\dotnet\dotnet.exe ` |
| 31 | + test ` |
| 32 | + "$Env:BUILD_SOURCESDIRECTORY/xamarin-macios/tests/bgen/bgen-tests.csproj" ` |
| 33 | + "--results-directory:$Env:BUILD_SOURCESDIRECTORY/xamarin-macios/jenkins-results/windows/bgen-tests/" ` |
| 34 | + "--logger:console;verbosity=detailed" ` |
| 35 | + "--logger:trx;LogFileName=$Env:BUILD_SOURCESDIRECTORY/xamarin-macios/jenkins-results/windows/bgen-tests/results.trx" ` |
| 36 | + "--logger:html;LogFileName=$Env:BUILD_SOURCESDIRECTORY/xamarin-macios/jenkins-results/windows/bgen-tests/results.html" ` |
| 37 | + "-bl:$Env:BUILD_SOURCESDIRECTORY/xamarin-macios/jenkins-results/windows/bgen-tests/results.binlog" |
0 commit comments