1 # 2 # Copyright (C) 2013-2014 The Android Open Source Project 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 # 16 17 LOCAL_PATH := $(call my-dir) 18 19 # ----------------------------------------------------------------------------- 20 # Benchmarks. 21 # ----------------------------------------------------------------------------- 22 23 test_module_prefix := liblog- 24 test_tags := tests 25 26 benchmark_c_flags := \ 27 -Ibionic/tests \ 28 -Wall -Wextra \ 29 -Werror \ 30 -fno-builtin \ 31 -std=gnu++11 32 33 benchmark_src_files := \ 34 benchmark_main.cpp \ 35 liblog_benchmark.cpp 36 37 # Build benchmarks for the device. Run with: 38 # adb shell liblog-benchmarks 39 include $(CLEAR_VARS) 40 LOCAL_MODULE := $(test_module_prefix)benchmarks 41 LOCAL_MODULE_TAGS := $(test_tags) 42 LOCAL_CFLAGS += $(benchmark_c_flags) 43 LOCAL_SHARED_LIBRARIES += liblog libm 44 LOCAL_SRC_FILES := $(benchmark_src_files) 45 include $(BUILD_NATIVE_TEST) 46 47 # ----------------------------------------------------------------------------- 48 # Unit tests. 49 # ----------------------------------------------------------------------------- 50 51 test_c_flags := \ 52 -fstack-protector-all \ 53 -g \ 54 -Wall -Wextra \ 55 -Werror \ 56 -fno-builtin \ 57 -std=gnu++11 58 59 test_src_files := \ 60 liblog_test.cpp 61 62 # to prevent breaking the build if bionic not relatively visible to us 63 ifneq ($(wildcard $(LOCAL_PATH)/../../../../bionic/libc/bionic/libc_logging.cpp),) 64 65 test_src_files += \ 66 libc_test.cpp 67 68 endif 69 70 # Build tests for the device (with .so). Run with: 71 # adb shell /data/nativetest/liblog-unit-tests/liblog-unit-tests 72 include $(CLEAR_VARS) 73 LOCAL_MODULE := $(test_module_prefix)unit-tests 74 LOCAL_MODULE_TAGS := $(test_tags) 75 LOCAL_CFLAGS += $(test_c_flags) 76 LOCAL_SHARED_LIBRARIES := liblog libcutils 77 LOCAL_SRC_FILES := $(test_src_files) 78 include $(BUILD_NATIVE_TEST) 79