|
1 | | -param([string]$targetNetFramework) |
2 | | - |
3 | | -$rootDirectory = Split-Path $PSScriptRoot -Parent |
4 | | -$publishOutput = dotnet publish $rootDirectory/test/OpenTelemetry.AotCompatibility.TestApp/OpenTelemetry.AotCompatibility.TestApp.csproj -nodeReuse:false /p:UseSharedCompilation=false |
5 | | - |
6 | | -$actualWarningCount = 0 |
7 | | - |
8 | | -foreach ($line in $($publishOutput -split "`r`n")) |
9 | | -{ |
10 | | - if ($line -like "*analysis warning IL*") |
11 | | - { |
12 | | - Write-Host $line |
13 | | - $actualWarningCount += 1 |
14 | | - } |
15 | | -} |
16 | | - |
17 | | -pushd $rootDirectory/test/OpenTelemetry.AotCompatibility.TestApp/bin/Debug/$targetNetFramework/linux-x64 |
18 | | - |
19 | | -Write-Host "Executing test App..." |
20 | | -./OpenTelemetry.AotCompatibility.TestApp |
21 | | -Write-Host "Finished executing test App" |
22 | | - |
23 | | -if ($LastExitCode -ne 0) |
24 | | -{ |
25 | | - Write-Host "There was an error while executing AotCompatibility Test App. LastExitCode is:", $LastExitCode |
26 | | -} |
27 | | - |
28 | | -popd |
29 | | - |
30 | | -Write-Host "Actual warning count is:", $actualWarningCount |
31 | | -$expectedWarningCount = 28 |
32 | | - |
33 | | -$testPassed = 0 |
34 | | -if ($actualWarningCount -ne $expectedWarningCount) |
35 | | -{ |
36 | | - $testPassed = 1 |
37 | | - Write-Host "Actual warning count:", actualWarningCount, "is not as expected. Expected warning count is:", $expectedWarningCount |
38 | | -} |
39 | | - |
40 | | -Exit $testPassed |
| 1 | +param([string]$targetNetFramework) |
| 2 | + |
| 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 |
| 5 | + |
| 6 | +$actualWarningCount = 0 |
| 7 | + |
| 8 | +foreach ($line in $($publishOutput -split "`r`n")) |
| 9 | +{ |
| 10 | + if ($line -like "*analysis warning IL*") |
| 11 | + { |
| 12 | + Write-Host $line |
| 13 | + $actualWarningCount += 1 |
| 14 | + } |
| 15 | +} |
| 16 | + |
| 17 | +pushd $rootDirectory/test/OpenTelemetry.AotCompatibility.TestApp/bin/Debug/$targetNetFramework/linux-x64 |
| 18 | + |
| 19 | +Write-Host "Executing test App..." |
| 20 | +./OpenTelemetry.AotCompatibility.TestApp |
| 21 | +Write-Host "Finished executing test App" |
| 22 | + |
| 23 | +if ($LastExitCode -ne 0) |
| 24 | +{ |
| 25 | + Write-Host "There was an error while executing AotCompatibility Test App. LastExitCode is:", $LastExitCode |
| 26 | +} |
| 27 | + |
| 28 | +popd |
| 29 | + |
| 30 | +Write-Host "Actual warning count is:", $actualWarningCount |
| 31 | +$expectedWarningCount = 28 |
| 32 | + |
| 33 | +$testPassed = 0 |
| 34 | +if ($actualWarningCount -ne $expectedWarningCount) |
| 35 | +{ |
| 36 | + $testPassed = 1 |
| 37 | + Write-Host "Actual warning count:", actualWarningCount, "is not as expected. Expected warning count is:", $expectedWarningCount |
| 38 | +} |
| 39 | + |
| 40 | +Exit $testPassed |
0 commit comments