Android unittest googletest
I am using Android Studio to create a simple C ++ enabled application. Now I want to write a unittest for functions in my native lib. How do I include a google test in my CMakeLists.txt to build and run my tests on an android device?
When I put
enable_testing()
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS})
add_executable(foo foo.cc)
target_link_libraries(foo ${GTEST_BOTH_LIBRARIES})
add_test(AllTestsInFoo foo)
in CMakeLists.txt I'm wrong that GTest was not found.
I've seen this and this question. And the documentation , but they are all about .mk files not about CMakeLists.txt
How can I find googletest library on android device and link my test project to it?
Maybe I should write my own CMakeLists.txt for sources located at
${ANDROID_NDK}/sources/third_party/googletest
apply patches and build this library yourself?
+3
source to share
No one has answered this question yet
See similar questions:
or similar: