Skip to content

Commit

Permalink
(#55) Test: macOS library output fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed May 26, 2024
1 parent 309b0db commit a32d663
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions macos/Test-Dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,23 @@ Get-ChildItem "$Package/*.dylib" | Sort-Object -Property Name | ForEach-Object {
$libraryPath = $_.FullName

Write-Output "Checking file `"$libraryPath`""
$output = & $LddApple $libraryPath
$output = & $LddApple $libraryPath *>&1
if (!$?) {
throw "ldd-apple returned an exit code $LASTEXITCODE."
}

Write-Output "Output from ldd-apple $($libraryPath):"
Write-Output $output

$libraryNames = $output | ForEach-Object {
$filePath = $_.Trim().Split(' ')[0]
$filePath
$libraryNames = $output | Where-Object { ([string]$_).Contains('dyld: loaded') } | ForEach-Object {
if (!($_ -match 'dyld: loaded: <.*?> (.*)')) {
throw "Failed to parse ldd-apple output: $_"
}

$filePath = $Matches[1]
if ($filePath -ne $libraryPath) {
$filePath
}
} | Sort-Object
$_.Name >> $ResultFile
$libraryNames | ForEach-Object { " $_" >> $ResultFile }
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit a32d663

Please sign in to comment.