diff options
| author | David Crawshaw <crawshaw@golang.org> | 2016-08-26 09:04:27 -0400 |
|---|---|---|
| committer | David Crawshaw <crawshaw@golang.org> | 2016-09-16 17:55:24 +0000 |
| commit | 1df438f79c440ddf9bdd342f089a55567254bc9a (patch) | |
| tree | cdbc54f277e5f5ffb37ab4cfbaed4004bbf6990b /misc/cgo/testplugin/test.bash | |
| parent | c19382319abd444592a02e819db87fe77d9a888c (diff) | |
| download | go-1df438f79c440ddf9bdd342f089a55567254bc9a.tar.xz | |
misc/cgo/testplugin: add test of -buildmode=plugin
Change-Id: Ie9fea9814c850b084562ab2349b54d9ad9fa1f4a
Reviewed-on: https://go-review.googlesource.com/27825
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'misc/cgo/testplugin/test.bash')
| -rwxr-xr-x | misc/cgo/testplugin/test.bash | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/misc/cgo/testplugin/test.bash b/misc/cgo/testplugin/test.bash new file mode 100755 index 0000000000..452d5c0a59 --- /dev/null +++ b/misc/cgo/testplugin/test.bash @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# Copyright 2016 The Go Authors. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +set -e + +if [ ! -f src/host/host.go ]; then + cwd=$(pwd) + echo "misc/cgo/testplugin/test.bash is running in $cwd" 1>&2 + exit 1 +fi + +goos=$(go env GOOS) +goarch=$(go env GOARCH) + +function cleanup() { + rm -f plugin1.so host pkg +} +trap cleanup EXIT + +rm -rf pkg + +GOPATH=$(pwd) go build -buildmode=plugin plugin1 +GOPATH=$(pwd) go build host + +LD_LIBRARY_PATH=$(pwd) ./host |
