1
0
mirror of https://github.com/golang/go synced 2024-11-08 05:56:12 -07:00
go/test/fixedbugs/bug429_run.go
Cherry Zhang 2e4ceaf963 cmd/dist: enable more tests on macOS/ARM64
Unlike iOS, macOS ARM64 is more of a fully featured OS. Enable
more tests.

Updates #38485.

Change-Id: I2e2240c848d21996db2b950a4a6856987f7a652c
Reviewed-on: https://go-review.googlesource.com/c/go/+/256919
Trust: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-10-06 21:55:49 +00:00

40 lines
828 B
Go

// run
// +build !nacl,!js
// +build !darwin !arm64
// Skip on darwin/arm64 as it requires external linking, which brings in
// cgo, causing deadlock detection not working.
// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Run the bug429.go test.
package main
import (
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
)
func main() {
cmd := exec.Command("go", "run", filepath.Join("fixedbugs", "bug429.go"))
out, err := cmd.CombinedOutput()
if err == nil {
fmt.Println("expected deadlock")
os.Exit(1)
}
want := "fatal error: all goroutines are asleep - deadlock!"
got := string(out)
if !strings.Contains(got, want) {
fmt.Printf("got:\n%q\nshould contain:\n%q\n", got, want)
os.Exit(1)
}
}