Skip to content

Commit 31ca9db

Browse files
committed
(ForNeVeR#55) Test: fix ldd-apple output parsing
1 parent a32d663 commit 31ca9db

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

macos/Test-Dependencies.ps1

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,16 @@ Get-ChildItem "$Package/*.dylib" | Sort-Object -Property Name | ForEach-Object {
3232
Write-Output "Output from ldd-apple $($libraryPath):"
3333
Write-Output $output
3434

35-
$libraryNames = $output | Where-Object { ([string]$_).Contains('dyld: loaded') } | ForEach-Object {
36-
if (!($_ -match 'dyld: loaded: <.*?> (.*)')) {
35+
$libraryNames = $output | Where-Object {
36+
[string]$line = $_
37+
$line.StartsWith('dyld[') -or $line.StartsWith('dyld: loaded:')
38+
} | ForEach-Object {
39+
if (!($_ -match 'dyld(?:: loaded|\[\d+\]): <.*?> (.*)')) {
3740
throw "Failed to parse ldd-apple output: $_"
3841
}
3942

4043
$filePath = $Matches[1]
41-
if ($filePath -ne $libraryPath) {
44+
if ($filePath -ne $libraryPath -and !$filePath.Contains('cpp.exec')) {
4245
$filePath
4346
}
4447
} | Sort-Object

0 commit comments

Comments
 (0)