|
1 | 1 | param([string]$targetNetFramework) |
2 | 2 |
|
3 | 3 | $rootDirectory = Split-Path $PSScriptRoot -Parent |
4 | | -$publishOutput = dotnet publish $rootDirectory/test/OpenTelemetry.AotCompatibility.TestApp/OpenTelemetry.AotCompatibility.TestApp.csproj -nodeReuse:false /p:UseSharedCompilation=false /p:ExposeExperimentalFeatures=true |
| 4 | +$publishOutput = dotnet publish $rootDirectory/test/OpenTelemetry.AotCompatibility.TestApp/OpenTelemetry.AotCompatibility.TestApp.csproj --framework $targetNetFramework -nodeReuse:false /p:UseSharedCompilation=false /p:ExposeExperimentalFeatures=true |
5 | 5 |
|
6 | 6 | $actualWarningCount = 0 |
7 | 7 |
|
8 | 8 | foreach ($line in $($publishOutput -split "`r`n")) |
9 | 9 | { |
10 | | - if ($line -like "*analysis warning IL*") |
| 10 | + if (($line -like "*analysis warning IL*") -or ($line -like "*analysis error IL*")) |
11 | 11 | { |
12 | 12 | Write-Host $line |
13 | | - |
14 | 13 | $actualWarningCount += 1 |
15 | 14 | } |
16 | 15 | } |
17 | 16 |
|
18 | | -pushd $rootDirectory/test/OpenTelemetry.AotCompatibility.TestApp/bin/Release/$targetNetFramework/linux-x64 |
| 17 | +Write-Host "Actual warning count is:", $actualWarningCount |
| 18 | +$expectedWarningCount = 0 |
| 19 | + |
| 20 | +if ($LastExitCode -ne 0) |
| 21 | +{ |
| 22 | + Write-Host "There was an error while publishing AotCompatibility Test App. LastExitCode is:", $LastExitCode |
| 23 | + Write-Host $publishOutput |
| 24 | +} |
| 25 | + |
| 26 | +$runtime = $IsWindows ? "win-x64" : ($IsMacOS ? "macos-x64" : "linux-x64") |
| 27 | +$app = $IsWindows ? "./OpenTelemetry.AotCompatibility.TestApp.exe" : "./OpenTelemetry.AotCompatibility.TestApp" |
| 28 | + |
| 29 | +Push-Location $rootDirectory/test/OpenTelemetry.AotCompatibility.TestApp/bin/Release/$targetNetFramework/$runtime |
19 | 30 |
|
20 | 31 | Write-Host "Executing test App..." |
21 | | -./OpenTelemetry.AotCompatibility.TestApp |
| 32 | +$app |
22 | 33 | Write-Host "Finished executing test App" |
23 | 34 |
|
24 | 35 | if ($LastExitCode -ne 0) |
25 | 36 | { |
26 | 37 | Write-Host "There was an error while executing AotCompatibility Test App. LastExitCode is:", $LastExitCode |
27 | 38 | } |
28 | 39 |
|
29 | | -popd |
30 | | - |
31 | | -Write-Host "Actual warning count is:", $actualWarningCount |
32 | | -$expectedWarningCount = 0 |
| 40 | +Pop-Location |
33 | 41 |
|
34 | 42 | $testPassed = 0 |
35 | 43 | if ($actualWarningCount -ne $expectedWarningCount) |
|
0 commit comments