• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
16harmony_test_src_files := \
17    $(call all-harmony-test-java-files-under,$(harmony_test_dirs),src/test/java) \
18    $(call all-harmony-test-java-files-under,$(harmony_test_dirs),src/test/support/java) \
19    $(call all-harmony-test-java-files-under,luni,src/test/api/common) \
20    $(call all-harmony-test-java-files-under,luni,src/test/api/unix) \
21    $(call all-harmony-test-java-files-under,luni,src/test/impl/common) \
22    $(call all-harmony-test-java-files-under,luni,src/test/impl/unix)
23
24# We need to use -maxdepth 4 because there's a non-resource directory called "resources" deeper in the tree.
25define harmony-test-resource-dirs
26  $(foreach dir,$(1),$(patsubst %,./%,$(shell cd $(LOCAL_PATH) && find $(dir) -maxdepth 4 -name resources 2> /dev/null)))
27endef
28
29harmony_test_resource_dirs := $(call harmony-test-resource-dirs,$(harmony_test_dirs))
30
31harmony_test_javac_flags:=-Xmaxwarns 9999999
32
33include $(CLEAR_VARS)
34LOCAL_SRC_FILES := $(harmony_test_src_files)
35LOCAL_JAVA_RESOURCE_DIRS := $(harmony_test_resource_dirs)
36LOCAL_NO_STANDARD_LIBRARIES := true
37LOCAL_JAVA_LIBRARIES := core-oj core-libart junit
38LOCAL_JAVACFLAGS := $(harmony_test_javac_flags)
39LOCAL_MODULE := apache-harmony-tests
40LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
41LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
42include $(BUILD_STATIC_JAVA_LIBRARY)
43
44ifeq ($(HOST_OS),linux)
45include $(CLEAR_VARS)
46LOCAL_SRC_FILES := $(harmony_test_src_files)
47LOCAL_JAVA_RESOURCE_DIRS := $(harmony_test_resource_dirs)
48LOCAL_NO_STANDARD_LIBRARIES := true
49LOCAL_JAVA_LIBRARIES := core-oj-hostdex core-libart-hostdex junit-hostdex
50LOCAL_JAVACFLAGS := $(harmony_test_javac_flags)
51LOCAL_MODULE := apache-harmony-tests-hostdex
52LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
53include $(BUILD_HOST_DALVIK_JAVA_LIBRARY)
54endif  # HOST_OS == linux
55
56include $(call all-makefiles-under,$(LOCAL_PATH))
57