Home | History | Annotate | Download | only in tests
      1 # Copyright (C) 2008 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 LOCAL_PATH := $(call my-dir)
     16 
     17 # you can use EXTRA_CFLAGS to indicate additional CFLAGS to use
     18 # in the build. The variables will be cleaned on exit
     19 #
     20 #
     21 
     22 libgralloc_test_includes:= \
     23     bionic/libstdc++/include \
     24     external/astl/include \
     25     external/gtest/include \
     26     $(LOCAL_PATH)/..
     27 
     28 libgralloc_test_static_libs := \
     29     libgralloc_qsd8k_host \
     30     libgtest_main_host \
     31 	libgtest_host  \
     32 	libastl_host \
     33     liblog
     34 
     35 define host-test
     36   $(foreach file,$(1), \
     37     $(eval include $(CLEAR_VARS)) \
     38     $(eval LOCAL_CPP_EXTENSION := .cpp) \
     39     $(eval LOCAL_SRC_FILES := $(file)) \
     40     $(eval LOCAL_C_INCLUDES := $(libgralloc_test_includes)) \
     41     $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \
     42     $(eval LOCAL_CFLAGS += $(EXTRA_CFLAGS)) \
     43     $(eval LOCAL_LDLIBS += $(EXTRA_LDLIBS)) \
     44     $(eval LOCAL_STATIC_LIBRARIES := $(libgralloc_test_static_libs)) \
     45     $(eval LOCAL_MODULE_TAGS := eng tests) \
     46     $(eval include $(BUILD_HOST_EXECUTABLE)) \
     47   ) \
     48   $(eval EXTRA_CFLAGS :=) \
     49   $(eval EXTRA_LDLIBS :=)
     50 endef
     51 
     52 TEST_SRC_FILES := \
     53 	pmemalloc_test.cpp
     54 
     55 $(call host-test, $(TEST_SRC_FILES))
     56