I am new to AOSP.
We are developing an AOSP C++ middleware module. Currently we have the LOCAL_MODULE setup as the name Foo, with some LOCAL_SHARED_LIBRARIES like Audio, SqliteDatabase, Curl, http client, etc...
I would like to see if it is possible to use googletest to run some unit tests against my code.
I am having issues setup and running the tests. Could anyone give me some guidelines or some examples? (Even a fooDummyTest assert(true) is fine).
- How do I structure my code?
- What do I do to run the tests? (make Foo vs make FooTest?)
Any resources or links are welcome, thanks in advance!!!
You can take a look at a module with
BUILD_NATIVE_TESTvariable, for example:frameworks/av/camera/tests/Android.mk
Also take a look at the files listed in
LOCAL_SRC_FILESyou will find examples of Google tests there.To build the test, go to the directory containing the
Android.mkand runmm(after the correctlunchcommand).Watch the build output and find the test executable path and push it to the target with
adb pushor useadb syncto sync everything. Then connect to the target and run the test by calling the test executable.