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 := VtsHalLightsTestCases 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 libHalLightsTests \ 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 55libHalLightsStandardTests_src_files := \ 56 hal_lights_basic_test.cpp 57 58libHalLightsStandardTests_cflags := \ 59 $(test_cflags) \ 60 61libHalLightsStandardTests_cppflags := \ 62 $(test_cppflags) \ 63 64libHalLightsStandardTests_c_includes := \ 65 test/vts/testcases/include \ 66 external/tinyxml2 \ 67 68libHalLightsStandardTests_static_libraries := \ 69 libbase \ 70 71libHalLightsStandardTests_ldlibs_host := \ 72 -lrt \ 73 74module := libHalLightsStandardTests 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# ----------------------------------------------------------------------------- 84libHalLightsTests_whole_static_libraries := \ 85 libHalLightsStandardTests \ 86 87 88module := libHalLightsTests 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/hallights-unit-tests/hallights-unit-tests32 99# adb shell /data/nativetest/hallights-unit-tests/hallights-unit-tests64 100# adb shell /data/nativetest/hallights-unit-tests/hallights-unit-tests-gcc32 101# adb shell /data/nativetest/hallights-unit-tests/hallights-unit-tests-gcc64 102# ----------------------------------------------------------------------------- 103common_hallights-unit-tests_whole_static_libraries := \ 104 libHalLightsTests \ 105 libVtsGtestMain \ 106 107common_hallights-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_hallights-unit-tests_src_files := \ 114 hal_lights_basic_test.cpp \ 115 116common_hallights-unit-tests_cflags := $(test_cflags) 117 118common_hallights-unit-tests_conlyflags := \ 119 -fexceptions \ 120 -fnon-call-exceptions \ 121 122common_hallights-unit-tests_cppflags := \ 123 $(test_cppflags) 124 125common_hallights-unit-tests_ldflags := \ 126 -Wl,--export-dynamic 127 128common_hallights-unit-tests_c_includes := \ 129 bionic/libc \ 130 131common_hallights-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_hallights-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 := hallights-unit-tests 151hallights-unit-tests_clang_target := true 152hallights-unit-tests_whole_static_libraries := $(common_hallights-unit-tests_whole_static_libraries) 153hallights-unit-tests_static_libraries := $(common_hallights-unit-tests_static_libraries) 154hallights-unit-tests_src_files := $(common_hallights-unit-tests_src_files) 155hallights-unit-tests_cflags := $(common_hallights-unit-tests_cflags) 156hallights-unit-tests_conlyflags := $(common_hallights-unit-tests_conlyflags) 157hallights-unit-tests_cppflags := $(common_hallights-unit-tests_cppflags) 158hallights-unit-tests_ldflags := $(common_hallights-unit-tests_ldflags) 159hallights-unit-tests_c_includes := $(common_hallights-unit-tests_c_includes) 160hallights-unit-tests_shared_libraries_target := $(common_hallights-unit-tests_shared_libraries_target) 161hallights-unit-tests_static_libraries_target := $(common_hallights-unit-tests_static_libraries_target) 162include $(LOCAL_PATH)/../Android.build.mk 163 164module := hallights-unit-tests-gcc 165hallights-unit-tests-gcc_clang_target := false 166hallights-unit-tests-gcc_whole_static_libraries := $(common_hallights-unit-tests_whole_static_libraries) 167hallights-unit-tests-gcc_static_libraries := $(common_hallights-unit-tests_static_libraries) 168hallights-unit-tests-gcc_src_files := $(common_hallights-unit-tests_src_files) 169hallights-unit-tests-gcc_cflags := $(common_hallights-unit-tests_cflags) 170hallights-unit-tests-gcc_conlyflags := $(common_hallights-unit-tests_conlyflags) 171hallights-unit-tests-gcc_cppflags := $(common_hallights-unit-tests_cppflags) 172hallights-unit-tests-gcc_ldflags := $(common_hallights-unit-tests_ldflags) 173hallights-unit-tests-gcc_c_includes := $(common_hallights-unit-tests_c_includes) 174hallights-unit-tests-gcc_shared_libraries_target := $(common_hallights-unit-tests_shared_libraries_target) 175hallights-unit-tests-gcc_static_libraries_target := $(common_hallights-unit-tests_static_libraries_target) 176include $(LOCAL_PATH)/../Android.build.mk 177