blob: defd3c49089e0a2c43eb1370b6ca2319d62cfef4 [file] [log] [blame]
Mark Salyzyn65772ca2013-12-13 11:10:11 -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
Mark Salyzyn9879ac82014-06-03 11:24:34 -070019test_module_prefix := logcat-
Mark Salyzyn65772ca2013-12-13 11:10:11 -080020test_tags := tests
21
22test_c_flags := \
23 -fstack-protector-all \
24 -g \
25 -Wall -Wextra \
26 -Werror \
Mark Salyzyn9879ac82014-06-03 11:24:34 -070027 -fno-builtin \
Mark Salyzyn9879ac82014-06-03 11:24:34 -070028
29# -----------------------------------------------------------------------------
Mark Salyzyn71919f42017-02-17 13:15:51 -080030# Benchmarks
Mark Salyzyn9879ac82014-06-03 11:24:34 -070031# ----------------------------------------------------------------------------
32
33benchmark_src_files := \
Mark Salyzyn71919f42017-02-17 13:15:51 -080034 logcat_benchmark.cpp \
35 exec_benchmark.cpp \
Mark Salyzyn9879ac82014-06-03 11:24:34 -070036
37# Build benchmarks for the device. Run with:
38# adb shell /data/nativetest/logcat-benchmarks/logcat-benchmarks
39include $(CLEAR_VARS)
40LOCAL_MODULE := $(test_module_prefix)benchmarks
41LOCAL_MODULE_TAGS := $(test_tags)
Mark Salyzyn9879ac82014-06-03 11:24:34 -070042LOCAL_CFLAGS += $(test_c_flags)
43LOCAL_SRC_FILES := $(benchmark_src_files)
Mark Salyzyn71919f42017-02-17 13:15:51 -080044LOCAL_SHARED_LIBRARIES := libbase liblogcat
45include $(BUILD_NATIVE_BENCHMARK)
Mark Salyzyn9879ac82014-06-03 11:24:34 -070046
47# -----------------------------------------------------------------------------
48# Unit tests.
49# -----------------------------------------------------------------------------
Mark Salyzyn95cfc7b2014-03-11 11:20:56 -070050
Mark Salyzyn65772ca2013-12-13 11:10:11 -080051test_src_files := \
52 logcat_test.cpp \
Mark Salyzyna073c392017-04-03 09:30:20 -070053 logcatd_test.cpp \
Mark Salyzyn6dabc812017-02-10 13:09:07 -080054 liblogcat_test.cpp \
Mark Salyzyn65772ca2013-12-13 11:10:11 -080055
56# Build tests for the device (with .so). Run with:
57# adb shell /data/nativetest/logcat-unit-tests/logcat-unit-tests
58include $(CLEAR_VARS)
Mark Salyzyn9879ac82014-06-03 11:24:34 -070059LOCAL_MODULE := $(test_module_prefix)unit-tests
Mark Salyzyn65772ca2013-12-13 11:10:11 -080060LOCAL_MODULE_TAGS := $(test_tags)
Mark Salyzyn65772ca2013-12-13 11:10:11 -080061LOCAL_CFLAGS += $(test_c_flags)
Mark Salyzyn6dabc812017-02-10 13:09:07 -080062LOCAL_SHARED_LIBRARIES := liblog libbase liblogcat
Mark Salyzyn65772ca2013-12-13 11:10:11 -080063LOCAL_SRC_FILES := $(test_src_files)
64include $(BUILD_NATIVE_TEST)