From 12039a0e63377e86fa1b5adc3d327d6e07f23a32 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Fri, 26 Sep 2025 15:24:20 +0200 Subject: pkg/osutil: make VerboseError nest other errors After this change it fits more naturally into the Go's error functionality. --- pkg/cover/report_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkg/cover') diff --git a/pkg/cover/report_test.go b/pkg/cover/report_test.go index 96b634cc6..c3d3231fb 100644 --- a/pkg/cover/report_test.go +++ b/pkg/cover/report_test.go @@ -11,6 +11,7 @@ import ( "bytes" "encoding/csv" "encoding/json" + "errors" "fmt" "os" "path/filepath" @@ -283,7 +284,8 @@ func buildTestBinary(t *testing.T, target *targets.Target, test *Test, dir strin } if _, err := osutil.RunCmd(time.Hour, "", target.CCompiler, ldflags...); err != nil { // Arm linker in the env image has a bug when linking a clang-produced files. - if regexp.MustCompile(`arm-linux-gnueabi.* assertion fail`).MatchString(err.Error()) { + var vErr *osutil.VerboseError + if errors.As(err, &vErr) && regexp.MustCompile(`arm-linux-gnueabi.* assertion fail`).Match(vErr.Output) { t.Skipf("skipping test, broken arm linker (%v)", err) } t.Fatal(err) -- cgit mrf-deployment