2016-02-15 15:14:07 +00:00
|
|
|
// +build linux darwin
|
|
|
|
|
|
|
|
package proc
|
|
|
|
|
|
|
|
import (
|
2016-02-25 09:48:42 +00:00
|
|
|
"syscall"
|
2016-02-15 15:14:07 +00:00
|
|
|
"testing"
|
|
|
|
"time"
|
|
|
|
|
2017-02-08 16:00:44 +00:00
|
|
|
protest "github.com/derekparker/delve/pkg/proc/test"
|
2016-02-15 15:14:07 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestIssue419(t *testing.T) {
|
|
|
|
// SIGINT directed at the inferior should be passed along not swallowed by delve
|
|
|
|
withTestProcess("issue419", t, func(p *Process, fixture protest.Fixture) {
|
|
|
|
go func() {
|
|
|
|
for {
|
|
|
|
if p.Running() {
|
|
|
|
time.Sleep(2 * time.Second)
|
2017-02-08 00:23:47 +00:00
|
|
|
err := syscall.Kill(p.pid, syscall.SIGINT)
|
2016-02-15 15:14:07 +00:00
|
|
|
assertNoError(err, t, "syscall.Kill")
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}()
|
2017-02-22 08:35:21 +00:00
|
|
|
err := Continue(p)
|
2016-02-15 15:14:07 +00:00
|
|
|
if _, exited := err.(ProcessExitedError); !exited {
|
|
|
|
t.Fatalf("Unexpected error after Continue(): %v\n", err)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|