2024-06-04 08:01:11 -07:00
|
|
|
param([string]$targetNetFramework)
|
|
|
|
|
|
|
|
|
|
$rootDirectory = Split-Path $PSScriptRoot -Parent
|
|
|
|
|
$publishOutput = dotnet publish $rootDirectory/test/AutoGen.AotCompatibility.Tests -nodeReuse:false /p:UseSharedCompilation=false /p:ExposeExperimentalFeatures=true
|
|
|
|
|
|
|
|
|
|
$actualWarningCount = 0
|
|
|
|
|
|
|
|
|
|
foreach ($line in $($publishOutput -split "`r`n"))
|
|
|
|
|
{
|
|
|
|
|
if ($line -like "*analysis warning IL*")
|
|
|
|
|
{
|
|
|
|
|
Write-Host $line
|
|
|
|
|
|
|
|
|
|
$actualWarningCount += 1
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-12 16:02:37 -08:00
|
|
|
pushd $rootDirectory/artifacts/bin/AutoGen.AotCompatibility.Tests/release/native
|
2024-06-04 08:01:11 -07:00
|
|
|
|
|
|
|
|
Write-Host "Executing test App..."
|
|
|
|
|
./AutoGen.AotCompatibility.Tests
|
|
|
|
|
Write-Host "Finished executing test App"
|
|
|
|
|
|
|
|
|
|
if ($LastExitCode -ne 0)
|
|
|
|
|
{
|
|
|
|
|
Write-Host "There was an error while executing AotCompatibility Test App. LastExitCode is:", $LastExitCode
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
popd
|
|
|
|
|
|
|
|
|
|
Write-Host "Actual warning count is:", $actualWarningCount
|
|
|
|
|
$expectedWarningCount = 0
|
|
|
|
|
|
|
|
|
|
$testPassed = 0
|
|
|
|
|
if ($actualWarningCount -ne $expectedWarningCount)
|
|
|
|
|
{
|
|
|
|
|
$testPassed = 1
|
|
|
|
|
Write-Host "Actual warning count:", actualWarningCount, "is not as expected. Expected warning count is:", $expectedWarningCount
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Exit $testPassed
|