• 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
12You must have compiled and executed one of the Oboe examples or OboeTester. That ensures that the NDK and cmake is installed.
13
14You must define `ANDROID_NDK` as an environment variable and make sure `cmake` is on your path.
15
16To test this on Mac or Linux enter:
17
18    echo $ANDROID_HOME
19    echo $ANDROID_NDK
20    cmake --version
21
22They may already be set. If not, then this may work on Mac OS:
23
24    export ANDROID_HOME=$HOME/Library/Android/sdk
25
26or this may work on Linux:
27
28    export ANDROID_HOME=$HOME/Android/Sdk
29
30Now we need to determine the latest installed version of the NDK. Enter:
31
32    ls $ANDROID_HOME/ndk
33
34Make note of the folder name. Mine was "21.3.6528147" so I entered:
35
36    export ANDROID_NDK=$ANDROID_HOME/ndk/21.3.6528147/
37
38If you need to add `cmake` to your path then you can find it by entering:
39
40    ls $ANDROID_HOME/cmake
41
42Make note of the folder name. Mine was "3.10.2.4988404" so I entered:
43
44    export PATH=$PATH:$ANDROID_HOME/cmake/3.10.2.4988404/bin
45    cmake --version
46
47## Running the Tests
48
49To run the tests, enter:
50
51    cd tests
52    ./run_tests.sh
53
54You may need to enter \<control-c\> to exit the script.
55
56If you get this error:
57
58    com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException:
59        INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.google.oboe.tests.unittestrunner
60        signatures do not match previously installed version; ignoring!
61
62then uninstall the app "UnitTestRunner" from the Android device.
63
64See `run_tests.sh` for more documentation
65