Android.mk revision 4d04a937b1bf7a949dfb00650b2640a9ed0c8aca
1# Copyright (C) 2016 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# While it's arguably overkill to have unit test for our testing code,
16# this testing code runs under an embedded environment which is much more
17# difficult to test.  To the extent that we have platform-independent
18# code here, it seems a long-term time saver to have Linux tests for
19# what we can easily test.
20
21LOCAL_PATH := $(call my-dir)
22
23FILES_UNDER_TEST := \
24    dumb_allocator.cc \
25    nano_endian.cc \
26    nano_string.cc \
27
28TESTING_SOURCE := \
29    dumb_allocator_test.cc \
30    nano_endian_be_test.cc \
31    nano_endian_le_test.cc \
32    nano_endian_test.cc \
33    nano_string_test.cc \
34
35ifeq ($(HOST_OS),linux)
36include $(CLEAR_VARS)
37LOCAL_CPP_EXTENSION := .cc
38LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
39
40LOCAL_SRC_FILES := $(FILES_UNDER_TEST) $(TESTING_SOURCE)
41
42LOCAL_MODULE := nanoapp_chqts_shared_tests
43LOCAL_MODULE_TAGS := tests
44
45LOCAL_CPPFLAGS += -Wall -Wextra -Werror
46LOCAL_CPPFLAGS += -DINTERNAL_TESTING
47
48include $(BUILD_HOST_NATIVE_TEST)
49
50endif  # HOST_OS == linux
51