Commit 627d3a0b authored by Elias Naur's avatar Elias Naur

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: default avatarIan Lance Taylor <iant@golang.org>
parent adbfdfe3
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment