NewTestProcess creates a dummy process for testing in Go (ie `go test`)
()
| 108 | |
| 109 | // NewTestProcess creates a dummy process for testing in Go (ie `go test`) |
| 110 | func NewTestProcess() (p *Process) { |
| 111 | p = new(Process) |
| 112 | p.Stdin = new(null.Null) |
| 113 | p.Stdout = new(null.Null) |
| 114 | p.Stderr = new(null.Null) |
| 115 | p.Config = config.InitConf.Copy() |
| 116 | p.Variables = NewVariables(p) |
| 117 | p.FileRef = &ref.File{Source: &ref.Source{Module: app.ShellProfile + "/testing"}} |
| 118 | p.Context, p.Done = context.WithTimeout(context.Background(), 60*time.Second) |
| 119 | p.Parent = ShellProcess |
| 120 | p.Scope = ShellProcess |
| 121 | p.Next = ShellProcess |
| 122 | p.Previous = ShellProcess |
| 123 | p.Forks = NewForkManagement() |
| 124 | p.SystemProcess = process.NewSystemProcessStruct() |
| 125 | |
| 126 | GlobalFIDs.Register(p) |
| 127 | |
| 128 | return |
| 129 | } |