1 # -*- mode: makefile -*- 2 3 LOCAL_PATH := $(call my-dir) 4 5 define all-harmony-test-java-files-under 6 $(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(2) -name "*.java" 2> /dev/null)) 7 endef 8 9 harmony_jdwp_test_src_files := \ 10 $(call all-harmony-test-java-files-under,,src/test/java/) 11 12 #jdwp_test_runtime_target := dalvikvm -XXlib:libart.so 13 jdwp_test_runtime_target := dalvikvm -XXlib:libartd.so 14 #jdwp_test_runtime_host := $(ANDROID_HOST_OUT)/bin/art 15 jdwp_test_runtime_host := $(ANDROID_HOST_OUT)/bin/art -d 16 17 # Runtime target for CTS. We also support running with a forced abi. 18 cts_jdwp_test_runtime_target := dalvikvm|\#ABI\#| -XXlib:libart.so 19 20 jdwp_test_runtime_options := 21 jdwp_test_runtime_options += -verbose:jdwp 22 cts_jdwp_test_runtime_options := 23 #jdwp_test_runtime_options += -Xint 24 #jdwp_test_runtime_options += -verbose:threads 25 jdwp_test_timeout_ms := 10000 # 10s. 26 27 jdwp_test_classpath_host := $(ANDROID_HOST_OUT)/framework/apache-harmony-jdwp-tests-hostdex.jar:$(ANDROID_HOST_OUT)/framework/junit-hostdex.jar 28 jdwp_test_classpath_target := /data/jdwp/apache-harmony-jdwp-tests.jar:/data/junit/junit-targetdex.jar 29 30 jdwp_test_target_runtime_common_args := \ 31 -Djpda.settings.verbose=true \ 32 -Djpda.settings.syncPort=34016 \ 33 -Djpda.settings.timeout=$(jdwp_test_timeout_ms) \ 34 -Djpda.settings.waitingTime=$(jdwp_test_timeout_ms) 35 36 jdwp_test_target_runtime_args := $(jdwp_test_target_runtime_common_args) 37 jdwp_test_target_runtime_args += -Djpda.settings.debuggeeJavaPath='$(jdwp_test_runtime_target) $(jdwp_test_runtime_options)' 38 39 cts_jdwp_test_target_runtime_args := $(jdwp_test_target_runtime_common_args) 40 cts_jdwp_test_target_runtime_args += -Djpda.settings.debuggeeJavaPath='$(cts_jdwp_test_runtime_target) $(cts_jdwp_test_runtime_options)' 41 42 include $(CLEAR_VARS) 43 LOCAL_SRC_FILES := $(harmony_jdwp_test_src_files) 44 LOCAL_JAVA_LIBRARIES := junit-targetdex 45 LOCAL_MODULE_TAGS := optional 46 LOCAL_MODULE := CtsJdwp 47 LOCAL_NO_EMMA_INSTRUMENT := true 48 LOCAL_NO_EMMA_COMPILE := true 49 LOCAL_CTS_TEST_PACKAGE := android.jdwp 50 LOCAL_CTS_TARGET_RUNTIME_ARGS := $(cts_jdwp_test_target_runtime_args) 51 include $(BUILD_CTS_TARGET_JAVA_LIBRARY) 52 53 include $(CLEAR_VARS) 54 LOCAL_SRC_FILES := $(harmony_jdwp_test_src_files) 55 LOCAL_JAVA_LIBRARIES := junit-targetdex 56 LOCAL_MODULE_TAGS := tests 57 LOCAL_MODULE := apache-harmony-jdwp-tests 58 LOCAL_NO_EMMA_INSTRUMENT := true 59 LOCAL_NO_EMMA_COMPILE := true 60 LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/jdwp 61 include $(BUILD_JAVA_LIBRARY) 62 63 include $(CLEAR_VARS) 64 LOCAL_SRC_FILES := $(harmony_jdwp_test_src_files) 65 LOCAL_JAVA_LIBRARIES := junit 66 LOCAL_MODULE := apache-harmony-jdwp-tests-host 67 include $(BUILD_HOST_JAVA_LIBRARY) 68 69 include $(CLEAR_VARS) 70 LOCAL_SRC_FILES := $(harmony_jdwp_test_src_files) 71 LOCAL_JAVA_LIBRARIES := junit-hostdex 72 LOCAL_MODULE := apache-harmony-jdwp-tests-hostdex 73 include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) 74 75 include $(call all-makefiles-under,$(LOCAL_PATH)) 76 77 # Waits for device to boot completely. 78 define wait-for-boot-complete 79 $(hide) echo "Wait for boot complete ..." 80 $(hide) while [ `adb wait-for-device shell getprop dev.bootcomplete | grep -c 1` -eq 0 ]; \ 81 do \ 82 sleep 1; \ 83 done 84 $(hide) echo "Boot complete" 85 endef 86 87 # If this fails complaining about TestRunner, build "external/junit" manually. 88 .PHONY: run-jdwp-tests-target 89 run-jdwp-tests-target: $(TARGET_OUT_DATA)/jdwp/apache-harmony-jdwp-tests.jar $(TARGET_OUT_DATA)/junit/junit-targetdex.jar 90 adb shell stop 91 adb remount 92 adb sync 93 adb reboot 94 $(call wait-for-boot-complete) 95 adb shell $(jdwp_test_runtime_target) -cp $(jdwp_test_classpath_target) \ 96 $(jdwp_test_target_runtime_args) \ 97 org.apache.harmony.jpda.tests.share.AllTests 98 99 # If this fails complaining about TestRunner, build "external/junit" manually. 100 .PHONY: run-jdwp-tests-host 101 run-jdwp-tests-host: $(HOST_OUT_EXECUTABLES)/art $(HOST_OUT_JAVA_LIBRARIES)/apache-harmony-jdwp-tests-hostdex.jar $(HOST_OUT_JAVA_LIBRARIES)/junit-hostdex.jar 102 $(jdwp_test_runtime_host) -cp $(jdwp_test_classpath_host) \ 103 -Djpda.settings.verbose=true \ 104 -Djpda.settings.syncPort=34016 \ 105 -Djpda.settings.debuggeeJavaPath="$(jdwp_test_runtime_host) $(jdwp_test_runtime_options)" \ 106 -Djpda.settings.timeout=$(jdwp_test_timeout_ms) \ 107 -Djpda.settings.waitingTime=$(jdwp_test_timeout_ms) \ 108 org.apache.harmony.jpda.tests.share.AllTests 109 110 .PHONY: run-jdwp-tests-ri 111 run-jdwp-tests-ri: $(HOST_OUT_JAVA_LIBRARIES)/apache-harmony-jdwp-tests-host.jar $(HOST_OUT_JAVA_LIBRARIES)/junit.jar 112 java -cp $(HOST_OUT_JAVA_LIBRARIES)/apache-harmony-jdwp-tests-host.jar:$(HOST_OUT_JAVA_LIBRARIES)/junit.jar \ 113 -Djpda.settings.verbose=true \ 114 -Djpda.settings.syncPort=34016 \ 115 -Djpda.settings.debuggeeJavaPath=java \ 116 org.apache.harmony.jpda.tests.share.AllTests 117