blob: 0566fe95594f02697495c3f0ee215d00bef5442c [file] [log] [blame]
Brett Chabotbb5918e2011-06-17 17:07:12 -07001# 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
Brett Chabotbb5918e2011-06-17 17:07:12 -070019# Build the unit tests.
20test_src_files := $(call find-subdir-files, *.cpp)
21
22shared_libraries := \
23 libz \
24 liblog \
25 libcutils \
26 libutils \
Brett Chabotbb5918e2011-06-17 17:07:12 -070027
28static_libraries := \
29 libgtest \
30 libgtest_main
31
32c_includes := \
Brett Chabotbb5918e2011-06-17 17:07:12 -070033 external/gtest/include \
Brett Chabotbb5918e2011-06-17 17:07:12 -070034
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)