Add debug version of libnativebridgetest.so
We need both versions and load the correct one.
Test: test.py -r --ndebug -t 115
Test: test.py -r --debug -t 115
Change-Id: I189d4d92a7eea63d6ebd4040d12926bc0c3f1154
diff --git a/test/115-native-bridge/run b/test/115-native-bridge/run
index 22f5c67..8ce44a9 100644
--- a/test/115-native-bridge/run
+++ b/test/115-native-bridge/run
@@ -16,11 +16,16 @@
ARGS=${@}
+BRIDGE_SO=libnativebridgetestd.so
+if echo ${ARGS} | grep -q " -O"; then
+ BRIDGE_SO=libnativebridgetest.so
+fi
+
# Use libnativebridgetest as a native bridge, start NativeBridgeMain (Main is JniTest main file).
LIBPATH=$(echo ${ARGS} | sed -r 's/.*Djava.library.path=([^ ]*) .*/\1/')
# Trim all but the last entry in LIBPATH, which will be nativetest[64]
LIBPATH=${LIBPATH##*:}
-ln -sf ${LIBPATH}/libnativebridgetest.so .
+ln -sf ${LIBPATH}/$BRIDGE_SO .
touch libarttest.so
touch libarttestd.so
touch libinvalid.so
@@ -31,4 +36,4 @@
LEFT=$(echo ${ARGS} | sed -r 's/-Djava.library.path.*//')
RIGHT=$(echo ${ARGS} | sed -r 's/.*Djava.library.path[^ ]* //')
MODARGS="${LEFT} -Djava.library.path=`pwd` ${RIGHT}"
-exec ${RUN} --runtime-option -Xforce-nb-testing --runtime-option -XX:NativeBridge=libnativebridgetest.so ${MODARGS} NativeBridgeMain
+exec ${RUN} --runtime-option -Xforce-nb-testing --runtime-option -XX:NativeBridge=$BRIDGE_SO ${MODARGS} NativeBridgeMain
diff --git a/test/Android.bp b/test/Android.bp
index 2ed915b..8b40d3c 100644
--- a/test/Android.bp
+++ b/test/Android.bp
@@ -536,18 +536,33 @@
],
}
-art_cc_test_library {
- name: "libnativebridgetest",
- shared_libs: ["libartd"],
+art_cc_defaults {
+ name: "libnativebridgetest-defaults",
defaults: [
"art_test_defaults",
- "art_debug_defaults",
"art_defaults",
],
header_libs: ["libnativebridge-headers"],
srcs: ["115-native-bridge/nativebridge.cc"],
}
+art_cc_test_library {
+ name: "libnativebridgetest",
+ shared_libs: ["libart"],
+ defaults: [
+ "libnativebridgetest-defaults",
+ ],
+}
+
+art_cc_test_library {
+ name: "libnativebridgetestd",
+ shared_libs: ["libartd"],
+ defaults: [
+ "libnativebridgetest-defaults",
+ "art_debug_defaults",
+ ],
+}
+
filegroup {
name: "art_cts_jvmti_test_library",
srcs: [
diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk
index e3157ef..1ab2205 100644
--- a/test/Android.run-test.mk
+++ b/test/Android.run-test.mk
@@ -42,7 +42,7 @@
ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += libarttest-target libarttestd-target
# Also need libnativebridgetest.
-ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += libnativebridgetest-target
+ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += libnativebridgetest-target libnativebridgetestd-target
# Also need libopenjdkjvmti.
ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += libopenjdkjvmti-target libopenjdkjvmtid-target
@@ -65,6 +65,7 @@
$(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libarttest) \
$(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libarttestd) \
$(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libnativebridgetest) \
+ $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libnativebridgetestd) \
$(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \
$(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \
$(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$(ART_HOST_SHLIB_EXTENSION) \
@@ -83,6 +84,7 @@
$(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libarttest) \
$(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libarttestd) \
$(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libnativebridgetest) \
+ $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libnativebridgetestd) \
$(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \
$(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \
$(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$(ART_HOST_SHLIB_EXTENSION) \