Skip to content

Commit e882861

Browse files
committed
Auto merge of #146812 - matthiaskrgr:rollup-aiap18m, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - rust-lang/rust#144592 (generate list of all variants with `target_spec_enum`) - rust-lang/rust#146762 (Fix and provide instructions for running test suite on Apple simulators) - rust-lang/rust#146770 (fixes for numerous clippy warnings) - rust-lang/rust#146774 (Allow running `x <cmd> <path>` from a different directory) - rust-lang/rust#146800 (Fix unsupported `std::sys::thread` after move) r? `@ghost` `@rustbot` modify labels: rollup
2 parents b44cca0 + edceb28 commit e882861

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

src/tests/running.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,34 @@ results. The Docker image is set up to launch `remote-test-server` and the
339339
build tools use `remote-test-client` to communicate with the server to
340340
coordinate running tests (see [src/bootstrap/src/core/build_steps/test.rs]).
341341

342-
> **TODO**
343-
>
344-
> - Is there any support for using an iOS emulator?
342+
To run on the iOS/tvOS/watchOS/visionOS simulator, we can similarly treat it as
343+
a "remote" machine. A curious detail here is that the network is shared between
344+
the simulator instance and the host macOS, so we can use the local loopback
345+
address `127.0.0.1`. Something like the following should work:
346+
347+
```sh
348+
# Build the test server for the iOS simulator:
349+
./x build src/tools/remote-test-server --target aarch64-apple-ios-sim
350+
351+
# If you already have a simulator instance open, copy the device UUID from:
352+
xcrun simctl list devices booted
353+
UDID=01234567-89AB-CDEF-0123-456789ABCDEF
354+
355+
# Alternatively, create and boot a new simulator instance:
356+
xcrun simctl list runtimes
357+
xcrun simctl list devicetypes
358+
UDID=$(xcrun simctl create $CHOSEN_DEVICE_TYPE $CHOSEN_RUNTIME)
359+
xcrun simctl boot $UDID
360+
# See https://nshipster.com/simctl/ for details.
361+
362+
# Spawn the runner on port 12345:
363+
xcrun simctl spawn $UDID ./build/host/stage2-tools/aarch64-apple-ios-sim/release/remote-test-server -v --bind 127.0.0.1:12345
364+
365+
# In a new terminal, run tests via the runner:
366+
export TEST_DEVICE_ADDR="127.0.0.1:12345"
367+
./x test --host='' --target aarch64-apple-ios-sim --skip tests/debuginfo
368+
# FIXME(madsmtm): Allow debuginfo tests to work (maybe needs `.dSYM` folder to be copied to the target?).
369+
```
345370

346371
[armhf-gnu]: https://github.com/rust-lang/rust/tree/master/src/ci/docker/host-x86_64/armhf-gnu/Dockerfile
347372
[QEMU]: https://www.qemu.org/

0 commit comments

Comments
 (0)