Skip to content

Commit 611b216

Browse files
committed
📝 Update docs
1 parent 6b6e1a6 commit 611b216

File tree

2 files changed

+41
-21
lines changed

2 files changed

+41
-21
lines changed

doc/source/testing_pull_requests.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,30 +103,31 @@ Using python-for-android commands directly from the pull request files
103103
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104104

105105
- Enter inside the directory of the cloned repository in the above
106-
step and run p4a command with proper args, eg::
106+
step and run p4a command with proper args, eg (to test an modified
107+
`pycryptodome` recipe)::
107108

108109
.. codeblock:: bash
109110

110111
cd p4a-feature-fix-numpy
111112
PYTHONPATH=. python3 -m pythonforandroid.toolchain apk \
112-
--private=testapps/testapp_sqlite_openssl \
113-
--dist-name=dist_test_app_python3_libs \
113+
--private=testapps/on_device_unit_tests/test_app \
114+
--dist-name=dist_test_app_unittests_pycryptodome \
114115
--package=org.kivy \
115-
--name=test_app_python3_sqlite_openssl \
116+
--name=test_app_unittests_pycryptodome \
116117
--version=0.1 \
117-
--requirements=requests,peewee,sdl2,pyjnius,kivy,python3 \
118+
--requirements=sdl2,pyjnius,kivy,python3,pycryptodome \
118119
--ndk-dir=/media/DEVEL/Android/android-ndk-r20 \
119120
--sdk-dir=/media/DEVEL/Android/android-sdk-linux \
120121
--android-api=27 \
121122
--arch=arm64-v8a \
122-
--permission=INTERNET \
123+
--permission=VIBRATE \
123124
--debug
124125

125126
Things that you should know:
126127

127128

128-
- The example above will build an testapp we will make use of the files of
129-
the testapp named `testapp_sqlite_openssl.py` but we don't use the setup
129+
- The example above will build an test app we will make use of the files of
130+
the `on device unit tests` test app but we don't use the setup
130131
file to build it so we must tell python-for-android what we want via
131132
arguments
132133
- be sure to at least edit the following arguments when running the above
@@ -159,19 +160,19 @@ Installing python-for-android using the github's branch of the pull request
159160
cd p4a-feature-fix-numpy
160161
pip3 install . --upgrade --user
161162

162-
- Now, go inside the `testapps` directory (we assume that you still are inside
163-
the cloned repository)::
163+
- Now, go inside the `testapps/on_device_unit_tests` directory (we assume that
164+
you still are inside the cloned repository)::
164165

165166
.. codeblock:: bash
166167

167-
cd testapps
168+
cd testapps/on_device_unit_tests
168169

169170
- Run the build of the apk via the freshly installed copy of python-for-android
170171
by running a similar command than below::
171172

172173
.. code-block:: bash
173174

174-
python3 setup_testapp_python3_sqlite_openssl.py apk \
175+
python3 setup_test_app.py apk \
175176
--ndk-dir=/media/DEVEL/Android/android-ndk-r20 \
176177
--sdk-dir=/media/DEVEL/Android/android-sdk-linux \
177178
--android-api=27 \
@@ -182,8 +183,7 @@ Installing python-for-android using the github's branch of the pull request
182183
Things that you should know:
183184

184185
- In the example above, we override some variables that are set in
185-
`setup_testapp_python3_sqlite_openssl.py`, you could also override them
186-
by editing this file
186+
`setup_test_app.py`, you could also override them by editing this file
187187
- be sure to at least edit the following arguments when running the above
188188
command, since the default set in there it's unlikely that match your
189189
installation:

testapps/on_device_unit_tests/README.rst

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,38 @@ On device unit tests
44
This test app runs a set of unit tests, to help confirm that the
55
python-for-android build is actually working properly.
66

7+
Also its dynamic, because it will run one app or another depending on the
8+
supplied recipes at build time.
9+
10+
It currently supports three app `modes`:
11+
- `kivy app` (with sdl2 bootstrap): if kivy in recipes
12+
- `flask app` (with webview bootstrap): if flask in recipes
13+
- `no gui`: if neither of above cases is taken
14+
715
The main tests are for the recipes built in the apk. Each module (or
816
other tool) is at least imported and subject to some basic check.
917

10-
This app is experimental, it doesn't yet support things like testing
11-
only the requirements you ask for (so if you build with requirements
12-
other than those specified, the tests may fail). It also has no gui
13-
yet, the results must be checked via logcat.
18+
This test app can be build via `setup_test_app.py` or via buildozer. In both
19+
cases it will build a basic kivy app with a set of tests defined via the
20+
`requirements` keyword (specified at build time).
21+
22+
In case that you build the `test app with no-gui`, the unittests results must
23+
be checked via command `adb logcat` or some logging apk (you may need root
24+
permissions in your device to use such app).
25+
26+
Building the app with python-for-android
27+
========================================
28+
29+
You can use the provided file `setup_test_app.py`. Check our `Makefile
30+
<https://github.com/kivy/python-for-android/blob/develop/Makefile>`__ to guess
31+
how to build th e test app, or also you can look at `testing pull requests documentation
32+
<https://github.com/kivy/python-for-android/blob/develop/doc/source/testing_pull_requests.rst>`__,
33+
which describes some of the methods that you can use to build the test app.
1434

15-
Building the app
16-
================
35+
Building the app with buildozer
36+
===============================
1737

18-
This app should be built using buildozer, which it also serves as a
38+
This app can be built using buildozer, which it also serves as a
1939
test for::
2040

2141
$ buildozer android debug

0 commit comments

Comments
 (0)