xref: /aosp_15_r20/external/oboe/tests/README.md (revision 05767d913155b055644481607e6fa1e35e2fe72c)
1# Oboe Unit Tests
2
3This directory contains the Oboe unit tests. They are run using the bash script `run_tests.sh`.
4
5The basic operation is:
6
71. Connect an Android device or start the Android emulator
82. Open a terminal window and execute `run_tests.sh`
9
10## Prerequisites/caveats
11
121. Java JDK installed.
132. On Mac, you must agree to the XCode license. The script will prompt you.
143. You must have compiled and executed one of the Oboe examples or OboeTester. That ensures that the NDK and cmake is installed.
154. You must define `ANDROID_NDK` as an environment variable and make sure `cmake` is on your path.
16
17To test this on Mac or Linux enter:
18
19    echo $ANDROID_HOME
20    echo $ANDROID_NDK
21    cmake --version
22
23They may already be set. If not, then this may work on Mac OS:
24
25    export ANDROID_HOME=$HOME/Library/Android/sdk
26
27or this may work on Linux:
28
29    export ANDROID_HOME=$HOME/Android/Sdk
30
31Now we need to determine the latest installed version of the NDK. Enter:
32
33    ls $ANDROID_HOME/ndk
34
35Make note of the folder name. Mine was "21.3.6528147" so I entered:
36
37    export ANDROID_NDK=$ANDROID_HOME/ndk/21.3.6528147/
38
39If you need to add `cmake` to your path then you can find it by entering:
40
41    ls $ANDROID_HOME/cmake
42
43Make note of the folder name. Mine was "3.10.2.4988404" so I entered:
44
45    export PATH=$PATH:$ANDROID_HOME/cmake/3.10.2.4988404/bin
46    cmake --version
47
48## Running the Tests
49
50To run the tests, enter:
51
52    cd tests
53    ./run_tests.sh
54
55You may need to enter \<control-c\> to exit the script.
56
57If you get this error:
58
59    com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException:
60        INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.google.oboe.tests.unittestrunner
61        signatures do not match previously installed version; ignoring!
62
63then uninstall the app "UnitTestRunner" from the Android device.
64
65See `run_tests.sh` for more documentation
66