• 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    annotation \
11    archive \
12    beans \
13    logging \
14    luni \
15    math \
16    nio \
17    nio_char \
18    prefs \
19    regex \
20    sql \
21    support \
22    text \
23
24# TODO: get these working too!
25#    auth \
26#    crypto \
27#    security \
28#    x-net
29
30harmony_test_src_files := \
31    $(call all-harmony-test-java-files-under,$(harmony_test_dirs),src/test/java) \
32    $(call all-harmony-test-java-files-under,$(harmony_test_dirs),src/test/support/java) \
33    $(call all-harmony-test-java-files-under,luni,src/test/api/common) \
34    $(call all-harmony-test-java-files-under,luni,src/test/api/unix) \
35    $(call all-harmony-test-java-files-under,luni,src/test/impl/common) \
36    $(call all-harmony-test-java-files-under,luni,src/test/impl/unix)
37
38# We need to use -maxdepth 4 because there's a non-resource directory called "resources" deeper in the tree.
39define harmony-test-resource-dirs
40  $(shell cd $(LOCAL_PATH) && find . -maxdepth 4 -name resources 2> /dev/null)
41endef
42harmony_test_resource_dirs := \
43    $(call harmony-test-resource-dirs,$(harmony_test_dirs)) \
44    $(call harmony-test-resource-dirs,luni)
45
46harmony_test_javac_flags=-encoding UTF-8
47harmony_test_javac_flags+=-Xmaxwarns 9999999
48
49include $(CLEAR_VARS)
50LOCAL_SRC_FILES := $(harmony_test_src_files)
51LOCAL_JAVA_RESOURCE_DIRS := $(harmony_test_resource_dirs)
52LOCAL_NO_STANDARD_LIBRARIES := true
53LOCAL_JAVA_LIBRARIES := core core-junit
54LOCAL_JAVACFLAGS := $(harmony_test_javac_flags)
55LOCAL_MODULE_TAGS := tests
56LOCAL_MODULE := apache-harmony-tests
57include $(BUILD_STATIC_JAVA_LIBRARY)
58
59ifeq ($(WITH_HOST_DALVIK),true)
60    include $(CLEAR_VARS)
61    LOCAL_SRC_FILES := $(harmony_test_src_files)
62    LOCAL_JAVA_RESOURCE_DIRS := $(harmony_test_resource_dirs)
63    LOCAL_NO_STANDARD_LIBRARIES := true
64    LOCAL_JAVA_LIBRARIES := core-hostdex core-junit-hostdex
65    LOCAL_JAVACFLAGS := $(harmony_test_javac_flags)
66    LOCAL_MODULE := apache-harmony-tests-hostdex
67    LOCAL_BUILD_HOST_DEX := true
68    include $(BUILD_HOST_JAVA_LIBRARY)
69endif
70