Skip to content

Commit 28d99ca

Browse files
CopilotT-Gro
andcommitted
Update check.ps1 to report actual file sizes when expected length is placeholder -1
Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com>
1 parent b4058d7 commit 28d99ca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/AheadOfTime/Trimming/check.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ function CheckTrim($root, $tfm, $outputfile, $expected_len) {
3333
# Checking that the trimmed outputfile binary is of expected size (needs adjustments if test is updated).
3434
$file = Get-Item (Join-Path $PSScriptRoot "${root}\bin\release\${tfm}\win-x64\publish\${outputfile}")
3535
$file_len = $file.Length
36-
if (-not ($expected_len -eq -1 -or $file_len -eq $expected_len))
36+
if ($expected_len -eq -1)
37+
{
38+
Write-Host "Actual ${tfm} - trimmed ${outputfile} length: ${file_len} Bytes (expected length is placeholder -1, update test with this actual value)"
39+
}
40+
elseif ($file_len -ne $expected_len)
3741
{
3842
Write-Error "Test failed with unexpected ${tfm} - trimmed ${outputfile} length:`nExpected:`n`t${expected_len} Bytes`nActual:`n`t${file_len} Bytes`nEither codegen or trimming logic have changed. Please investigate and update expected dll size or report an issue." -ErrorAction Stop
3943
}

0 commit comments

Comments
 (0)