blob: 4ed6e20e63bb9650771a129dd2c7524b3e9d4146 [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 \
Calin Juravlef9d9e2a2014-10-17 13:45:39 +010032 libnativebridge \
33 libnativebridge-dummy
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070034
Martin Stjernholm53aec482018-10-22 01:34:56 +010035header_libraries := \
36 libbase_headers
37
Chih-Hung Hsieh048df232017-10-31 15:54:05 -070038libnativebridge_tests_common_cflags := \
39 -Wall \
40 -Werror \
41
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070042$(foreach file,$(test_src_files), \
43 $(eval include $(CLEAR_VARS)) \
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070044 $(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \
Martin Stjernholm53aec482018-10-22 01:34:56 +010045 $(eval LOCAL_HEADER_LIBRARIES := $(header_libraries)) \
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070046 $(eval LOCAL_SRC_FILES := $(file)) \
Chih-Hung Hsieh048df232017-10-31 15:54:05 -070047 $(eval LOCAL_CFLAGS := $(libnativebridge_tests_common_cflags)) \
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070048 $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \
49 $(eval include $(BUILD_NATIVE_TEST)) \
50)
51
52$(foreach file,$(test_src_files), \
53 $(eval include $(CLEAR_VARS)) \
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070054 $(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \
Martin Stjernholm53aec482018-10-22 01:34:56 +010055 $(eval LOCAL_HEADER_LIBRARIES := $(header_libraries)) \
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070056 $(eval LOCAL_SRC_FILES := $(file)) \
Chih-Hung Hsieh048df232017-10-31 15:54:05 -070057 $(eval LOCAL_CFLAGS := $(libnativebridge_tests_common_cflags)) \
Andreas Gampecd2ef4c2014-08-19 22:31:31 -070058 $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \
59 $(eval include $(BUILD_HOST_NATIVE_TEST)) \
Andreas Gampe049249c2014-08-19 22:31:31 -070060)