Googletest for Android NDK

后端 未结 4 1753
攒了一身酷
攒了一身酷 2021-02-12 14:01

I checked a previous answer about unit test for Android, where it is suggested Googletest as a good option. However, I got a look into the Google C++ Testing Framework - Googlet

4条回答
  •  名媛妹妹
    2021-02-12 14:39

    You need to built Googletest for Android to be able to run it with your toolchain, as you working with cross-compilation.

    Download source code of googletest

    $ mkdir googletest
    $ cd googletest
    $ svn checkout http://googletest.googlecode.com/svn/trunk/ .
    

    Copy jni directory to googletest directory

    $ cd /path/to/this/git
    $ cp -r jni googletest/
    

    run ndk-build script

    $ cd googletest/ $ ndk-build 
    

    You can find libgtest.a in googletest/obj/local/armeabi/libgtest.a

    Source: sfuku7 / googletest_android_ndk-build - github

提交回复
热议问题