blob: 3bf8a0bf927bf720fd14c85510498c9ad455fbdc [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 \
28 -std=gnu++11
29
30# -----------------------------------------------------------------------------
31# Benchmarks (actually a gTest where the result code does not matter)
32# ----------------------------------------------------------------------------
33
34benchmark_src_files := \
35 logcat_benchmark.cpp
36
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)
44include $(BUILD_NATIVE_TEST)
45
46# -----------------------------------------------------------------------------
47# Unit tests.
48# -----------------------------------------------------------------------------
Mark Salyzyn95cfc7b2014-03-11 11:20:56 -070049
Mark Salyzyn65772ca2013-12-13 11:10:11 -080050test_src_files := \
51 logcat_test.cpp \
52
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 Salyzyn33c26252016-04-12 09:11:46 -070059LOCAL_SHARED_LIBRARIES := liblog libcutils
Mark Salyzyn65772ca2013-12-13 11:10:11 -080060LOCAL_SRC_FILES := $(test_src_files)
61include $(BUILD_NATIVE_TEST)