1# -*- mode: makefile -*-
2
3LOCAL_PATH := $(call my-dir)
4
5define all-harmony-test-java-files-under
6  $(foreach dir,$(1),$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(dir)/$(2) -name "*.java" 2> /dev/null)))
7endef
8
9harmony_test_dirs := \
10    beans \
11    logging \
12    luni \
13    sql \
14    support \
15
16# TODO: get these working too!
17#    crypto \
18#    security \
19#    x-net
20
21harmony_test_src_files := \
22    $(call all-harmony-test-java-files-under,$(harmony_test_dirs),src/test/java) \
23    $(call all-harmony-test-java-files-under,$(harmony_test_dirs),src/test/support/java) \
24    $(call all-harmony-test-java-files-under,luni,src/test/api/common) \
25    $(call all-harmony-test-java-files-under,luni,src/test/api/unix) \
26    $(call all-harmony-test-java-files-under,luni,src/test/impl/common) \
27    $(call all-harmony-test-java-files-under,luni,src/test/impl/unix)
28
29# We need to use -maxdepth 4 because there's a non-resource directory called "resources" deeper in the tree.
30define harmony-test-resource-dirs
31  $(foreach dir,$(1),$(patsubst %,./%,$(shell cd $(LOCAL_PATH) && find $(dir) -maxdepth 4 -name resources 2> /dev/null)))
32endef
33
34harmony_test_resource_dirs := $(call harmony-test-resource-dirs,$(harmony_test_dirs))
35
36harmony_test_javac_flags=-encoding UTF-8
37harmony_test_javac_flags+=-Xmaxwarns 9999999
38
39include $(CLEAR_VARS)
40LOCAL_SRC_FILES := $(harmony_test_src_files)
41LOCAL_JAVA_RESOURCE_DIRS := $(harmony_test_resource_dirs)
42LOCAL_NO_STANDARD_LIBRARIES := true
43LOCAL_JAVA_LIBRARIES := core-libart core-junit
44LOCAL_JAVACFLAGS := $(harmony_test_javac_flags)
45LOCAL_MODULE := apache-harmony-tests
46LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
47LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
48include $(BUILD_STATIC_JAVA_LIBRARY)
49
50include $(CLEAR_VARS)
51LOCAL_SRC_FILES := $(harmony_test_src_files)
52LOCAL_JAVA_RESOURCE_DIRS := $(harmony_test_resource_dirs)
53LOCAL_NO_STANDARD_LIBRARIES := true
54LOCAL_JAVA_LIBRARIES := core-libart-hostdex core-junit-hostdex
55LOCAL_JAVACFLAGS := $(harmony_test_javac_flags)
56LOCAL_MODULE := apache-harmony-tests-hostdex
57LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
58include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
59
60include $(call all-makefiles-under,$(LOCAL_PATH))
61