mirror of
https://github.com/golang/go
synced 2024-11-26 05:17:58 -07:00
misc/ios,src/iostest.bash: support GOIOS_DEVICE_ID
When running multiple iOS builds on the same host, GOIOS_DEVICE_ID is used to distinguish the devices. To improve support, - Only restart the particular device when invoking iostest.bash with the -restart flag. - Make the exec wrapper lock file per-device. For the iOS builder. Change-Id: Id6f222981f25036399a43c3202a393dba89d87cb Reviewed-on: https://go-review.googlesource.com/57970 Run-TryBot: Elias Naur <elias.naur@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
adbfdfe377
commit
627d3a0b4c
@ -100,7 +100,7 @@ func main() {
|
||||
//
|
||||
// The lock file is never deleted, to avoid concurrent locks on distinct
|
||||
// files with the same path.
|
||||
lockName := filepath.Join(os.TempDir(), "go_darwin_arm_exec.lock")
|
||||
lockName := filepath.Join(os.TempDir(), "go_darwin_arm_exec-"+deviceID+".lock")
|
||||
lock, err = os.OpenFile(lockName, os.O_CREATE|os.O_RDONLY, 0666)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
|
@ -32,11 +32,15 @@ if [ "$1" = "-restart" ]; then
|
||||
# Reboot to make sure previous runs do not interfere with the current run.
|
||||
# It is reasonably easy for a bad program leave an iOS device in an
|
||||
# almost unusable state.
|
||||
idevicediagnostics restart
|
||||
IDEVARGS=
|
||||
if [ -n "$GOIOS_DEVICE_ID" ]; then
|
||||
IDEVARGS="-u $GOIOS_DEVICE_ID"
|
||||
fi
|
||||
idevicediagnostics $IDEVARGS restart
|
||||
# Initial sleep to make sure we are restarting before we start polling.
|
||||
sleep 30
|
||||
# Poll until the device has restarted.
|
||||
until idevicediagnostics diagnostics; do
|
||||
until idevicediagnostics $IDEVARGS diagnostics; do
|
||||
# TODO(crawshaw): replace with a test app using go_darwin_arm_exec.
|
||||
echo "waiting for idevice to come online"
|
||||
sleep 10
|
||||
|
Loading…
Reference in New Issue
Block a user