1
0
mirror of https://github.com/golang/go synced 2024-11-23 16:00:06 -07:00
go/misc/android
Elias Naur 7ba1c91dd9 misc/android: forward SIGQUIT to the process running on the device
When a test binary runs for too long, the go command sends it a
SIGQUIT to force a backtrace dump. On Android, the exec wrapper
will instead receive the signal and dump its backtrace.

Forward SIGQUIT signals from the wrapper to the wrapped process
to gain useful backtraces.

Inspired by issuse 25519; this CL would have revealed the hanging
test directly in the builder log.

Change-Id: Ic362d06940d261374343a1dc09366ef54edaa631
Reviewed-on: https://go-review.googlesource.com/114137
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-05-23 18:18:39 +00:00
..
cleaner.go
go_android_exec.go misc/android: forward SIGQUIT to the process running on the device 2018-05-23 18:18:39 +00:00
README misc/android: add a NL at the of README 2018-05-23 05:54:14 +00:00

Android
=======

For details on developing Go for Android, see the documentation in the
mobile subrepository:

	https://github.com/golang/mobile

To run the standard library tests, see androidtest.bash. Run it as

	CC_FOR_TARGET=$STANDALONE_NDK_PATH/bin/clang GOARCH=arm64 ./androidtest.bash

To create a standalone android NDK tool chain, follow the instructions on

	https://developer.android.com/ndk/guides/standalone_toolchain

To run tests on the Android device, add the bin directory to PATH so the
go tool can find the go_android_$GOARCH_exec wrapper generated by
androidtest.bash. Then, use the same GOARCH as when androidtest.bash ran
and set GOOS to android. For example, to run the go1 benchmarks

	export PATH=$GOROOT/bin:$PATH
	cd $GOROOT/test/bench/go1/
	GOOS=android GOARCH=arm64 go test -bench=. -count=N -timeout=T