Android.mk revision 3c75f3706cca16cbffad6fc3183e14ad892b40ba
1# -*- mode: makefile -*-
2
3LOCAL_PATH := $(call my-dir)
4
5define all-harmony-test-java-files-under
6  $(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(2) -name "*.java" 2> /dev/null))
7endef
8
9harmony_jdwp_test_src_files := \
10    $(call all-harmony-test-java-files-under,,src/test/java/)
11
12include $(CLEAR_VARS)
13LOCAL_SRC_FILES := $(harmony_jdwp_test_src_files)
14LOCAL_JAVA_LIBRARIES := junit-targetdex
15LOCAL_MODULE_TAGS := tests
16LOCAL_MODULE := apache-harmony-jdwp-tests
17LOCAL_NO_EMMA_INSTRUMENT := true
18LOCAL_NO_EMMA_COMPILE := true
19LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/jdwp
20include $(BUILD_JAVA_LIBRARY)
21
22include $(CLEAR_VARS)
23LOCAL_SRC_FILES := $(harmony_jdwp_test_src_files)
24LOCAL_JAVA_LIBRARIES := junit
25LOCAL_MODULE := apache-harmony-jdwp-tests-host
26include $(BUILD_HOST_JAVA_LIBRARY)
27
28include $(CLEAR_VARS)
29LOCAL_SRC_FILES := $(harmony_jdwp_test_src_files)
30LOCAL_JAVA_LIBRARIES := junit-hostdex
31LOCAL_MODULE := apache-harmony-jdwp-tests-hostdex
32include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
33
34include $(call all-makefiles-under,$(LOCAL_PATH))
35
36#jdwp_test_runtime_target := dalvikvm -XXlib:libart.so
37jdwp_test_runtime_target := dalvikvm -XXlib:libartd.so
38#jdwp_test_runtime_host := $(ANDROID_HOST_OUT)/bin/art
39jdwp_test_runtime_host := $(ANDROID_HOST_OUT)/bin/art -d
40
41jdwp_test_runtime_options :=
42jdwp_test_runtime_options += -verbose:jdwp
43#jdwp_test_runtime_options += -Xint
44#jdwp_test_runtime_options += -verbose:threads
45jdwp_test_timeout_ms := 10000 # 10s.
46
47jdwp_test_classpath_host := $(ANDROID_HOST_OUT)/framework/apache-harmony-jdwp-tests-hostdex.jar:$(ANDROID_HOST_OUT)/framework/junit-hostdex.jar
48jdwp_test_classpath_target := /data/jdwp/apache-harmony-jdwp-tests.jar:/data/junit/junit-targetdex.jar
49
50# If this fails complaining about TestRunner, build "external/junit" manually.
51.PHONY: run-jdwp-tests-target
52run-jdwp-tests-target: $(TARGET_OUT_DATA)/jdwp/apache-harmony-jdwp-tests.jar $(TARGET_OUT_DATA)/junit/junit-targetdex.jar
53	adb shell stop
54	adb remount
55	adb sync
56	adb shell $(jdwp_test_runtime_target) -cp $(jdwp_test_classpath_target) \
57          -Djpda.settings.verbose=true \
58          -Djpda.settings.syncPort=34016 \
59          -Djpda.settings.debuggeeJavaPath="$(jdwp_test_runtime_target) $(jdwp_test_runtime_options)" \
60          -Djpda.settings.timeout=$(jdwp_test_timeout_ms) \
61          -Djpda.settings.waitingTime=$(jdwp_test_timeout_ms) \
62          org.apache.harmony.jpda.tests.share.AllTests
63
64# If this fails complaining about TestRunner, build "external/junit" manually.
65.PHONY: run-jdwp-tests-host
66run-jdwp-tests-host: $(HOST_OUT_EXECUTABLES)/art $(HOST_OUT_JAVA_LIBRARIES)/apache-harmony-jdwp-tests-hostdex.jar $(HOST_OUT_JAVA_LIBRARIES)/junit-hostdex.jar
67	$(jdwp_test_runtime_host) -cp $(jdwp_test_classpath_host) \
68          -Djpda.settings.verbose=true \
69          -Djpda.settings.syncPort=34016 \
70          -Djpda.settings.debuggeeJavaPath="$(jdwp_test_runtime_host) $(jdwp_test_runtime_options)" \
71          -Djpda.settings.timeout=$(jdwp_test_timeout_ms) \
72          -Djpda.settings.waitingTime=$(jdwp_test_timeout_ms) \
73          org.apache.harmony.jpda.tests.share.AllTests
74
75.PHONY: run-jdwp-tests-ri
76run-jdwp-tests-ri: $(HOST_OUT_JAVA_LIBRARIES)/apache-harmony-jdwp-tests-host.jar $(HOST_OUT_JAVA_LIBRARIES)/junit.jar
77	java -cp $(HOST_OUT_JAVA_LIBRARIES)/apache-harmony-jdwp-tests-host.jar:$(HOST_OUT_JAVA_LIBRARIES)/junit.jar \
78          -Djpda.settings.verbose=true \
79          -Djpda.settings.syncPort=34016 \
80          -Djpda.settings.debuggeeJavaPath=java \
81          org.apache.harmony.jpda.tests.share.AllTests
82