]> Cypherpunks.ru repositories - gostls13.git/commitdiff
misc/ios,src/iostest.bash: support GOIOS_DEVICE_ID
authorElias Naur <elias.naur@gmail.com>
Wed, 23 Aug 2017 11:35:24 +0000 (13:35 +0200)
committerElias Naur <elias.naur@gmail.com>
Mon, 28 Aug 2017 16:37:25 +0000 (16:37 +0000)
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>
misc/ios/go_darwin_arm_exec.go
src/iostest.bash

index cc57adb584aa036b1b821fd6d0699064dfb32bf0..b49496cc1066102099590f6d6bab79642d0412ea 100644 (file)
@@ -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)
index 595b675744024038430f993706d630de81f77085..00cc49ec7e62f33fc75d0ecca54a804185e0a804 100755 (executable)
@@ -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