mirror of
https://github.com/golang/go
synced 2024-11-24 18:50:05 -07:00
e7173dfdfd
* bug248, bug345, bug369, and bug429 were ported from bash commands to run scripts. bug369 remains disabled. * bug395 is a test for issue 1909, which is still open. It is marked as skip now and will be usable with compile with run.go when issue 1909 is fixed. Fixes #4139 Updates #1909 Change-Id: Ibb5fbfb5cf72ddc285829245318eeacd3fb5a636 Reviewed-on: https://go-review.googlesource.com/1774 Reviewed-by: Russ Cox <rsc@golang.org>
35 lines
676 B
Go
35 lines
676 B
Go
// +build !nacl
|
|
// run
|
|
|
|
// 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)
|
|
}
|
|
}
|