diff --git a/Makefile b/Makefile index 5d54368d..e794dc01 100644 --- a/Makefile +++ b/Makefile @@ -68,4 +68,4 @@ test-proc-run: go test $(TEST_FLAGS) $(BUILD_FLAGS) -test.v -test.run="$(RUN)" $(PREFIX)/pkg/proc test-integration-run: - go test $(TEST_FLAGS) $(BUILD_FLAGS) -test.run="$(RUN)" $(PREFIX)/pkg/service/test + go test $(TEST_FLAGS) $(BUILD_FLAGS) -test.run="$(RUN)" $(PREFIX)/service/test diff --git a/cmd/dlv/dlv_test.go b/cmd/dlv/dlv_test.go index 2b424e57..3fd2a224 100644 --- a/cmd/dlv/dlv_test.go +++ b/cmd/dlv/dlv_test.go @@ -6,6 +6,7 @@ import ( "os/exec" "path/filepath" "runtime" + "strings" "testing" protest "github.com/derekparker/delve/pkg/proc/test" @@ -20,9 +21,20 @@ func assertNoError(err error, t testing.TB, s string) { } } +func goEnv(name string) string { + if val := os.Getenv(name); val != "" { + return val + } + val, err := exec.Command("go", "env", name).Output() + if err != nil { + panic(err) // the Go tool was tested to work earlier + } + return strings.TrimSpace(string(val)) +} + func TestBuild(t *testing.T) { const listenAddr = "localhost:40573" - makefilepath := filepath.Join(os.Getenv("GOPATH"), "src", "github.com", "derekparker", "delve", "Makefile") + makefilepath := filepath.Join(goEnv("GOPATH"), "src", "github.com", "derekparker", "delve", "Makefile") t.Logf("makefile: %q", makefilepath) var err error for _, make := range []string{"make", "mingw32-make"} { diff --git a/scripts/gen-cli-docs.go b/scripts/gen-cli-docs.go index 6dac753b..d8fdb8d3 100644 --- a/scripts/gen-cli-docs.go +++ b/scripts/gen-cli-docs.go @@ -5,7 +5,7 @@ import ( "log" "os" - "github.com/derekparker/delve/terminal" + "github.com/derekparker/delve/pkg/terminal" ) func main() {