Skip to content

Commit 9de4372

Browse files
authored
Add a "Testing Python" subsection
1 parent 66d8138 commit 9de4372

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

Platforms/Android/README.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,14 @@ similar to the `Android` directory of the CPython source tree.
9191

9292
## Testing
9393

94-
The Python test suite can be run on Linux, macOS, or Windows.
94+
Tests can be run on Linux, macOS, or Windows, using either an Android emulator
95+
or a physical device.
9596

9697
On Linux, the emulator needs access to the KVM virtualization interface. This may
9798
require adding your user to a group, or changing your udev rules. On GitHub
9899
Actions, the test script will do this automatically using the commands shown
99100
[here](https://github.blog/changelog/2024-04-02-github-actions-hardware-accelerated-android-virtualization-now-available/).
100101

101-
You can run the test suite by doing a build as described above, and then running
102-
`python3 Platforms/Android test`. On Windows, you won't be able to do the build
103-
on the same machine, so you'll have to copy the `cross-build/HOST/prefix` directory
104-
from somewhere else.
105-
106102
The test script supports the following modes:
107103

108104
* In `--connected` mode, it runs on a device or emulator you have already
@@ -129,7 +125,14 @@ By default, the only messages the script will show are Python's own stdout and
129125
stderr. Add the `-v` option to also show Gradle output, and non-Python logcat
130126
messages.
131127

132-
Any other arguments on the `Platforms/Android test` command line will be passed through
128+
### Testing Python
129+
130+
You can run the test suite by doing a build as described above, and then running
131+
`python3 Platforms/Android test`. On Windows, you won't be able to do the build
132+
on the same machine, so you'll have to copy the `cross-build/HOST/prefix` directory
133+
from somewhere else.
134+
135+
Extra arguments on the `Platforms/Android test` command line will be passed through
133136
to `python -m test` – use `--` to separate them from `Platforms/Android`'s own options.
134137
See the [Python Developer's
135138
Guide](https://devguide.python.org/testing/run-write-tests/) for common options
@@ -159,8 +162,9 @@ configuring the execution of a third-party test suite:
159162
* `--site-packages`: the directory to copy into the testbed app to use as site
160163
packages.
161164

162-
The arguments passed after `--` should also include either a `-c` or `-m`
163-
argument to specify how the test suite should be started.
165+
Extra arguments on the `android.py test` command line will be passed through to
166+
Python – use `--` to separate them from `android.py`'s own options. You must include
167+
either a `-c` or `-m` argument to specify how the test suite should be started.
164168

165169
For more details, run `android.py test --help`.
166170

0 commit comments

Comments
 (0)