blob: bfb20f039855b881ea7aacdf63822cd64abcd214 [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# -----------------------------------------------------------------------------
30# Benchmarks (actually a gTest where the result code does not matter)
31# ----------------------------------------------------------------------------
32
33benchmark_src_files := \
34 logcat_benchmark.cpp
35
36# Build benchmarks for the device. Run with:
37# adb shell /data/nativetest/logcat-benchmarks/logcat-benchmarks
38include $(CLEAR_VARS)
39LOCAL_MODULE := $(test_module_prefix)benchmarks
40LOCAL_MODULE_TAGS := $(test_tags)
Mark Salyzyn9879ac82014-06-03 11:24:34 -070041LOCAL_CFLAGS += $(test_c_flags)
42LOCAL_SRC_FILES := $(benchmark_src_files)
43include $(BUILD_NATIVE_TEST)
44
45# -----------------------------------------------------------------------------
46# Unit tests.
47# -----------------------------------------------------------------------------
Mark Salyzyn95cfc7b2014-03-11 11:20:56 -070048
Mark Salyzyn65772ca2013-12-13 11:10:11 -080049test_src_files := \
50 logcat_test.cpp \
Mark Salyzyn6dabc812017-02-10 13:09:07 -080051 liblogcat_test.cpp \
Mark Salyzyn65772ca2013-12-13 11:10:11 -080052
53# Build tests for the device (with .so). Run with:
54# adb shell /data/nativetest/logcat-unit-tests/logcat-unit-tests
55include $(CLEAR_VARS)
Mark Salyzyn9879ac82014-06-03 11:24:34 -070056LOCAL_MODULE := $(test_module_prefix)unit-tests
Mark Salyzyn65772ca2013-12-13 11:10:11 -080057LOCAL_MODULE_TAGS := $(test_tags)
Mark Salyzyn65772ca2013-12-13 11:10:11 -080058LOCAL_CFLAGS += $(test_c_flags)
Mark Salyzyn6dabc812017-02-10 13:09:07 -080059LOCAL_SHARED_LIBRARIES := liblog libbase liblogcat
60LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include
Mark Salyzyn65772ca2013-12-13 11:10:11 -080061LOCAL_SRC_FILES := $(test_src_files)
62include $(BUILD_NATIVE_TEST)