Android Studio with ndk and googletest

你离开我真会死。 提交于 2019-12-11 03:52:19

问题


I'm trying to setup my CI server to work with Android Studio. I'm looking to run my unit tests for the NDK through the new UI. I'm using GoogleTest and gcov works beautifully for the code coverage when I build from the command line. The problem I'm running into is that the test configuration that's in the UI works for java, but doesn't add any commands to the gradle build scripts. Thus I can't figure out where to add my commands.

This is the source I got the info on how to setup Unit Tests within Android Studio: http://rexstjohn.com/unit-testing-with-android-studio/

So here's the question: If I were to place something like this:

    android {
         defaultConfig {
            testPackageName "com.test.foo"
            testInstrumentationRunner "android.test.InstrumentationTestRunner"
            testHandleProfiling true
            testFunctionalTest true
            ndk {
               moduleName "LexAppNative"
               stl "stlport_shared"
               abiFilters "armeabi-v7a"
            }
        }
        buildTypes {
           debug {
                ndk {
                     ldLibs "log -L/absolute/path/to/libs", "z", "m", "GLESv2", "OpenSLES", "opencv_java", "libgtest.a --coverage"
                     cFlags "-I/absolute/path/to/libs/includes", "--coverage"
                }
           release {
                ndk {
                    ldLibs "log -L/absolute/path/to/libs", "z", "m", "GLESv2", "OpenSLES", "opencv_java"
                    cFlags "-I/absolute/path/to/libs/includes"
                }
           }
       }
    

Will that give me what I want?

来源:https://stackoverflow.com/questions/27972639/android-studio-with-ndk-and-googletest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!