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 21 LOCAL_PATH := $(call my-dir) 22 23 FILES_UNDER_TEST := \ 24 dumb_allocator.cc \ 25 nano_endian.cc \ 26 nano_string.cc \ 27 28 TESTING_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 35 ifeq ($(HOST_OS),linux) 36 include $(CLEAR_VARS) 37 LOCAL_CPP_EXTENSION := .cc 38 LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. 39 40 LOCAL_SRC_FILES := $(FILES_UNDER_TEST) $(TESTING_SOURCE) 41 42 LOCAL_MODULE := nanoapp_chqts_shared_tests 43 LOCAL_MODULE_TAGS := tests 44 45 LOCAL_CPPFLAGS += -Wall -Wextra -Werror 46 LOCAL_CPPFLAGS += -DINTERNAL_TESTING 47 48 include $(BUILD_HOST_NATIVE_TEST) 49 50 endif # HOST_OS == linux 51