ldd: treat nil pathname as self

This is a helpful shortcut for examining a test program's ldd output.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-02-28 20:37:01 +09:00
parent cd9b534d6b
commit 4b0cce4db5
2 changed files with 14 additions and 2 deletions

View File

@@ -34,7 +34,7 @@ func TestExec(t *testing.T) {
t.Run("success", func(t *testing.T) {
msg := message.New(nil)
msg.GetLogger().SetPrefix("check: ")
if entries, err := ldd.Resolve(t.Context(), nil, check.MustAbs(container.MustExecutable(msg))); err != nil {
if entries, err := ldd.Resolve(t.Context(), nil, nil); err != nil {
t.Fatalf("Exec: error = %v", err)
} else if testing.Verbose() {
// result cannot be measured here as build information is not known