From 751b8798dd3a0b099ec403bafae0d48d5c5fae8c Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 10 Mar 2022 23:30:07 -0500 Subject: [PATCH] cmd/compile/internal/amd64: fix "missing objdump" skip in TestGoAMD64v1 The skip was erroneously applied to errors from the call to StdoutPipe instead of Start, and even then was a bit too broad. Change-Id: I417c9a74692383230fc6d99ebb4149fdc532533e Reviewed-on: https://go-review.googlesource.com/c/go/+/391800 Trust: Bryan Mills Run-TryBot: Bryan Mills Reviewed-by: Ian Lance Taylor TryBot-Result: Gopher Robot --- src/cmd/compile/internal/amd64/versions_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/amd64/versions_test.go b/src/cmd/compile/internal/amd64/versions_test.go index 7aa697b811..78e87d0ad4 100644 --- a/src/cmd/compile/internal/amd64/versions_test.go +++ b/src/cmd/compile/internal/amd64/versions_test.go @@ -8,6 +8,7 @@ import ( "bufio" "debug/elf" "debug/macho" + "errors" "fmt" "internal/testenv" "io" @@ -115,9 +116,12 @@ func clobber(t *testing.T, src string, dst *os.File, opcodes map[string]bool) { var err error disasm, err = cmd.StdoutPipe() if err != nil { - t.Skipf("can't run test due to missing objdump: %s", err) + t.Fatal(err) } if err := cmd.Start(); err != nil { + if errors.Is(err, exec.ErrNotFound) { + t.Skipf("can't run test due to missing objdump: %s", err) + } t.Fatal(err) } re = regexp.MustCompile(`^\s*([0-9a-f]+):\s*((?:[0-9a-f][0-9a-f] )+)\s*([a-z0-9]+)`)