ldd: treat nil pathname as self
All checks were successful
Test / Create distribution (push) Successful in 56s
Test / Sandbox (push) Successful in 2m35s
Test / Hakurei (push) Successful in 3m46s
Test / ShareFS (push) Successful in 3m51s
Test / Hpkg (push) Successful in 4m21s
Test / Sandbox (race detector) (push) Successful in 4m54s
Test / Hakurei (race detector) (push) Successful in 5m53s
Test / Flake checks (push) Successful in 1m46s

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