1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
//nolint:lll
//go:build !integration && (aix || android || darwin || dragonfly || freebsd || hurd || illumos || linux || netbsd || openbsd || solaris)
// +build !integration
// +build aix android darwin dragonfly freebsd hurd illumos linux netbsd openbsd solaris
package process
import (
"os/exec"
"syscall"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func Test_cmd_Start(t *testing.T) {
c := osCmd{
internal: &exec.Cmd{
SysProcAttr: &syscall.SysProcAttr{
Setpgid: false,
},
},
}
require.False(t, c.internal.SysProcAttr.Setpgid)
_ = c.Start()
assert.True(t, c.internal.SysProcAttr.Setpgid)
}
|