Elliott Hughes | 5f0a236 | 2011-12-09 18:40:41 -0800 | [diff] [blame] | 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 | |
Tsu Chiang Chuang | 8d4fdfa | 2014-06-18 09:58:57 -0700 | [diff] [blame] | 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 | |
Sebastien Hertz | 2aee489 | 2014-09-05 14:31:04 +0200 | [diff] [blame] | 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 | |
Tsu Chiang Chuang | 8d4fdfa | 2014-06-18 09:58:57 -0700 | [diff] [blame] | 20 | jdwp_test_runtime_options := |
| 21 | jdwp_test_runtime_options += -verbose:jdwp |
Tsu Chiang Chuang | 71dd891 | 2014-08-12 11:46:54 -0700 | [diff] [blame] | 22 | cts_jdwp_test_runtime_options := |
Tsu Chiang Chuang | 8d4fdfa | 2014-06-18 09:58:57 -0700 | [diff] [blame] | 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 | |
Tsu Chiang Chuang | 71dd891 | 2014-08-12 11:46:54 -0700 | [diff] [blame] | 30 | jdwp_test_target_runtime_common_args := \ |
Tsu Chiang Chuang | 8d4fdfa | 2014-06-18 09:58:57 -0700 | [diff] [blame] | 31 | -Djpda.settings.verbose=true \ |
| 32 | -Djpda.settings.syncPort=34016 \ |
Tsu Chiang Chuang | 8d4fdfa | 2014-06-18 09:58:57 -0700 | [diff] [blame] | 33 | -Djpda.settings.timeout=$(jdwp_test_timeout_ms) \ |
| 34 | -Djpda.settings.waitingTime=$(jdwp_test_timeout_ms) |
| 35 | |
Tsu Chiang Chuang | 71dd891 | 2014-08-12 11:46:54 -0700 | [diff] [blame] | 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)' |
Tsu Chiang Chuang | 8d4fdfa | 2014-06-18 09:58:57 -0700 | [diff] [blame] | 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 |
Tsu Chiang Chuang | 71dd891 | 2014-08-12 11:46:54 -0700 | [diff] [blame] | 50 | LOCAL_CTS_TARGET_RUNTIME_ARGS := $(cts_jdwp_test_target_runtime_args) |
Tsu Chiang Chuang | 8d4fdfa | 2014-06-18 09:58:57 -0700 | [diff] [blame] | 51 | include $(BUILD_CTS_TARGET_JAVA_LIBRARY) |
| 52 | |
Elliott Hughes | 5f0a236 | 2011-12-09 18:40:41 -0800 | [diff] [blame] | 53 | include $(CLEAR_VARS) |
| 54 | LOCAL_SRC_FILES := $(harmony_jdwp_test_src_files) |
Elliott Hughes | f0b10c7 | 2012-02-13 12:15:35 -0800 | [diff] [blame] | 55 | LOCAL_JAVA_LIBRARIES := junit-targetdex |
Tsu Chiang Chuang | 348bf15 | 2013-04-10 16:29:45 -0700 | [diff] [blame] | 56 | LOCAL_MODULE_TAGS := tests |
Elliott Hughes | 9a87b87 | 2013-01-07 15:58:35 -0800 | [diff] [blame] | 57 | LOCAL_MODULE := apache-harmony-jdwp-tests |
Elliott Hughes | 5f0a236 | 2011-12-09 18:40:41 -0800 | [diff] [blame] | 58 | LOCAL_NO_EMMA_INSTRUMENT := true |
| 59 | LOCAL_NO_EMMA_COMPILE := true |
Tsu Chiang Chuang | bff9fb7 | 2012-07-03 15:32:49 -0700 | [diff] [blame] | 60 | LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/jdwp |
Elliott Hughes | 5f0a236 | 2011-12-09 18:40:41 -0800 | [diff] [blame] | 61 | include $(BUILD_JAVA_LIBRARY) |
| 62 | |
Elliott Hughes | 2d5b22d | 2012-02-27 11:39:02 -0800 | [diff] [blame] | 63 | include $(CLEAR_VARS) |
| 64 | LOCAL_SRC_FILES := $(harmony_jdwp_test_src_files) |
| 65 | LOCAL_JAVA_LIBRARIES := junit |
Elliott Hughes | 9a87b87 | 2013-01-07 15:58:35 -0800 | [diff] [blame] | 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) |
Brian Carlstrom | 21a5212 | 2013-03-20 23:18:53 -0700 | [diff] [blame] | 71 | LOCAL_JAVA_LIBRARIES := junit-hostdex |
Elliott Hughes | 9a87b87 | 2013-01-07 15:58:35 -0800 | [diff] [blame] | 72 | LOCAL_MODULE := apache-harmony-jdwp-tests-hostdex |
Brian Carlstrom | 8435047 | 2013-11-07 12:20:46 -0800 | [diff] [blame] | 73 | include $(BUILD_HOST_DALVIK_JAVA_LIBRARY) |
Elliott Hughes | 2d5b22d | 2012-02-27 11:39:02 -0800 | [diff] [blame] | 74 | |
Elliott Hughes | 5f0a236 | 2011-12-09 18:40:41 -0800 | [diff] [blame] | 75 | include $(call all-makefiles-under,$(LOCAL_PATH)) |
| 76 | |
Sebastien Hertz | 5597583 | 2014-08-12 17:14:47 +0200 | [diff] [blame] | 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 | |
Elliott Hughes | f0b10c7 | 2012-02-13 12:15:35 -0800 | [diff] [blame] | 87 | # If this fails complaining about TestRunner, build "external/junit" manually. |
Elliott Hughes | 31fe38c | 2013-01-10 15:53:36 -0800 | [diff] [blame] | 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 |
Elliott Hughes | 5f0a236 | 2011-12-09 18:40:41 -0800 | [diff] [blame] | 90 | adb shell stop |
| 91 | adb remount |
| 92 | adb sync |
Sebastien Hertz | 5597583 | 2014-08-12 17:14:47 +0200 | [diff] [blame] | 93 | adb reboot |
| 94 | $(call wait-for-boot-complete) |
Elliott Hughes | 966a5ab | 2013-01-08 18:23:52 -0800 | [diff] [blame] | 95 | adb shell $(jdwp_test_runtime_target) -cp $(jdwp_test_classpath_target) \ |
Tsu Chiang Chuang | 8d4fdfa | 2014-06-18 09:58:57 -0700 | [diff] [blame] | 96 | $(jdwp_test_target_runtime_args) \ |
Elliott Hughes | 9a87b87 | 2013-01-07 15:58:35 -0800 | [diff] [blame] | 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 |
Sebastien Hertz | 54fe822 | 2014-03-11 15:54:53 +0100 | [diff] [blame] | 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 |
Elliott Hughes | 9a87b87 | 2013-01-07 15:58:35 -0800 | [diff] [blame] | 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)" \ |
Elliott Hughes | 5d36ea7 | 2012-06-29 14:19:18 -0700 | [diff] [blame] | 106 | -Djpda.settings.timeout=$(jdwp_test_timeout_ms) \ |
| 107 | -Djpda.settings.waitingTime=$(jdwp_test_timeout_ms) \ |
Elliott Hughes | 2d5b22d | 2012-02-27 11:39:02 -0800 | [diff] [blame] | 108 | org.apache.harmony.jpda.tests.share.AllTests |
| 109 | |
| 110 | .PHONY: run-jdwp-tests-ri |
Elliott Hughes | 9a87b87 | 2013-01-07 15:58:35 -0800 | [diff] [blame] | 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 \ |
Elliott Hughes | 2d5b22d | 2012-02-27 11:39:02 -0800 | [diff] [blame] | 113 | -Djpda.settings.verbose=true \ |
| 114 | -Djpda.settings.syncPort=34016 \ |
| 115 | -Djpda.settings.debuggeeJavaPath=java \ |
Elliott Hughes | 5f0a236 | 2011-12-09 18:40:41 -0800 | [diff] [blame] | 116 | org.apache.harmony.jpda.tests.share.AllTests |