diff options
author | 2015-08-27 10:25:02 -0700 | |
---|---|---|
committer | 2015-08-27 15:16:30 -0700 | |
commit | 031768a340634e2dbdec1aebb2bb3fe509b2f1f6 (patch) | |
tree | dcc51b140b69e90f60045d846f4c890bd322e1ad | |
parent | dfb5f9ceb277f30ee961b27e72d968e0695611a6 (diff) |
Add non debug version of libarttest
We now pass the libarttest as an argument to the java program. This
enables using libarttestd by default and libarttest when -O is
specified.
Change-Id: I0de1ae01e2bb5f7b9c7fd7487b6cb55051f60657
31 files changed, 68 insertions, 126 deletions
diff --git a/test/002-sleep/src/Main.java b/test/002-sleep/src/Main.java index c1a2d83c52..55032fd0a7 100644 --- a/test/002-sleep/src/Main.java +++ b/test/002-sleep/src/Main.java @@ -2,8 +2,8 @@ public class Main { static public void main(String[] args) throws Exception { int millis = 1000; - if (args.length != 0) { - millis = Integer.parseInt(args[0]); + if (args.length > 1) { + millis = Integer.parseInt(args[1]); } System.out.println("Sleeping " + millis + " msec..."); diff --git a/test/004-JniTest/src/Main.java b/test/004-JniTest/src/Main.java index 810dda0e71..dd88db0b7c 100644 --- a/test/004-JniTest/src/Main.java +++ b/test/004-JniTest/src/Main.java @@ -20,7 +20,7 @@ import java.lang.reflect.Proxy; public class Main { public static void main(String[] args) { - System.loadLibrary("arttest"); + System.loadLibrary(args[0]); testFindClassOnAttachedNativeThread(); testFindFieldOnAttachedNativeThread(); testReflectFieldGetFromAttachedNativeThreadNative(); diff --git a/test/004-ReferenceMap/src/Main.java b/test/004-ReferenceMap/src/Main.java index f9a5498d9e..dacd748ec5 100644 --- a/test/004-ReferenceMap/src/Main.java +++ b/test/004-ReferenceMap/src/Main.java @@ -36,11 +36,8 @@ public class Main { } native int refmap(int x); - static { - System.loadLibrary("arttest"); - } - public static void main(String[] args) { + System.loadLibrary(args[0]); Main rm = new Main(); rm.f(); } diff --git a/test/004-SignalTest/src/Main.java b/test/004-SignalTest/src/Main.java index 8b1f49bacb..626691815a 100644 --- a/test/004-SignalTest/src/Main.java +++ b/test/004-SignalTest/src/Main.java @@ -24,8 +24,7 @@ public class Main { } public static void main(String[] args) { - System.loadLibrary("arttest"); - + System.loadLibrary(args[0]); System.out.println("init signal test"); initSignalTest(); try { diff --git a/test/004-StackWalk/src/Main.java b/test/004-StackWalk/src/Main.java index 9a1d0ab9f2..883ce2c9fe 100644 --- a/test/004-StackWalk/src/Main.java +++ b/test/004-StackWalk/src/Main.java @@ -87,11 +87,8 @@ public class Main { native int stackmap(int x); - static { - System.loadLibrary("arttest"); - } - public static void main(String[] args) throws Exception { + System.loadLibrary(args[0]); Main st = new Main(); st.$noinline$f(); } diff --git a/test/004-ThreadStress/src/Main.java b/test/004-ThreadStress/src/Main.java index d5b389f628..4eeae2f295 100644 --- a/test/004-ThreadStress/src/Main.java +++ b/test/004-ThreadStress/src/Main.java @@ -310,7 +310,8 @@ public class Main implements Runnable { boolean dumpMap = false; if (args != null) { - for (int i = 0; i < args.length; i++) { + // args[0] is libarttest + for (int i = 1; i < args.length; i++) { if (args[i].equals("-n")) { i++; numberOfThreads = Integer.parseInt(args[i]); diff --git a/test/004-UnsafeTest/src/Main.java b/test/004-UnsafeTest/src/Main.java index 818f5d9806..c93db50ab8 100644 --- a/test/004-UnsafeTest/src/Main.java +++ b/test/004-UnsafeTest/src/Main.java @@ -18,10 +18,6 @@ import java.lang.reflect.Field; import sun.misc.Unsafe; public class Main { - static { - System.loadLibrary("arttest"); - } - private static void check(int actual, int expected, String msg) { if (actual != expected) { System.out.println(msg + " : " + actual + " != " + expected); @@ -51,6 +47,7 @@ public class Main { } public static void main(String[] args) throws Exception { + System.loadLibrary(args[0]); Unsafe unsafe = getUnsafe(); check(unsafe.arrayBaseOffset(boolean[].class), vmArrayBaseOffset(boolean[].class), "Unsafe.arrayBaseOffset(boolean[])"); diff --git a/test/051-thread/src/Main.java b/test/051-thread/src/Main.java index b81273ea4e..2e26b22265 100644 --- a/test/051-thread/src/Main.java +++ b/test/051-thread/src/Main.java @@ -20,11 +20,8 @@ import java.util.ArrayList; * Test some basic thread stuff. */ public class Main { - static { - System.loadLibrary("arttest"); - } - public static void main(String[] args) throws Exception { + System.loadLibrary(args[0]); System.out.println("thread test starting"); testThreadCapacity(); testThreadDaemons(); diff --git a/test/101-fibonacci/src/Main.java b/test/101-fibonacci/src/Main.java index 3773e1b123..c594edbded 100644 --- a/test/101-fibonacci/src/Main.java +++ b/test/101-fibonacci/src/Main.java @@ -43,7 +43,7 @@ class Main { } public static void main(String[] args) { - String arg = (args.length > 0) ? args[0] : "10"; + String arg = (args.length > 1) ? args[1] : "10"; try { int x = Integer.parseInt(arg); int y = fibonacci(x); diff --git a/test/115-native-bridge/run b/test/115-native-bridge/run index 32a9975c4b..ea2045b86c 100644 --- a/test/115-native-bridge/run +++ b/test/115-native-bridge/run @@ -20,7 +20,9 @@ ARGS=${@} LIBPATH=$(echo ${ARGS} | sed -r 's/.*Djava.library.path=([^ ]*) .*/\1/') ln -s ${LIBPATH}/libnativebridgetest.so . touch libarttest.so +touch libarttestd.so ln -s ${LIBPATH}/libarttest.so libarttest2.so +ln -s ${LIBPATH}/libarttestd.so libarttestd2.so # pwd likely has /, so it's a pain to put that into a sed rule. LEFT=$(echo ${ARGS} | sed -r 's/-Djava.library.path.*//') diff --git a/test/115-native-bridge/src/NativeBridgeMain.java b/test/115-native-bridge/src/NativeBridgeMain.java index 25390f7504..c298b1b772 100644 --- a/test/115-native-bridge/src/NativeBridgeMain.java +++ b/test/115-native-bridge/src/NativeBridgeMain.java @@ -189,7 +189,7 @@ public class NativeBridgeMain { static public void main(String[] args) throws Exception { System.out.println("Ready for native bridge tests."); - System.loadLibrary("arttest"); + System.loadLibrary(args[0]); Main.main(null); } diff --git a/test/116-nodex2oat/src/Main.java b/test/116-nodex2oat/src/Main.java index 37ac9d5b78..086ffb9295 100644 --- a/test/116-nodex2oat/src/Main.java +++ b/test/116-nodex2oat/src/Main.java @@ -16,6 +16,7 @@ public class Main { public static void main(String[] args) { + System.loadLibrary(args[0]); System.out.println( "Has oat is " + hasOat() + ", is dex2oat enabled is " + isDex2OatEnabled() + "."); @@ -26,10 +27,6 @@ public class Main { } } - static { - System.loadLibrary("arttest"); - } - private native static boolean hasOat(); private native static boolean isDex2OatEnabled(); diff --git a/test/117-nopatchoat/src/Main.java b/test/117-nopatchoat/src/Main.java index 7bc9dbb947..223e12084d 100644 --- a/test/117-nopatchoat/src/Main.java +++ b/test/117-nopatchoat/src/Main.java @@ -16,6 +16,8 @@ public class Main { public static void main(String[] args) { + System.loadLibrary(args[0]); + boolean executable_correct = (isPic() ? hasExecutableOat() == true : hasExecutableOat() == isDex2OatEnabled()); @@ -41,10 +43,6 @@ public class Main { return ret.substring(0, ret.length() - 1); } - static { - System.loadLibrary("arttest"); - } - private native static boolean isDex2OatEnabled(); private native static boolean isPic(); diff --git a/test/118-noimage-dex2oat/src/Main.java b/test/118-noimage-dex2oat/src/Main.java index 9bf5bb3b08..dba9166ad5 100644 --- a/test/118-noimage-dex2oat/src/Main.java +++ b/test/118-noimage-dex2oat/src/Main.java @@ -19,6 +19,7 @@ import java.lang.reflect.Method; public class Main { public static void main(String[] args) throws Exception { + System.loadLibrary(args[0]); boolean hasImage = hasImage(); String instructionSet = VMRuntime.getCurrentInstructionSet(); boolean isBootClassPathOnDisk = VMRuntime.isBootClassPathOnDisk(instructionSet); @@ -41,10 +42,6 @@ public class Main { testB18485243(); } - static { - System.loadLibrary("arttest"); - } - private native static boolean hasImage(); private native static boolean isImageDex2OatEnabled(); diff --git a/test/119-noimage-patchoat/src/Main.java b/test/119-noimage-patchoat/src/Main.java index 11c736a7d6..6a70f5885b 100644 --- a/test/119-noimage-patchoat/src/Main.java +++ b/test/119-noimage-patchoat/src/Main.java @@ -16,6 +16,7 @@ public class Main { public static void main(String[] args) { + System.loadLibrary(args[0]); boolean hasImage = hasImage(); System.out.println( "Has image is " + hasImage + ", is image dex2oat enabled is " @@ -28,10 +29,6 @@ public class Main { } } - static { - System.loadLibrary("arttest"); - } - private native static boolean hasImage(); private native static boolean isImageDex2OatEnabled(); diff --git a/test/131-structural-change/src/Main.java b/test/131-structural-change/src/Main.java index 8dfa2808a2..6cbbd12387 100644 --- a/test/131-structural-change/src/Main.java +++ b/test/131-structural-change/src/Main.java @@ -23,6 +23,7 @@ import java.lang.reflect.Method; */ public class Main { public static void main(String[] args) { + System.loadLibrary(args[0]); new Main().run(); } @@ -49,9 +50,5 @@ public class Main { System.out.println("Done."); } - static { - System.loadLibrary("arttest"); - } - private native static boolean hasOat(); } diff --git a/test/134-nodex2oat-nofallback/src/Main.java b/test/134-nodex2oat-nofallback/src/Main.java index 37ac9d5b78..086ffb9295 100644 --- a/test/134-nodex2oat-nofallback/src/Main.java +++ b/test/134-nodex2oat-nofallback/src/Main.java @@ -16,6 +16,7 @@ public class Main { public static void main(String[] args) { + System.loadLibrary(args[0]); System.out.println( "Has oat is " + hasOat() + ", is dex2oat enabled is " + isDex2OatEnabled() + "."); @@ -26,10 +27,6 @@ public class Main { } } - static { - System.loadLibrary("arttest"); - } - private native static boolean hasOat(); private native static boolean isDex2OatEnabled(); diff --git a/test/137-cfi/src/Main.java b/test/137-cfi/src/Main.java index 6cd187a033..dc3ef7eb07 100644 --- a/test/137-cfi/src/Main.java +++ b/test/137-cfi/src/Main.java @@ -41,6 +41,7 @@ public class Main implements Comparator<Main> { } public static void main(String[] args) throws Exception { + System.loadLibrary(args[0]); boolean secondary = false; if (args.length > 0 && args[args.length - 1].equals("--secondary")) { secondary = true; @@ -48,10 +49,6 @@ public class Main implements Comparator<Main> { new Main(secondary).run(); } - static { - System.loadLibrary("arttest"); - } - private void run() { if (secondary) { if (!TEST_REMOTE_UNWINDING) { diff --git a/test/139-register-natives/src/Main.java b/test/139-register-natives/src/Main.java index 35b2f9cabb..8dd2131670 100644 --- a/test/139-register-natives/src/Main.java +++ b/test/139-register-natives/src/Main.java @@ -16,15 +16,12 @@ public class Main { public static void main(String[] args) { + System.loadLibrary(args[0]); testRegistration1(); testRegistration2(); testRegistration3(); } - static { - System.loadLibrary("arttest"); - } - // Test that a subclass' method is registered instead of a superclass' method. private static void testRegistration1() { registerNatives(TestSub.class); diff --git a/test/454-get-vreg/src/Main.java b/test/454-get-vreg/src/Main.java index df07d441a8..95d4190c4d 100644 --- a/test/454-get-vreg/src/Main.java +++ b/test/454-get-vreg/src/Main.java @@ -36,11 +36,8 @@ public class Main { return 42; } - static { - System.loadLibrary("arttest"); - } - public static void main(String[] args) { + System.loadLibrary(args[0]); Main rm = new Main(); if (rm.testSimpleVReg(1, 1.0f, (short)2, true, (byte)3, 'c') != 43) { throw new Error("Expected 43"); diff --git a/test/455-set-vreg/src/Main.java b/test/455-set-vreg/src/Main.java index 2172d9212d..4db9d66f94 100644 --- a/test/455-set-vreg/src/Main.java +++ b/test/455-set-vreg/src/Main.java @@ -40,11 +40,8 @@ public class Main { native void doNativeCallSetVReg(); - static { - System.loadLibrary("arttest"); - } - public static void main(String[] args) { + System.loadLibrary(args[0]); Main rm = new Main(); int intExpected = 5 - 4 - 3 - 2 - 1; int intResult = rm.testIntVReg(0, 0, 0, 0, 0); diff --git a/test/457-regs/src/Main.java b/test/457-regs/src/Main.java index 0d82033195..3b8df443ff 100644 --- a/test/457-regs/src/Main.java +++ b/test/457-regs/src/Main.java @@ -22,6 +22,8 @@ public class Main { class InnerClass {} public static void main(String[] args) throws Exception { + System.loadLibrary(args[0]); + Class<?> c = Class.forName("PhiLiveness"); Method m = c.getMethod("mergeOk", boolean.class, byte.class); m.invoke(null, new Boolean(true), new Byte((byte)2)); @@ -38,8 +40,4 @@ public class Main { m = c.getMethod("phiAllEquivalents", Main.class); m.invoke(null, new Main()); } - - static { - System.loadLibrary("arttest"); - } } diff --git a/test/461-get-reference-vreg/src/Main.java b/test/461-get-reference-vreg/src/Main.java index a94c6fb381..f7d43568d5 100644 --- a/test/461-get-reference-vreg/src/Main.java +++ b/test/461-get-reference-vreg/src/Main.java @@ -38,11 +38,8 @@ public class Main { native int doNativeCallRef(); static native int doStaticNativeCallRef(); - static { - System.loadLibrary("arttest"); - } - public static void main(String[] args) { + System.loadLibrary(args[0]); Main rm = new Main(); if (rm.testThisWithInstanceCall() != 1) { throw new Error("Expected 1"); diff --git a/test/466-get-live-vreg/src/Main.java b/test/466-get-live-vreg/src/Main.java index 851506bf8a..d036a24459 100644 --- a/test/466-get-live-vreg/src/Main.java +++ b/test/466-get-live-vreg/src/Main.java @@ -48,11 +48,8 @@ public class Main { static native void doStaticNativeCallLiveVreg(); - static { - System.loadLibrary("arttest"); - } - public static void main(String[] args) { + System.loadLibrary(args[0]); if (testLiveArgument(staticField3) != staticField3) { throw new Error("Expected " + staticField3); } diff --git a/test/497-inlining-and-class-loader/expected.txt b/test/497-inlining-and-class-loader/expected.txt index 3e1d85e309..f5b9fe07de 100644 --- a/test/497-inlining-and-class-loader/expected.txt +++ b/test/497-inlining-and-class-loader/expected.txt @@ -1,7 +1,7 @@ java.lang.Exception - at Main.$noinline$bar(Main.java:127) + at Main.$noinline$bar(Main.java:124) at Level2.$inline$bar(Level1.java:25) at Level1.$inline$bar(Level1.java:19) at LoadedByMyClassLoader.bar(Main.java:82) at java.lang.reflect.Method.invoke(Native Method) - at Main.main(Main.java:101) + at Main.main(Main.java:98) diff --git a/test/497-inlining-and-class-loader/src/Main.java b/test/497-inlining-and-class-loader/src/Main.java index 0f7eb599cb..832b1f08ee 100644 --- a/test/497-inlining-and-class-loader/src/Main.java +++ b/test/497-inlining-and-class-loader/src/Main.java @@ -84,11 +84,8 @@ class LoadedByMyClassLoader { } class Main { - static { - System.loadLibrary("arttest"); - } - public static void main(String[] args) throws Exception { + System.loadLibrary(args[0]); // Clone resolved methods, to restore the original version just // before we walk the stack in $noinline$bar. savedResolvedMethods = cloneResolvedMethods(Main.class); diff --git a/test/Android.libarttest.mk b/test/Android.libarttest.mk index fcb9f8a779..021e25c967 100644 --- a/test/Android.libarttest.mk +++ b/test/Android.libarttest.mk @@ -38,8 +38,10 @@ LIBARTTEST_COMMON_SRC_FILES := \ 497-inlining-and-class-loader/clear_dex_cache.cc ART_TARGET_LIBARTTEST_$(ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so +ART_TARGET_LIBARTTEST_$(ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttestd.so ifdef TARGET_2ND_ARCH ART_TARGET_LIBARTTEST_$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so + ART_TARGET_LIBARTTEST_$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttestd.so endif # $(1): target or host @@ -49,17 +51,23 @@ define build-libarttest $$(error expected target or host for argument 1, received $(1)) endif endif + ifneq ($(2),d) + ifneq ($(2),) + $$(error d or empty for argument 2, received $(2)) + endif + endif art_target_or_host := $(1) + suffix := $(2) include $(CLEAR_VARS) LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) - LOCAL_MODULE := libarttest + LOCAL_MODULE := libarttest$$(suffix) ifeq ($$(art_target_or_host),target) LOCAL_MODULE_TAGS := tests endif LOCAL_SRC_FILES := $(LIBARTTEST_COMMON_SRC_FILES) - LOCAL_SHARED_LIBRARIES += libartd libbacktrace + LOCAL_SHARED_LIBRARIES += libart$$(suffix) libbacktrace LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.libarttest.mk @@ -84,13 +92,16 @@ define build-libarttest # Clear locally used variables. art_target_or_host := + suffix := endef ifeq ($(ART_BUILD_TARGET),true) - $(eval $(call build-libarttest,target)) + $(eval $(call build-libarttest,target,)) + $(eval $(call build-libarttest,target,d)) endif ifeq ($(ART_BUILD_HOST),true) - $(eval $(call build-libarttest,host)) + $(eval $(call build-libarttest,host,)) + $(eval $(call build-libarttest,host,d)) endif # Clear locally used variables. diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk index 4e6df6ca79..439e42331c 100644 --- a/test/Android.run-test.mk +++ b/test/Android.run-test.mk @@ -378,41 +378,6 @@ ifneq (,$(filter trace stream,$(TRACE_TYPES))) $(PICTEST_TYPES),$(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_TRACING_RUN_TESTS),$(ALL_ADDRESS_SIZES)) endif -TEST_ART_BROKEN_TRACING_RUN_TESTS := - -# The following tests use libarttest.so, which is linked against libartd.so, so will -# not work when libart.so is the one loaded. -# TODO: Find a way to run these tests in ndebug mode. -TEST_ART_BROKEN_NDEBUG_TESTS := \ - 004-JniTest \ - 004-ReferenceMap \ - 004-SignalTest \ - 004-StackWalk \ - 004-UnsafeTest \ - 051-thread \ - 115-native-bridge \ - 116-nodex2oat \ - 117-nopatchoat \ - 118-noimage-dex2oat \ - 119-noimage-patchoat \ - 131-structural-change \ - 137-cfi \ - 139-register-natives \ - 454-get-vreg \ - 455-set-vreg \ - 457-regs \ - 461-get-reference-vreg \ - 466-get-live-vreg \ - 497-inlining-and-class-loader \ - -ifneq (,$(filter ndebug,$(RUN_TYPES))) - ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,$(TARGET_TYPES),ndebug,$(PREBUILD_TYPES), \ - $(COMPILER_TYPES), $(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES),$(IMAGE_TYPES), \ - $(PICTEST_TYPES),$(DEBUGGABLE_TYPES),$(TEST_ART_BROKEN_NDEBUG_TESTS),$(ALL_ADDRESS_SIZES)) -endif - -TEST_ART_BROKEN_NDEBUG_TESTS := - # Known broken tests for the interpreter. # CFI unwinding expects managed frames. TEST_ART_BROKEN_INTERPRETER_RUN_TESTS := \ @@ -602,8 +567,10 @@ TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS) # Also need libarttest. TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so +TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttestd.so ifdef TARGET_2ND_ARCH TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so +TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttestd.so endif # Also need libnativebridgetest. @@ -617,12 +584,14 @@ endif ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \ $(ART_HOST_EXECUTABLES) \ $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \ + $(ART_HOST_OUT_SHARED_LIBRARIES)/libarttestd$(ART_HOST_SHLIB_EXTENSION) \ $(ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \ $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) ifneq ($(HOST_PREFER_32_BIT),true) ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \ $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) \ + $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libarttestd$(ART_HOST_SHLIB_EXTENSION) \ $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libnativebridgetest$(ART_HOST_SHLIB_EXTENSION) \ $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) endif diff --git a/test/StackWalk2/StackWalk2.java b/test/StackWalk2/StackWalk2.java index a879b46447..5e7b22c252 100644 --- a/test/StackWalk2/StackWalk2.java +++ b/test/StackWalk2/StackWalk2.java @@ -50,11 +50,8 @@ public class StackWalk2 { native int refmap2(int x); - static { - System.loadLibrary("arttest"); - } - public static void main(String[] args) { + System.loadLibrary(args[0]); StackWalk2 st = new StackWalk2(); st.f(); } diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar index a1af5774f3..39dc0301d9 100755 --- a/test/etc/run-test-jar +++ b/test/etc/run-test-jar @@ -47,6 +47,7 @@ ZYGOTE="" DEX_VERIFY="" USE_DEX2OAT_AND_PATCHOAT="y" INSTRUCTION_SET_FEATURES="" +ARGS="" while true; do if [ "x$1" = "x--quiet" ]; then @@ -60,6 +61,14 @@ while true; do fi LIB="$1" shift + elif [ "x$1" = "x--testlib" ]; then + shift + if [ "x$1" = "x" ]; then + echo "$0 missing argument to --testlib" 1>&2 + exit 1 + fi + ARGS="${ARGS} $1" + shift elif [ "x$1" = "x-Xcompiler-option" ]; then shift option="$1" @@ -369,7 +378,7 @@ dalvikvm_cmdline="$INVOKE_WITH $GDB $ANDROID_ROOT/bin/$DALVIKVM \ $INT_OPTS \ $DEBUGGER_OPTS \ $DALVIKVM_BOOT_OPT \ - -cp $DEX_LOCATION/$TEST_NAME.jar$SECONDARY_DEX $MAIN" + -cp $DEX_LOCATION/$TEST_NAME.jar$SECONDARY_DEX $MAIN $ARGS" # Remove whitespace. dex2oat_cmdline=$(echo $dex2oat_cmdline) diff --git a/test/run-test b/test/run-test index 84c818b444..424c2e40be 100755 --- a/test/run-test +++ b/test/run-test @@ -119,6 +119,7 @@ build_output="build-output.txt" cfg_output="graph.cfg" strace_output="strace-output.txt" lib="libartd.so" +testlib="arttestd" run_args="--quiet" build_args="" @@ -164,6 +165,7 @@ while true; do shift elif [ "x$1" = "x-O" ]; then lib="libart.so" + testlib="arttest" shift elif [ "x$1" = "x--dalvik" ]; then lib="libdvm.so" @@ -644,6 +646,10 @@ if [[ "$TEST_NAME" =~ ^[0-9]+-checker- ]]; then fi fi +if [ "$runtime" != "jvm" ]; then + run_args="${run_args} --testlib ${testlib}" +fi + # To cause tests to fail fast, limit the file sizes created by dx, dex2oat and ART output to 2MB. build_file_size_limit=2048 run_file_size_limit=2048 |