NO-JIRA: Fix Go example tests to run without GOPATH set.
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/63cd40f4 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/63cd40f4 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/63cd40f4 Branch: refs/heads/master Commit: 63cd40f4ff2269dff69f8831524a0c8e3582e93f Parents: 43eb7f0 Author: Alan Conway <[email protected]> Authored: Mon Oct 12 16:43:24 2015 -0400 Committer: Alan Conway <[email protected]> Committed: Tue Oct 13 10:59:42 2015 -0400 ---------------------------------------------------------------------- examples/go/CMakeLists.txt | 4 ++-- examples/go/example_test.go | 1 + proton-c/bindings/go/CMakeLists.txt | 10 ++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/63cd40f4/examples/go/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/examples/go/CMakeLists.txt b/examples/go/CMakeLists.txt index 76487fd..67c6cd7 100644 --- a/examples/go/CMakeLists.txt +++ b/examples/go/CMakeLists.txt @@ -32,12 +32,12 @@ if(BUILD_GO) add_test( NAME go_example_electron_test - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/example_test -dir ${CMAKE_CURRENT_BINARY_DIR}/electron -broker broker) + COMMAND ${GO_ENV} ${CMAKE_CURRENT_BINARY_DIR}/example_test -dir ${CMAKE_CURRENT_BINARY_DIR}/electron -broker broker) add_test( NAME go_example_proton_test - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/example_test -dir ${CMAKE_CURRENT_BINARY_DIR}/electron -broker ../proton/broker) + COMMAND ${GO_ENV} ${CMAKE_CURRENT_BINARY_DIR}/example_test -dir ${CMAKE_CURRENT_BINARY_DIR}/electron -broker ../proton/broker) list(APPEND ADDITIONAL_MAKE_CLEAN_FILES ${examples}) endif() http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/63cd40f4/examples/go/example_test.go ---------------------------------------------------------------------- diff --git a/examples/go/example_test.go b/examples/go/example_test.go index 1e497b9..479864c 100644 --- a/examples/go/example_test.go +++ b/examples/go/example_test.go @@ -113,6 +113,7 @@ func checkStaleLibs(t *testing.T) { var stale []string pp := "qpid.apache.org" for _, p := range []string{pp + "/proton", pp + "/amqp", pp + "/electron"} { + t.Log("FIXME", os.Getenv("GOPATH")) out, err := exec.Command("go", "list", "-f", "{{.Stale}}", p).CombinedOutput() if err != nil { t.Fatalf("failed to execute 'go list': %v\n%v", err, string(out)) http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/63cd40f4/proton-c/bindings/go/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/proton-c/bindings/go/CMakeLists.txt b/proton-c/bindings/go/CMakeLists.txt index 11a3b78..27d2349 100644 --- a/proton-c/bindings/go/CMakeLists.txt +++ b/proton-c/bindings/go/CMakeLists.txt @@ -41,11 +41,13 @@ set(GO_ENV ${env_py} -- "GOPATH=${CMAKE_CURRENT_SOURCE_DIR}" "CGO_CFLAGS=-I${CMAKE_SOURCE_DIR}/proton-c/include" "CGO_LDFLAGS=-L${CMAKE_BINARY_DIR}/proton-c" - ${GO_EXE} CACHE INTERNAL "Run go with environment set") + CACHE INTERNAL "Run a command with Go environment variables") -set(GO_BUILD ${GO_ENV} build ${GO_BUILD_FLAGS} ${GO_RPATH_FLAGS} CACHE INTERNAL "Run go build") -set(GO_INSTALL ${GO_ENV} install ${GO_BUILD_FLAGS} CACHE INTERNAL "Run go install") -set(GO_TEST ${GO_ENV} test ${GO_BUILD_FLAGS} ${GO_RPATH_FLAGS} ${GO_TEST_FLAGS} CACHE INTERNAL "Run go test") +set(GO ${GO_ENV} ${GO_EXE} CACHE INTERNAL "Run go with environment set") + +set(GO_BUILD ${GO} build ${GO_BUILD_FLAGS} ${GO_RPATH_FLAGS} CACHE INTERNAL "Run go build") +set(GO_INSTALL ${GO} install ${GO_BUILD_FLAGS} CACHE INTERNAL "Run go install") +set(GO_TEST ${GO} test ${GO_BUILD_FLAGS} ${GO_RPATH_FLAGS} ${GO_TEST_FLAGS} CACHE INTERNAL "Run go test") # Install packages in the source tree, go tools aren't friendly otherwise. # All build output goes in git-ignored pkg or bin subdirectories. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
