• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 so then skip to "Running the Tests" below.
24
25If not, then this may work on Mac OS:
26
27    export ANDROID_HOME=$HOME/Library/Android/sdk
28
29or this may work on Linux:
30
31    export ANDROID_HOME=$HOME/Android/Sdk
32
33Tadb rooto determine the latest installed version of the NDK. Enter:
34
35    ls $ANDROID_HOME/ndk
36
37Make note of the folder name. Mine was "21.3.6528147" so I entered:
38
39    export ANDROID_NDK=$ANDROID_HOME/ndk/21.3.6528147/
40
41If you need to add `cmake` to your path then you can find it by entering:
42
43    ls $ANDROID_HOME/cmake
44
45Make note of the folder name. Mine was "3.10.2.4988404" so I entered:
46
47    export PATH=$PATH:$ANDROID_HOME/cmake/3.10.2.4988404/bin
48    cmake --version
49
50## Running the Tests
51
52To run the tests, enter:
53
54    cd tests
55    ./run_tests.sh
56
57When the tests finish, you may need to enter \<control-c\> to exit the script.
58
59If you get this error:
60
61    com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException:
62        INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.google.oboe.tests.unittestrunner
63        signatures do not match previously installed version; ignoring!
64
65then uninstall the app "UnitTestRunner" from the Android device. Or try:
66
67    adb root
68    adb remount -R
69
70See `run_tests.sh` for more documentation
71