summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/config.mk6
-rw-r--r--core/host_native_test.mk9
-rw-r--r--core/host_shared_test_lib.mk8
-rw-r--r--core/host_static_test_lib.mk8
-rw-r--r--core/host_test_internal.mk11
-rw-r--r--core/native_test.mk16
-rw-r--r--core/shared_test_lib.mk8
-rw-r--r--core/static_test_lib.mk8
-rw-r--r--core/target_test_internal.mk19
9 files changed, 70 insertions, 23 deletions
diff --git a/core/config.mk b/core/config.mk
index ee47772..aa64c60 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -78,6 +78,12 @@ BUILD_DROIDDOC:= $(BUILD_SYSTEM)/droiddoc.mk
BUILD_COPY_HEADERS := $(BUILD_SYSTEM)/copy_headers.mk
BUILD_NATIVE_TEST := $(BUILD_SYSTEM)/native_test.mk
BUILD_HOST_NATIVE_TEST := $(BUILD_SYSTEM)/host_native_test.mk
+
+BUILD_SHARED_TEST_LIBRARY := $(BUILD_SYSTEM)/shared_test_lib.mk
+BUILD_HOST_SHARED_TEST_LIBRARY := $(BUILD_SYSTEM)/host_shared_test_lib.mk
+BUILD_STATIC_TEST_LIBRARY := $(BUILD_SYSTEM)/static_test_lib.mk
+BUILD_HOST_STATIC_TEST_LIBRARY := $(BUILD_SYSTEM)/host_static_test_lib.mk
+
BUILD_NOTICE_FILE := $(BUILD_SYSTEM)/notice_files.mk
BUILD_HOST_DALVIK_JAVA_LIBRARY := $(BUILD_SYSTEM)/host_dalvik_java_library.mk
BUILD_HOST_DALVIK_STATIC_JAVA_LIBRARY := $(BUILD_SYSTEM)/host_dalvik_static_java_library.mk
diff --git a/core/host_native_test.mk b/core/host_native_test.mk
index a631364..b54bd3a 100644
--- a/core/host_native_test.mk
+++ b/core/host_native_test.mk
@@ -3,13 +3,6 @@
## Common flags for host native tests are added.
################################################
-LOCAL_CFLAGS += -DGTEST_OS_LINUX -DGTEST_HAS_STD_STRING -O0 -g
-LOCAL_C_INCLUDES += \
- external/gtest/include
-
-LOCAL_STATIC_LIBRARIES += libgtest_host libgtest_main_host
-LOCAL_SHARED_LIBRARIES +=
-
-LOCAL_LDFLAGS += -lpthread
+include $(BUILD_SYSTEM)/host_test_internal.mk
include $(BUILD_HOST_EXECUTABLE)
diff --git a/core/host_shared_test_lib.mk b/core/host_shared_test_lib.mk
new file mode 100644
index 0000000..1eb9b26
--- /dev/null
+++ b/core/host_shared_test_lib.mk
@@ -0,0 +1,8 @@
+##################################################
+## A thin wrapper around BUILD_HOST_SHARED_LIBRARY
+## Common flags for host native tests are added.
+##################################################
+
+include $(BUILD_SYSTEM)/host_test_internal.mk
+
+include $(BUILD_HOST_SHARED_LIBRARY)
diff --git a/core/host_static_test_lib.mk b/core/host_static_test_lib.mk
new file mode 100644
index 0000000..5423dc6
--- /dev/null
+++ b/core/host_static_test_lib.mk
@@ -0,0 +1,8 @@
+##################################################
+## A thin wrapper around BUILD_HOST_STATIC_LIBRARY
+## Common flags for host native tests are added.
+##################################################
+
+include $(BUILD_SYSTEM)/host_test_internal.mk
+
+include $(BUILD_HOST_STATIC_LIBRARY)
diff --git a/core/host_test_internal.mk b/core/host_test_internal.mk
new file mode 100644
index 0000000..650b9c6
--- /dev/null
+++ b/core/host_test_internal.mk
@@ -0,0 +1,11 @@
+#####################################################
+## Shared definitions for all host test compilations.
+#####################################################
+
+LOCAL_CFLAGS += -DGTEST_OS_LINUX -DGTEST_HAS_STD_STRING -O0 -g
+LOCAL_C_INCLUDES += external/gtest/include
+
+LOCAL_STATIC_LIBRARIES += libgtest_host libgtest_main_host
+LOCAL_SHARED_LIBRARIES +=
+
+LOCAL_LDLIBS += -lpthread
diff --git a/core/native_test.mk b/core/native_test.mk
index 12cf4af..fc08f79 100644
--- a/core/native_test.mk
+++ b/core/native_test.mk
@@ -3,20 +3,6 @@
## Common flags for native tests are added.
###########################################
-LOCAL_CFLAGS += -DGTEST_OS_LINUX_ANDROID -DGTEST_HAS_STD_STRING
-
-LOCAL_C_INCLUDES += external/gtest/include
-LOCAL_STATIC_LIBRARIES += libgtest libgtest_main
-
-ifndef LOCAL_SDK_VERSION
-LOCAL_C_INCLUDES += bionic \
- bionic/libstdc++/include \
- external/stlport/stlport
-LOCAL_SHARED_LIBRARIES += libstlport
-endif
-
-ifndef LOCAL_MODULE_PATH
-LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)
-endif
+include $(BUILD_SYSTEM)/target_test_internal.mk
include $(BUILD_EXECUTABLE)
diff --git a/core/shared_test_lib.mk b/core/shared_test_lib.mk
new file mode 100644
index 0000000..fbfdc9c
--- /dev/null
+++ b/core/shared_test_lib.mk
@@ -0,0 +1,8 @@
+#############################################
+## A thin wrapper around BUILD_SHARED_LIBRARY
+## Common flags for native tests are added.
+#############################################
+
+include $(BUILD_SYSTEM)/target_test_internal.mk
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/core/static_test_lib.mk b/core/static_test_lib.mk
new file mode 100644
index 0000000..9d0bcc8
--- /dev/null
+++ b/core/static_test_lib.mk
@@ -0,0 +1,8 @@
+#############################################
+## A thin wrapper around BUILD_STATIC_LIBRARY
+## Common flags for native tests are added.
+#############################################
+
+include $(BUILD_SYSTEM)/target_test_internal.mk
+
+include $(BUILD_STATIC_LIBRARY)
diff --git a/core/target_test_internal.mk b/core/target_test_internal.mk
new file mode 100644
index 0000000..e531356
--- /dev/null
+++ b/core/target_test_internal.mk
@@ -0,0 +1,19 @@
+#######################################################
+## Shared definitions for all target test compilations.
+#######################################################
+
+LOCAL_CFLAGS += -DGTEST_OS_LINUX_ANDROID -DGTEST_HAS_STD_STRING
+
+LOCAL_C_INCLUDES += external/gtest/include
+LOCAL_STATIC_LIBRARIES += libgtest libgtest_main
+
+ifndef LOCAL_SDK_VERSION
+LOCAL_C_INCLUDES += bionic \
+ bionic/libstdc++/include \
+ external/stlport/stlport
+LOCAL_SHARED_LIBRARIES += libstlport
+endif
+
+ifndef LOCAL_MODULE_PATH
+LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(LOCAL_MODULE)
+endif