Skip to content

Commit

Permalink
runtime: log stderr in TestLockRankGenerated on failure
Browse files Browse the repository at this point in the history
For golang#62334.

Change-Id: I6d93dacc914590ef9c5a034dd4633466ec0bde8d
Reviewed-on: https://go-review.googlesource.com/c/go/+/524056
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Auto-Submit: Bryan Mills <[email protected]>
Run-TryBot: Bryan Mills <[email protected]>
  • Loading branch information
Bryan C. Mills authored and gopherbot committed Aug 29, 2023
1 parent a9d4b2d commit fcb75c8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/runtime/lockrank_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ import (
// Test that the generated code for the lock rank graph is up-to-date.
func TestLockRankGenerated(t *testing.T) {
testenv.MustHaveGoRun(t)
want, err := testenv.CleanCmdEnv(exec.Command(testenv.GoToolPath(t), "run", "mklockrank.go")).CombinedOutput()
cmd := testenv.CleanCmdEnv(testenv.Command(t, testenv.GoToolPath(t), "run", "mklockrank.go"))
want, err := cmd.Output()
if err != nil {
t.Fatal(err)
if ee, ok := err.(*exec.ExitError); ok && len(ee.Stderr) > 0 {
t.Fatalf("%v: %v\n%s", cmd, err, ee.Stderr)
}
t.Fatalf("%v: %v", cmd, err)
}
got, err := os.ReadFile("lockrank.go")
if err != nil {
Expand Down

0 comments on commit fcb75c8

Please sign in to comment.