1 # Build the unit tests. 2 LOCAL_PATH := $(call my-dir) 3 4 perfprofd_test_cppflags := -Wall -Wno-sign-compare -Wno-unused-parameter -Werror -std=gnu++11 5 6 # 7 # Static library with mockup utilities layer (called by unit test). 8 # 9 include $(CLEAR_VARS) 10 LOCAL_CLANG := true 11 LOCAL_CPP_EXTENSION := cc 12 LOCAL_CXX_STL := libc++ 13 LOCAL_C_INCLUDES += system/extras/perfprofd 14 LOCAL_MODULE := libperfprofdmockutils 15 LOCAL_CPPFLAGS += $(perfprofd_test_cppflags) 16 LOCAL_SRC_FILES := perfprofdmockutils.cc 17 include $(BUILD_STATIC_LIBRARY) 18 19 # 20 # Canned perf.data files needed by unit test. 21 # 22 include $(CLEAR_VARS) 23 LOCAL_MODULE := canned.perf.data 24 LOCAL_MODULE_TAGS := optional 25 LOCAL_MODULE_CLASS := DATA 26 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/nativetest/perfprofd_test 27 LOCAL_SRC_FILES := canned.perf.data 28 include $(BUILD_PREBUILT) 29 30 # 31 # Unit test for perfprofd 32 # 33 include $(CLEAR_VARS) 34 LOCAL_CLANG := true 35 LOCAL_CPP_EXTENSION := cc 36 LOCAL_CXX_STL := libc++ 37 LOCAL_STATIC_LIBRARIES := libperfprofdcore libperfprofdmockutils libgtest libbase 38 LOCAL_SHARED_LIBRARIES := libprotobuf-cpp-lite 39 LOCAL_C_INCLUDES += system/extras/perfprofd external/protobuf/src 40 LOCAL_SRC_FILES := perfprofd_test.cc 41 LOCAL_CPPFLAGS += $(perfprofd_test_cppflags) 42 LOCAL_SHARED_LIBRARIES += libcutils 43 LOCAL_MODULE := perfprofd_test 44 include $(BUILD_NATIVE_TEST) 45 46 # Clean temp vars 47 perfprofd_test_cppflags := 48