]> Cypherpunks.ru repositories - gostls13.git/commit
misc/ios: script lldb directly with Python
authorElias Naur <elias.naur@gmail.com>
Sun, 15 Apr 2018 16:39:14 +0000 (18:39 +0200)
committerElias Naur <elias.naur@gmail.com>
Mon, 30 Apr 2018 16:17:42 +0000 (16:17 +0000)
commit78219ab3fe7618ba2079f5f72ac228452c44aff8
treeaae0da09ad98ca443154cc3d8d7282bc61b12d00
parenteef27a8fa2fb390d65a7476e686d933d927acdf7
misc/ios: script lldb directly with Python

The iOS exec wrapper uses ios-deploy to set up a device, install
the wrapped app, and start a lldb session to run it. ios-deploy is
not built to be scripted, as can be seen from the brittle way it is
driven by the Go wrapper. There are many timeouts and comments such
as

"
// lldb tries to be clever with terminals.
// So we wrap it in script(1) and be clever
// right back at it.
"

This CL replaces the use of ios-deploy with a lldb driver script in
Python. lldb is designed to be scripted, so apart from getting rid
of the ios-deploy dependency, we gain:

- No timouts and scripting ios-deploy through stdin and parsing
stdout for responses.
- Accurate exit codes.
- Prompt exits when the wrapped binary fails for some reason. Before,
the go test timeout would kick in to fail the test.
- Support for environment variables.
- No noise in the test output. Only the test binary output is output
from the wrapper.

We have to do more work with the lldb driver: mounting the developer
image on the device, running idevicedebugserverproxy and installing
the app. Even so, the CL removes almost as many lines as it adds.
Furthermore, having the steps split up helps to tell setup errors
from runtime errors.

Change-Id: I48cccc32f475d17987283b2c93aacc3da18fe339
Reviewed-on: https://go-review.googlesource.com/107337
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
misc/ios/go_darwin_arm_exec.go