proc: Implement target.Interface for gdbserver backend

This commit is contained in:
aarzilli
2017-02-10 15:11:40 +01:00
committed by Derek Parker
parent c1879472a1
commit c8d9352522
24 changed files with 3078 additions and 294 deletions

View File

@ -1,6 +1,7 @@
package terminal
import (
"flag"
"fmt"
"io/ioutil"
"net"
@ -17,6 +18,20 @@ import (
"github.com/derekparker/delve/service/rpccommon"
)
var testBackend string
func TestMain(m *testing.M) {
flag.StringVar(&testBackend, "backend", "", "selects backend")
flag.Parse()
if testBackend == "" {
testBackend = os.Getenv("PROCTEST")
if testBackend == "" {
testBackend = "native"
}
}
os.Exit(m.Run())
}
type FakeTerminal struct {
*Term
t testing.TB
@ -81,6 +96,7 @@ func withTestTerminal(name string, t testing.TB, fn func(*FakeTerminal)) {
server := rpccommon.NewServer(&service.Config{
Listener: listener,
ProcessArgs: []string{test.BuildFixture(name).Path},
Backend: testBackend,
}, false)
if err := server.Run(); err != nil {
t.Fatal(err)