blob: db06cf7a522d534acedc44f2bc5016884a0610ce [file] [log] [blame]
Mark Salyzyn8d1fdb52013-11-22 12:39:43 -08001#
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
17LOCAL_PATH := $(call my-dir)
18
19# -----------------------------------------------------------------------------
20# Benchmarks.
21# -----------------------------------------------------------------------------
22
23test_module_prefix := liblog-
24test_tags := tests
25
26benchmark_c_flags := \
27 -Ibionic/tests \
28 -Wall -Wextra \
29 -Werror \
30 -fno-builtin \
31 -std=gnu++11
32
33benchmark_src_files := \
34 benchmark_main.cpp \
35 liblog_benchmark.cpp \
36
37# Build benchmarks for the device. Run with:
38# adb shell liblog-benchmarks
39include $(CLEAR_VARS)
40LOCAL_MODULE := $(test_module_prefix)benchmarks
41LOCAL_MODULE_TAGS := $(test_tags)
42LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
43LOCAL_CFLAGS += $(benchmark_c_flags)
44LOCAL_SHARED_LIBRARIES += liblog libm
45LOCAL_SRC_FILES := $(benchmark_src_files)
46ifndef LOCAL_SDK_VERSION
47LOCAL_C_INCLUDES += bionic bionic/libstdc++/include external/stlport/stlport
48LOCAL_SHARED_LIBRARIES += libstlport
49endif
50LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)
51include $(BUILD_EXECUTABLE)
52
53# -----------------------------------------------------------------------------
54# Unit tests.
55# -----------------------------------------------------------------------------
56
57test_c_flags := \
58 -fstack-protector-all \
59 -g \
60 -Wall -Wextra \
61 -Werror \
62 -fno-builtin \
63
64test_src_files := \
65 liblog_test.cpp \
66
67# Build tests for the device (with .so). Run with:
68# adb shell /data/nativetest/liblog-unit-tests/liblog-unit-tests
69include $(CLEAR_VARS)
70LOCAL_MODULE := $(test_module_prefix)unit-tests
71LOCAL_MODULE_TAGS := $(test_tags)
72LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
73LOCAL_CFLAGS += $(test_c_flags)
74LOCAL_LDLIBS := -lpthread
75LOCAL_SHARED_LIBRARIES := liblog
76LOCAL_SRC_FILES := $(test_src_files)
77include $(BUILD_NATIVE_TEST)