blob: 5b9ba1cde19d82b27d96b7e74f2f40e8d2e096f1 [file] [log] [blame]
Andreas Gampecd2ef4c2014-08-19 22:31:31 -07001# Build the unit tests.
2LOCAL_PATH := $(call my-dir)
Calin Juravlef9d9e2a2014-10-17 13:45:39 +01003
Andreas Gampecd2ef4c2014-08-19 22:31:31 -07004include $(CLEAR_VARS)
5
6# Build the unit tests.
7test_src_files := \
Calin Juravle59a719c2014-10-28 12:43:24 +00008 CodeCacheCreate_test.cpp \
9 CodeCacheExists_test.cpp \
jgu21cef898f2015-07-02 12:02:11 +080010 CodeCacheStatFail_test.cpp \
Calin Juravlef9d9e2a2014-10-17 13:45:39 +010011 CompleteFlow_test.cpp \
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070012 InvalidCharsNativeBridge_test.cpp \
Andreas Gampea6ac9ce2015-04-30 20:39:12 -070013 NativeBridge2Signal_test.cpp \
14 NativeBridgeVersion_test.cpp \
Andreas Gampe04054e22014-09-25 22:33:01 -070015 NeedsNativeBridge_test.cpp \
16 PreInitializeNativeBridge_test.cpp \
Calin Juravlef9d9e2a2014-10-17 13:45:39 +010017 PreInitializeNativeBridgeFail1_test.cpp \
18 PreInitializeNativeBridgeFail2_test.cpp \
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070019 ReSetupNativeBridge_test.cpp \
20 UnavailableNativeBridge_test.cpp \
Zhenhua WANGf2804e52016-05-30 11:16:08 +080021 ValidNameNativeBridge_test.cpp \
22 NativeBridge3UnloadLibrary_test.cpp \
23 NativeBridge3GetError_test.cpp \
24 NativeBridge3IsPathSupported_test.cpp \
Zhenhua WANGe8fb11d2017-02-27 10:14:45 +080025 NativeBridge3InitAnonymousNamespace_test.cpp \
Zhenhua WANGf2804e52016-05-30 11:16:08 +080026 NativeBridge3CreateNamespace_test.cpp \
27 NativeBridge3LoadLibraryExt_test.cpp
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070028
Calin Juravlef9d9e2a2014-10-17 13:45:39 +010029
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070030shared_libraries := \
31 liblog \
dimitryb6ba8172017-08-23 10:25:22 +020032 libbase \
Calin Juravlef9d9e2a2014-10-17 13:45:39 +010033 libnativebridge \
34 libnativebridge-dummy
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070035
Chih-Hung Hsieh048df232017-10-31 15:54:05 -070036libnativebridge_tests_common_cflags := \
37 -Wall \
38 -Werror \
39
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070040$(foreach file,$(test_src_files), \
41 $(eval include $(CLEAR_VARS)) \
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070042 $(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \
43 $(eval LOCAL_SRC_FILES := $(file)) \
Chih-Hung Hsieh048df232017-10-31 15:54:05 -070044 $(eval LOCAL_CFLAGS := $(libnativebridge_tests_common_cflags)) \
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070045 $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \
46 $(eval include $(BUILD_NATIVE_TEST)) \
47)
48
49$(foreach file,$(test_src_files), \
50 $(eval include $(CLEAR_VARS)) \
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070051 $(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \
52 $(eval LOCAL_SRC_FILES := $(file)) \
Chih-Hung Hsieh048df232017-10-31 15:54:05 -070053 $(eval LOCAL_CFLAGS := $(libnativebridge_tests_common_cflags)) \
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070054 $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \
55 $(eval include $(BUILD_HOST_NATIVE_TEST)) \
Andreas Gampe049249c2014-08-19 22:31:31 -070056)