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