• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1LOCAL_PATH := $(call my-dir)
2
3test_cflags = \
4    -fstack-protector-all \
5    -g \
6    -Wall -Wextra -Wunused \
7    -Werror \
8    -fno-builtin \
9
10test_cflags += -D__STDC_LIMIT_MACROS  # For glibc.
11
12test_cppflags := \
13
14test_executable := VtsHalPowerTestCases
15list_executable := $(test_executable)_list
16
17include $(CLEAR_VARS)
18LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
19
20LOCAL_MODULE := $(test_executable)
21LOCAL_MODULE_TAGS := optional
22LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/nativetest
23LOCAL_MULTILIB := both
24LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32
25LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
26
27LOCAL_SHARED_LIBRARIES += \
28    libdl \
29    libhardware \
30
31LOCAL_WHOLE_STATIC_LIBRARIES += \
32    libHalPowerTests \
33    libVtsGtestMain \
34
35LOCAL_STATIC_LIBRARIES += \
36    libbase \
37    libtinyxml2 \
38    liblog \
39    libgtest \
40
41# Tag this module as a vts test artifact
42LOCAL_COMPATIBILITY_SUITE := vts
43
44include $(BUILD_EXECUTABLE)
45
46# VTS testcase isn't designed to be run on host due to its dependencies to
47# libhardware or other android runtime.
48build_host := false
49common_additional_dependencies := $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/../Android.build.mk
50
51# -----------------------------------------------------------------------------
52# All standard tests.
53# -----------------------------------------------------------------------------
54
55libHalPowerStandardTests_src_files := \
56    hal_power_basic_test.cpp
57
58libHalPowerStandardTests_cflags := \
59    $(test_cflags) \
60
61libHalPowerStandardTests_cppflags := \
62    $(test_cppflags) \
63
64libHalPowerStandardTests_c_includes := \
65    test/vts/testcases/include \
66    external/tinyxml2 \
67
68libHalPowerStandardTests_static_libraries := \
69    libbase \
70
71libHalPowerStandardTests_ldlibs_host := \
72    -lrt \
73
74module := libHalPowerStandardTests
75module_tag := optional
76build_type := target
77build_target := STATIC_TEST_LIBRARY
78include $(LOCAL_PATH)/../Android.build.mk
79build_type := host
80include $(LOCAL_PATH)/../Android.build.mk
81
82# Library of all tests (excluding the dynamic linker tests).
83# -----------------------------------------------------------------------------
84libHalPowerTests_whole_static_libraries := \
85    libHalPowerStandardTests \
86
87
88module := libHalPowerTests
89module_tag := optional
90build_type := target
91build_target := STATIC_TEST_LIBRARY
92include $(LOCAL_PATH)/../Android.build.mk
93build_type := host
94include $(LOCAL_PATH)/../Android.build.mk
95
96# -----------------------------------------------------------------------------
97# Tests for the device using HAL Lights's .so. Run with:
98#   adb shell /data/nativetest/halpower-unit-tests/halpower-unit-tests32
99#   adb shell /data/nativetest/halpower-unit-tests/halpower-unit-tests64
100#   adb shell /data/nativetest/halpower-unit-tests/halpower-unit-tests-gcc32
101#   adb shell /data/nativetest/halpower-unit-tests/halpower-unit-tests-gcc64
102# -----------------------------------------------------------------------------
103common_halpower-unit-tests_whole_static_libraries := \
104    libHalPowerTests \
105    libVtsGtestMain \
106
107common_halpower-unit-tests_static_libraries := \
108    libtinyxml2 \
109    liblog \
110    libbase \
111
112# TODO: Include __cxa_thread_atexit_test.cpp to glibc tests once it is upgraded (glibc 2.18+)
113common_halpower-unit-tests_src_files := \
114    hal_power_basic_test.cpp \
115
116common_halpower-unit-tests_cflags := $(test_cflags)
117
118common_halpower-unit-tests_conlyflags := \
119    -fexceptions \
120    -fnon-call-exceptions \
121
122common_halpower-unit-tests_cppflags := \
123    $(test_cppflags)
124
125common_halpower-unit-tests_ldflags := \
126    -Wl,--export-dynamic
127
128common_halpower-unit-tests_c_includes := \
129    bionic/libc \
130
131common_halpower-unit-tests_shared_libraries_target := \
132    libdl \
133    libhardware \
134    libpagemap \
135    libdl_preempt_test_1 \
136    libdl_preempt_test_2 \
137    libdl_test_df_1_global \
138
139# The order of these libraries matters, do not shuffle them.
140common_halpower-unit-tests_static_libraries_target := \
141    libbase \
142    libziparchive \
143    libz \
144    libutils \
145
146module_tag := optional
147build_type := target
148build_target := NATIVE_TEST
149
150module := halpower-unit-tests
151halpower-unit-tests_clang_target := true
152halpower-unit-tests_whole_static_libraries := $(common_halpower-unit-tests_whole_static_libraries)
153halpower-unit-tests_static_libraries := $(common_halpower-unit-tests_static_libraries)
154halpower-unit-tests_src_files := $(common_halpower-unit-tests_src_files)
155halpower-unit-tests_cflags := $(common_halpower-unit-tests_cflags)
156halpower-unit-tests_conlyflags := $(common_halpower-unit-tests_conlyflags)
157halpower-unit-tests_cppflags := $(common_halpower-unit-tests_cppflags)
158halpower-unit-tests_ldflags := $(common_halpower-unit-tests_ldflags)
159halpower-unit-tests_c_includes := $(common_halpower-unit-tests_c_includes)
160halpower-unit-tests_shared_libraries_target := $(common_halpower-unit-tests_shared_libraries_target)
161halpower-unit-tests_static_libraries_target := $(common_halpower-unit-tests_static_libraries_target)
162include $(LOCAL_PATH)/../Android.build.mk
163
164module := halpower-unit-tests-gcc
165halpower-unit-tests-gcc_clang_target := false
166halpower-unit-tests-gcc_whole_static_libraries := $(common_halpower-unit-tests_whole_static_libraries)
167halpower-unit-tests-gcc_static_libraries := $(common_halpower-unit-tests_static_libraries)
168halpower-unit-tests-gcc_src_files := $(common_halpower-unit-tests_src_files)
169halpower-unit-tests-gcc_cflags := $(common_halpower-unit-tests_cflags)
170halpower-unit-tests-gcc_conlyflags := $(common_halpower-unit-tests_conlyflags)
171halpower-unit-tests-gcc_cppflags := $(common_halpower-unit-tests_cppflags)
172halpower-unit-tests-gcc_ldflags := $(common_halpower-unit-tests_ldflags)
173halpower-unit-tests-gcc_c_includes := $(common_halpower-unit-tests_c_includes)
174halpower-unit-tests-gcc_shared_libraries_target := $(common_halpower-unit-tests_shared_libraries_target)
175halpower-unit-tests-gcc_static_libraries_target := $(common_halpower-unit-tests_static_libraries_target)
176include $(LOCAL_PATH)/../Android.build.mk
177