github.com/code-reading/golang@v0.0.0-20220303082512-ba5bc0e589a3/go/src/os/exec_unix_test.go (about) 1 // Copyright 2020 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris 6 // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 7 8 package os_test 9 10 import ( 11 "internal/testenv" 12 . "os" 13 "testing" 14 ) 15 16 func TestErrProcessDone(t *testing.T) { 17 testenv.MustHaveGoBuild(t) 18 path, err := testenv.GoTool() 19 if err != nil { 20 t.Errorf("finding go tool: %v", err) 21 } 22 p, err := StartProcess(path, []string{"go"}, &ProcAttr{}) 23 if err != nil { 24 t.Errorf("starting test process: %v", err) 25 } 26 p.Wait() 27 if got := p.Signal(Kill); got != ErrProcessDone { 28 t.Errorf("got %v want %v", got, ErrProcessDone) 29 } 30 }