aboutsummaryrefslogtreecommitdiff
path: root/misc/cgo/testcshared/test.bash
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2015-12-18 15:29:51 -0800
committerIan Lance Taylor <iant@golang.org>2016-01-05 00:25:50 +0000
commita7d2b4d7cef3bf3107c6cf9725cd1c6151cf18d4 (patch)
treeadc9e286d8416963832e5e408ef223df03a63186 /misc/cgo/testcshared/test.bash
parent6c8a141a6d53285acc876aacfa0a9c4edb563b6c (diff)
downloadgo-a7d2b4d7cef3bf3107c6cf9725cd1c6151cf18d4.tar.xz
runtime: disable a signal by restoring the original disposition
Fixes #13034. Fixes #13042. Update #9896. Change-Id: I189f381090223dd07086848aac2d69d2c00d80c4 Reviewed-on: https://go-review.googlesource.com/18062 Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'misc/cgo/testcshared/test.bash')
-rwxr-xr-xmisc/cgo/testcshared/test.bash20
1 files changed, 18 insertions, 2 deletions
diff --git a/misc/cgo/testcshared/test.bash b/misc/cgo/testcshared/test.bash
index 162a62d80e..ac852a007a 100755
--- a/misc/cgo/testcshared/test.bash
+++ b/misc/cgo/testcshared/test.bash
@@ -33,8 +33,9 @@ fi
androidpath=/data/local/tmp/testcshared-$$
function cleanup() {
- rm -f libgo.$libext libgo2.$libext libgo4.$libext libgo.h libgo4.h
- rm -f testp testp2 testp3 testp4
+ rm -f libgo.$libext libgo2.$libext libgo4.$libext libgo5.$libext
+ rm -f libgo.h libgo4.h libgo5.h
+ rm -f testp testp2 testp3 testp4 testp5
rm -rf pkg "${goroot}/${installdir}"
if [ "$goos" == "android" ]; then
@@ -161,6 +162,21 @@ if test "$output" != "PASS"; then
status=1
fi
+# test5: tests signal handlers with os/signal.Notify
+GOPATH=$(pwd) go build -buildmode=c-shared $suffix -o libgo5.$libext libgo5
+binpush libgo5.$libext
+$(go env CC) ${GOGCCFLAGS} -pthread -o testp5 main5.c -ldl
+binpush testp5
+output=$(run ./testp5 ./libgo5.$libext 2>&1)
+if test "$output" != "PASS"; then
+ echo "FAIL test5 got ${output}"
+ if test "$goos" != "android"; then
+ echo "re-running test5 in verbose mode"
+ ./testp5 ./libgo5.$libext verbose
+ fi
+ status=1
+fi
+
if test $status = 0; then
echo "ok"
fi