@@ -285,52 +285,42 @@ This will:
285
285
* Install the Python iOS framework into the copy of the testbed project; and
286
286
* Run the test suite on an "iPhone SE (3rd generation)" simulator.
287
287
288
- While the test suite is running, Xcode does not display any console output.
289
- After showing some Xcode build commands, the console output will print ``Testing
290
- started ``, and then appear to stop. It will remain in this state until the test
291
- suite completes. On a 2022 M1 MacBook Pro, the test suite takes approximately 12
292
- minutes to run; a couple of extra minutes is required to boot and prepare the
293
- iOS simulator.
294
-
295
288
On success, the test suite will exit and report successful completion of the
296
- test suite. No output of the Python test suite will be displayed.
297
-
298
- On failure, the output of the Python test suite *will * be displayed. This will
299
- show the details of the tests that failed.
289
+ test suite. On a 2022 M1 MacBook Pro, the test suite takes approximately 12
290
+ minutes to run; a couple of extra minutes is required to compile the testbed
291
+ project, and then boot and prepare the iOS simulator.
300
292
301
293
Debugging test failures
302
294
-----------------------
303
295
304
- The easiest way to diagnose a single test failure is to open the testbed project
305
- in Xcode and run the tests from there using the "Product > Test" menu item.
306
-
307
- To test in Xcode, you must ensure the testbed project has a copy of a compiled
308
- framework. If you've configured your build with the default install location of
309
- ``iOS/Frameworks ``, you can copy from that location into the test project. To
310
- test on an ARM64 simulator, run::
311
-
312
- $ rm -rf iOS/testbed/Python.xcframework/ios-arm64_x86_64-simulator/*
313
- $ cp -r iOS/Frameworks/arm64-iphonesimulator/* iOS/testbed/Python.xcframework/ios-arm64_x86_64-simulator
296
+ Running ``make test `` generates a standalone version of the ``iOS/testbed ``
297
+ project, and runs the full test suite. It does this using ``iOS/testbed ``
298
+ itself - the folder is an executable module that can be used to create and run
299
+ a clone of the testbed project.
314
300
315
- To test on an x86-64 simulator, run ::
301
+ You can generate your own standalone testbed instance by running ::
316
302
317
- $ rm -rf iOS/testbed/Python.xcframework/ios-arm64_x86_64-simulator/*
318
- $ cp -r iOS/Frameworks/x86_64-iphonesimulator/* iOS/testbed/Python.xcframework/ios-arm64_x86_64-simulator
303
+ $ python iOS/testbed clone --framework iOS/Frameworks/arm64-iphonesimulator my-testbed
319
304
320
- To test on a physical device::
305
+ This invocation assumes that ``iOS/Frameworks/arm64-iphonesimulator `` is the
306
+ path to the iOS simulator framework for your platform (ARM64 in this case);
307
+ ``my-testbed `` is the name of the folder for the new testbed clone.
321
308
322
- $ rm -rf iOS/testbed/Python.xcframework/ios-arm64/*
323
- $ cp -r iOS/Frameworks/arm64-iphoneos/* iOS/testbed/Python.xcframework/ios-arm64
309
+ You can then use the ``my-testbed `` folder to run the Python test suite,
310
+ passing in any command line arguments you may require. For example, if you're
311
+ trying to diagnose a failure in the ``os `` module, you might run::
324
312
325
- Alternatively, you can configure your build to install directly into the
326
- testbed project. For a simulator, use::
313
+ $ python my-testbed run -- test -W test_os
327
314
328
- --enable-framework=$(pwd)/iOS/testbed/Python.xcframework/ios-arm64_x86_64-simulator
315
+ This is the equivalent of running ``python -m test -W test_os `` on a desktop
316
+ Python build. Any arguments after the ``-- `` will be passed to testbed as if
317
+ they were arguments to ``python -m `` on a desktop machine.
329
318
330
- For a physical device, use ::
319
+ You can also open the testbed project in Xcode by running ::
331
320
332
- --enable-framework=$(pwd)/iOS/ testbed/Python.xcframework/ios-arm64
321
+ $ open my- testbed/iOSTestbed.xcodeproj
333
322
323
+ This will allow you to use the full Xcode suite of tools for debugging.
334
324
335
325
Testing on an iOS device
336
326
^^^^^^^^^^^^^^^^^^^^^^^^
0 commit comments