Home | History | Annotate | Download | only in apache-harmony
      1 # -*- mode: makefile -*-
      2 
      3 LOCAL_PATH := $(call my-dir)
      4 
      5 define all-harmony-test-java-files-under
      6   $(foreach dir,$(1),$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(dir)/$(2) -name "*.java" 2> /dev/null)))
      7 endef
      8 
      9 harmony_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 
     30 harmony_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.
     39 define harmony-test-resource-dirs
     40   $(shell cd $(LOCAL_PATH) && find . -maxdepth 4 -name resources 2> /dev/null)
     41 endef
     42 harmony_test_resource_dirs := \
     43     $(call harmony-test-resource-dirs,$(harmony_test_dirs)) \
     44     $(call harmony-test-resource-dirs,luni)
     45 
     46 harmony_test_javac_flags=-encoding UTF-8
     47 harmony_test_javac_flags+=-Xmaxwarns 9999999
     48 
     49 include $(CLEAR_VARS)
     50 LOCAL_SRC_FILES := $(harmony_test_src_files)
     51 LOCAL_JAVA_RESOURCE_DIRS := $(harmony_test_resource_dirs)
     52 LOCAL_NO_STANDARD_LIBRARIES := true
     53 LOCAL_JAVA_LIBRARIES := core core-junit
     54 LOCAL_JAVACFLAGS := $(harmony_test_javac_flags)
     55 LOCAL_MODULE_TAGS := tests
     56 LOCAL_MODULE := apache-harmony-tests
     57 include $(BUILD_STATIC_JAVA_LIBRARY)
     58 
     59 ifeq ($(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)
     69 endif
     70