Debian Codegraph @

libgo/go/os/exec_unix_test.go

raw
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
7 package os_test
8
9 import (
10 "internal/testenv"
11 . "os"
12 "testing"
13 )
14
15 func TestErrProcessDone(t *testing.T) {
16 testenv.MustHaveGoBuild(t)
17 path, err := testenv.GoTool()
18 if err != nil {
19 t.Errorf("finding go tool: %v", err)
20 }
21 p, err := StartProcess(path, []string{"go"}, &ProcAttr{})
22 if err != nil {
23 t.Errorf("starting test process: %v", err)
24 }
25 p.Wait()
26 if got := p.Signal(Kill); got != ErrProcessDone {
27 t.Errorf("got %v want %v", got, ErrProcessDone)
28 }
29 }