1# Copyright (C) 2011 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# 15 16LOCAL_PATH := $(call my-dir) 17 18include art/build/Android.common_test.mk 19 20# Dependencies for actually running a run-test. 21TEST_ART_RUN_TEST_DEPENDENCIES := \ 22 $(HOST_OUT_EXECUTABLES)/d8 \ 23 $(HOST_OUT_EXECUTABLES)/d8-compat-dx \ 24 $(HOST_OUT_EXECUTABLES)/hiddenapi \ 25 $(HOST_OUT_EXECUTABLES)/jasmin \ 26 $(HOST_OUT_EXECUTABLES)/smali 27 28# We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync 29# only once). 30ART_TEST_TARGET_RUN_TEST_DEPENDENCIES := $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS) 31 32# Also need libartagent. 33ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += libartagent-target libartagentd-target 34 35# Also need libtiagent. 36ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += libtiagent-target libtiagentd-target 37 38# Also need libtistress. 39ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += libtistress-target libtistressd-target 40 41# Also need libarttest. 42ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += libarttest-target libarttestd-target 43 44# Also need libnativebridgetest. 45ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += libnativebridgetest-target 46 47# Also need libopenjdkjvmti. 48ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += libopenjdkjvmti-target libopenjdkjvmtid-target 49 50ART_TEST_TARGET_RUN_TEST_DEPENDENCIES += \ 51 $(foreach jar,$(TARGET_TEST_CORE_JARS),$(TARGET_OUT_JAVA_LIBRARIES)/$(jar).jar) 52 53# All tests require the host executables. The tests also depend on the core images, but on 54# specific version depending on the compiler. 55ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \ 56 $(ART_HOST_EXECUTABLES) \ 57 $(HOST_OUT_EXECUTABLES)/hprof-conv \ 58 $(HOST_OUT_EXECUTABLES)/timeout_dumper \ 59 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtiagent) \ 60 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtiagentd) \ 61 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtistress) \ 62 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtistressd) \ 63 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libartagent) \ 64 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libartagentd) \ 65 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libarttest) \ 66 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libarttestd) \ 67 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libnativebridgetest) \ 68 $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ 69 $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \ 70 $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$(ART_HOST_SHLIB_EXTENSION) \ 71 $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmti$(ART_HOST_SHLIB_EXTENSION) \ 72 $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmtid$(ART_HOST_SHLIB_EXTENSION) \ 73 $(HOST_CORE_DEX_LOCATIONS) \ 74 75ifneq ($(HOST_PREFER_32_BIT),true) 76ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \ 77 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtiagent) \ 78 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtiagentd) \ 79 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtistress) \ 80 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtistressd) \ 81 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libartagent) \ 82 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libartagentd) \ 83 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libarttest) \ 84 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libarttestd) \ 85 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libnativebridgetest) \ 86 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ 87 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \ 88 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$(ART_HOST_SHLIB_EXTENSION) \ 89 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmti$(ART_HOST_SHLIB_EXTENSION) \ 90 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmtid$(ART_HOST_SHLIB_EXTENSION) \ 91 92endif 93 94# Host executables. 95host_prereq_rules := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES) 96 97# Required for jasmin and smali. 98host_prereq_rules += $(TEST_ART_RUN_TEST_DEPENDENCIES) 99 100# Sync test files to the target, depends upon all things that must be pushed 101#to the target. 102target_prereq_rules += test-art-target-sync 103 104define core-image-dependencies 105 image_suffix := $(3) 106 ifeq ($(3),regalloc_gc) 107 image_suffix:=optimizing 108 else 109 ifeq ($(3),jit) 110 image_suffix:=interpreter 111 endif 112 endif 113 ifeq ($(2),no-image) 114 $(1)_prereq_rules += $$($(call to-upper,$(1))_CORE_IMAGE_$$(image_suffix)_$(4)) 115 else 116 ifeq ($(2),picimage) 117 $(1)_prereq_rules += $$($(call to-upper,$(1))_CORE_IMAGE_$$(image_suffix)_$(4)) 118 else 119 ifeq ($(2),multipicimage) 120 $(1)_prereq_rules += $$($(call to-upper,$(1))_CORE_IMAGE_$$(image_suffix)_multi_$(4)) 121 endif 122 endif 123 endif 124endef 125 126TARGET_TYPES := host target 127COMPILER_TYPES := jit interpreter optimizing regalloc_gc jit interp-ac speed-profile 128IMAGE_TYPES := picimage no-image multipicimage 129ALL_ADDRESS_SIZES := 64 32 130 131# Add core image dependencies required for given target - HOST or TARGET, 132# IMAGE_TYPE, COMPILER_TYPE and ADDRESS_SIZE to the prereq_rules. 133$(foreach target, $(TARGET_TYPES), \ 134 $(foreach image, $(IMAGE_TYPES), \ 135 $(foreach compiler, $(COMPILER_TYPES), \ 136 $(foreach address_size, $(ALL_ADDRESS_SIZES), $(eval \ 137 $(call core-image-dependencies,$(target),$(image),$(compiler),$(address_size))))))) 138 139test-art-host-run-test-dependencies : $(host_prereq_rules) 140.PHONY: test-art-host-run-test-dependencies 141test-art-target-run-test-dependencies : $(target_prereq_rules) 142.PHONY: test-art-target-run-test-dependencies 143test-art-run-test-dependencies : test-art-host-run-test-dependencies test-art-target-run-test-dependencies 144.PHONY: test-art-run-test-dependencies 145 146# Create a rule to build and run a test group of the following form: 147# test-art-{1: host target}-run-test 148define define-test-art-host-or-target-run-test-group 149 build_target := test-art-$(1)-run-test 150 .PHONY: $$(build_target) 151 152 $$(build_target) : args := --$(1) --verbose 153 $$(build_target) : test-art-$(1)-run-test-dependencies 154 ./art/test/testrunner/testrunner.py $$(args) 155 build_target := 156 args := 157endef # define-test-art-host-or-target-run-test-group 158 159$(foreach target, $(TARGET_TYPES), $(eval \ 160 $(call define-test-art-host-or-target-run-test-group,$(target)))) 161 162test-art-run-test : test-art-host-run-test test-art-target-run-test 163 164host_prereq_rules := 165target_prereq_rules := 166core-image-dependencies := 167define-test-art-host-or-target-run-test-group := 168TARGET_TYPES := 169COMPILER_TYPES := 170IMAGE_TYPES := 171ALL_ADDRESS_SIZES := 172LOCAL_PATH := 173