Googletest for Android NDK

后端 未结 4 1686
攒了一身酷
攒了一身酷 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:20

    jni/Android.mk:

      LOCAL_PATH := $(call my-dir)
    
      include $(CLEAR_VARS)
      LOCAL_MODULE := foo
      LOCAL_SRC_FILES := foo.cpp
      include $(BUILD_SHARED_LIBRARY)
    
      include $(CLEAR_VARS)
      LOCAL_MODULE := foo_unittest
      LOCAL_SRC_FILES := foo_unittest.cpp
      LOCAL_SHARED_LIBRARIES := foo
      LOCAL_STATIC_LIBRARIES := googletest_main
      include $(BUILD_EXECUTABLE)
    
      $(call import-module,third_party/googletest)
    

提交回复
热议问题