Home | History | Annotate | Download | only in tests
      1 # Copyright (C) 2011 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 # Build the unit tests.
     16 LOCAL_PATH := $(call my-dir)
     17 include $(CLEAR_VARS)
     18 
     19 # Build the unit tests.
     20 test_src_files := $(call find-subdir-files, *.cpp)
     21 
     22 shared_libraries := \
     23         libz \
     24         liblog \
     25         libcutils \
     26         libutils \
     27         libstlport
     28 
     29 static_libraries := \
     30         libgtest \
     31         libgtest_main
     32 
     33 c_includes := \
     34     external/zlib \
     35     external/icu/icu4c/source/common \
     36     bionic \
     37     bionic/libstdc++/include \
     38     external/gtest/include \
     39     external/stlport/stlport
     40 
     41 module_tags := eng tests
     42 
     43 $(foreach file,$(test_src_files), \
     44     $(eval include $(CLEAR_VARS)) \
     45     $(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \
     46     $(eval LOCAL_STATIC_LIBRARIES := $(static_libraries)) \
     47     $(eval LOCAL_C_INCLUDES := $(c_includes)) \
     48     $(eval LOCAL_SRC_FILES := $(file)) \
     49     $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \
     50     $(eval LOCAL_MODULE_TAGS := $(module_tags)) \
     51     $(eval include $(BUILD_EXECUTABLE)) \
     52 )
     53