From 7953020e6a19b1a08b778d4b0e6426286e7ddb89 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 21 Jan 2015 20:41:48 -0500 Subject: [PATCH] Add a small test harness executable. --- .gitignore | 1 + jni/Android.mk | 1 + jni/minibind/Android.mk | 1 + jni/test/Android.mk | 11 +++++++++++ jni/test/main.cc | 6 ++++++ run_tests.sh | 5 +++++ 6 files changed, 25 insertions(+) create mode 100644 jni/test/Android.mk create mode 100644 jni/test/main.cc create mode 100755 run_tests.sh diff --git a/.gitignore b/.gitignore index 15cd4ea..c8e15cd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +libs/ local.properties obj/ diff --git a/jni/Android.mk b/jni/Android.mk index 9494502..674de17 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -1,3 +1,4 @@ TOP_DIR := $(call my-dir) include $(TOP_DIR)/minibind/Android.mk +include $(TOP_DIR)/test/Android.mk diff --git a/jni/minibind/Android.mk b/jni/minibind/Android.mk index 83ab355..f2e2cc7 100644 --- a/jni/minibind/Android.mk +++ b/jni/minibind/Android.mk @@ -4,6 +4,7 @@ include $(CLEAR_VARS) LOCAL_MODULE := minibind LOCAL_SRC_FILES := minibind.cc parcel.cc channel.cc command.cc +LOCAL_LDLIBS := -llog LOCAL_CFLAGS := -DBINDER_IPC_32BIT=1 include $(BUILD_STATIC_LIBRARY) diff --git a/jni/test/Android.mk b/jni/test/Android.mk new file mode 100644 index 0000000..f472075 --- /dev/null +++ b/jni/test/Android.mk @@ -0,0 +1,11 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := minibind_test +LOCAL_SRC_FILES := main.cc +LOCAL_STATIC_LIBRARIES := minibind +LOCAL_C_INCLUDES := $(LOCAL_PATH)/../ +LOCAL_LDLIBS := -llog + +include $(BUILD_EXECUTABLE) diff --git a/jni/test/main.cc b/jni/test/main.cc new file mode 100644 index 0000000..dcb0d85 --- /dev/null +++ b/jni/test/main.cc @@ -0,0 +1,6 @@ +#include + +int main() { + minibind::Channel* ch = minibind::LookupService("package"); + return 0; +} diff --git a/run_tests.sh b/run_tests.sh new file mode 100755 index 0000000..feee2b3 --- /dev/null +++ b/run_tests.sh @@ -0,0 +1,5 @@ +set -e + +adb push ./libs/armeabi/minibind_test /data/local/tmp +adb shell /data/local/tmp/minibind_test +adb logcat -s -d minibind:V -- 2.43.5