• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright (C) 2016 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17LOCAL_PATH := $(call my-dir)
18
19include $(LOCAL_PATH)/../Android.clean.mk
20
21test_cflags = \
22    -fstack-protector-all \
23    -g \
24    -Wall -Wextra -Wunused \
25    -Werror \
26    -fno-builtin \
27
28test_cflags += -D__STDC_LIMIT_MACROS  # For glibc.
29
30test_cppflags := \
31
32test_executable := VtsHalLightsTestCases
33list_executable := $(test_executable)_list
34
35include $(CLEAR_VARS)
36LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
37
38LOCAL_MODULE := $(test_executable)
39LOCAL_MODULE_TAGS := optional
40LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/nativetest
41LOCAL_MULTILIB := both
42LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
43LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
44
45LOCAL_SHARED_LIBRARIES += \
46    libdl \
47    libhardware \
48
49LOCAL_WHOLE_STATIC_LIBRARIES += \
50    libHalLightsTests \
51    libVtsGtestMain \
52
53LOCAL_STATIC_LIBRARIES += \
54    libbase \
55    libtinyxml2 \
56    liblog \
57    libgtest \
58
59# Tag this module as a vts test artifact
60LOCAL_COMPATIBILITY_SUITE := vts
61
62include $(BUILD_EXECUTABLE)
63
64# VTS testcase isn't designed to be run on host due to its dependencies to
65# libhardware or other android runtime.
66build_host := false
67common_additional_dependencies := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/../Android.build.mk
68
69# -----------------------------------------------------------------------------
70# All standard tests.
71# -----------------------------------------------------------------------------
72
73libHalLightsStandardTests_src_files := \
74    hal_lights_basic_test.cpp
75
76libHalLightsStandardTests_cflags := \
77    $(test_cflags) \
78
79libHalLightsStandardTests_cppflags := \
80    $(test_cppflags) \
81
82libHalLightsStandardTests_c_includes := \
83    test/vts/testcases/include \
84    external/tinyxml2 \
85
86libHalLightsStandardTests_static_libraries := \
87    libbase \
88
89libHalLightsStandardTests_ldlibs_host := \
90    -lrt \
91
92module := libHalLightsStandardTests
93module_tag := optional
94build_type := target
95build_target := STATIC_TEST_LIBRARY
96include $(LOCAL_PATH)/../Android.build.mk
97build_type := host
98include $(LOCAL_PATH)/../Android.build.mk
99
100# Library of all tests (excluding the dynamic linker tests).
101# -----------------------------------------------------------------------------
102libHalLightsTests_whole_static_libraries := \
103    libHalLightsStandardTests \
104
105
106module := libHalLightsTests
107module_tag := optional
108build_type := target
109build_target := STATIC_TEST_LIBRARY
110include $(LOCAL_PATH)/../Android.build.mk
111build_type := host
112include $(LOCAL_PATH)/../Android.build.mk
113
114# -----------------------------------------------------------------------------
115# Tests for the device using HAL Lights's .so. Run with:
116#   adb shell /data/nativetest/hallights-unit-tests/hallights-unit-tests32
117#   adb shell /data/nativetest/hallights-unit-tests/hallights-unit-tests64
118#   adb shell /data/nativetest/hallights-unit-tests/hallights-unit-tests-gcc32
119#   adb shell /data/nativetest/hallights-unit-tests/hallights-unit-tests-gcc64
120# -----------------------------------------------------------------------------
121common_hallights-unit-tests_whole_static_libraries := \
122    libHalLightsTests \
123    libVtsGtestMain \
124
125common_hallights-unit-tests_static_libraries := \
126    libtinyxml2 \
127    liblog \
128    libbase \
129
130# TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
131common_hallights-unit-tests_src_files := \
132    hal_lights_basic_test.cpp \
133
134common_hallights-unit-tests_cflags := $(test_cflags)
135
136common_hallights-unit-tests_conlyflags := \
137    -fexceptions \
138    -fnon-call-exceptions \
139
140common_hallights-unit-tests_cppflags := \
141    $(test_cppflags)
142
143common_hallights-unit-tests_ldflags := \
144    -Wl,--export-dynamic
145
146common_hallights-unit-tests_c_includes := \
147    bionic/libc \
148
149common_hallights-unit-tests_shared_libraries_target := \
150    libdl \
151    libhardware \
152    libpagemap \
153    libdl_preempt_test_1 \
154    libdl_preempt_test_2 \
155    libdl_test_df_1_global \
156
157# The order of these libraries matters, do not shuffle them.
158common_hallights-unit-tests_static_libraries_target := \
159    libbase \
160    libziparchive \
161    libz \
162    libutils \
163
164module_tag := optional
165build_type := target
166build_target := NATIVE_TEST
167
168module := hallights-unit-tests
169hallights-unit-tests_clang_target := true
170hallights-unit-tests_whole_static_libraries := $(common_hallights-unit-tests_whole_static_libraries)
171hallights-unit-tests_static_libraries := $(common_hallights-unit-tests_static_libraries)
172hallights-unit-tests_src_files := $(common_hallights-unit-tests_src_files)
173hallights-unit-tests_cflags := $(common_hallights-unit-tests_cflags)
174hallights-unit-tests_conlyflags := $(common_hallights-unit-tests_conlyflags)
175hallights-unit-tests_cppflags := $(common_hallights-unit-tests_cppflags)
176hallights-unit-tests_ldflags := $(common_hallights-unit-tests_ldflags)
177hallights-unit-tests_c_includes := $(common_hallights-unit-tests_c_includes)
178hallights-unit-tests_shared_libraries_target := $(common_hallights-unit-tests_shared_libraries_target)
179hallights-unit-tests_static_libraries_target := $(common_hallights-unit-tests_static_libraries_target)
180include $(LOCAL_PATH)/../Android.build.mk
181
182module := hallights-unit-tests-gcc
183hallights-unit-tests-gcc_clang_target := false
184hallights-unit-tests-gcc_whole_static_libraries := $(common_hallights-unit-tests_whole_static_libraries)
185hallights-unit-tests-gcc_static_libraries := $(common_hallights-unit-tests_static_libraries)
186hallights-unit-tests-gcc_src_files := $(common_hallights-unit-tests_src_files)
187hallights-unit-tests-gcc_cflags := $(common_hallights-unit-tests_cflags)
188hallights-unit-tests-gcc_conlyflags := $(common_hallights-unit-tests_conlyflags)
189hallights-unit-tests-gcc_cppflags := $(common_hallights-unit-tests_cppflags)
190hallights-unit-tests-gcc_ldflags := $(common_hallights-unit-tests_ldflags)
191hallights-unit-tests-gcc_c_includes := $(common_hallights-unit-tests_c_includes)
192hallights-unit-tests-gcc_shared_libraries_target := $(common_hallights-unit-tests_shared_libraries_target)
193hallights-unit-tests-gcc_static_libraries_target := $(common_hallights-unit-tests_static_libraries_target)
194include $(LOCAL_PATH)/../Android.build.mk
195