Android.mk revision 0fcbde4b054e157ddc38f29688fd0ab12f0549ce
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 := annotation archive logging math nio nio_char prefs regex support text
10harmony_test_src_files := \
11    $(call all-harmony-test-java-files-under,$(harmony_test_dirs),src/test/java) \
12    $(call all-harmony-test-java-files-under,luni,src/test/{api,impl}/{common,unix})
13
14define harmony-test-resource-dirs
15  $(shell cd $(LOCAL_PATH) && ls -d $(1)/src/test/{java,resources} 2> /dev/null)
16endef
17harmony_test_resource_dirs := \
18    $(call harmony-test-resource-dirs,$(harmony_test_dirs)) \
19    $(call harmony-test-resource-dirs,luni)
20
21harmony_test_javac_flags=-encoding UTF-8
22harmony_test_javac_flags+=-Xmaxwarns 9999999
23
24include $(CLEAR_VARS)
25LOCAL_SRC_FILES := $(harmony_test_src_files)
26LOCAL_JAVA_RESOURCE_DIRS := $(harmony_test_resource_dirs)
27LOCAL_NO_STANDARD_LIBRARIES := true
28LOCAL_JAVA_LIBRARIES := core core-junit
29LOCAL_JAVACFLAGS := $(harmony_test_javac_flags)
30LOCAL_MODULE_TAGS := tests
31LOCAL_MODULE := apache-harmony-tests
32LOCAL_NO_EMMA_INSTRUMENT := true
33LOCAL_NO_EMMA_COMPILE := true
34include $(BUILD_STATIC_JAVA_LIBRARY)
35
36ifeq ($(WITH_HOST_DALVIK),true)
37    include $(CLEAR_VARS)
38    LOCAL_SRC_FILES := $(harmony_test_src_files)
39    LOCAL_JAVA_RESOURCE_DIRS := $(harmony_test_resource_dirs)
40    LOCAL_NO_STANDARD_LIBRARIES := true
41    LOCAL_JAVA_LIBRARIES := core-hostdex core-junit-hostdex
42    LOCAL_JAVACFLAGS := $(harmony_test_javac_flags)
43    LOCAL_MODULE_TAGS := tests
44    LOCAL_MODULE := apache-harmony-tests-host
45    LOCAL_NO_EMMA_INSTRUMENT := true
46    LOCAL_NO_EMMA_COMPILE := true
47    LOCAL_BUILD_HOST_DEX := true
48    include $(BUILD_HOST_JAVA_LIBRARY)
49endif
50