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.
16LOCAL_PATH := $(call my-dir)
17include $(CLEAR_VARS)
18
19# Build the unit tests.
20test_src_files := $(call find-subdir-files, *.cpp)
21
22shared_libraries := \
23        libz \
24        liblog \
25        libcutils \
26        libutils \
27
28static_libraries := \
29        libgtest \
30        libgtest_main
31
32c_includes := \
33    external/gtest/include \
34
35module_tags := eng tests
36
37$(foreach file,$(test_src_files), \
38    $(eval include $(CLEAR_VARS)) \
39    $(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \
40    $(eval LOCAL_STATIC_LIBRARIES := $(static_libraries)) \
41    $(eval LOCAL_C_INCLUDES := $(c_includes)) \
42    $(eval LOCAL_SRC_FILES := $(file)) \
43    $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \
44    $(eval LOCAL_MODULE_TAGS := $(module_tags)) \
45    $(eval include $(BUILD_EXECUTABLE)) \
46)
47