blob: 53d4c372c46c8c5ec116b78015a6d0b95b8f681f [file] [log] [blame]
Ian Rogersafd9acc2014-06-17 08:21:54 -07001# 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)
Shubham Ajmera6f3d5902017-02-06 06:39:11 +000017
Ian Rogersafd9acc2014-06-17 08:21:54 -070018include art/build/Android.common_test.mk
19
Nicolas Geoffray07f2bc12015-05-29 13:40:25 +010020# Dependencies for actually running a run-test.
Sebastien Hertz19ac0272015-02-24 17:39:50 +010021TEST_ART_RUN_TEST_DEPENDENCIES := \
Alex Lightcc917d92018-02-22 13:28:28 -080022 $(HOST_OUT_EXECUTABLES)/d8 \
Alan Leungcf2de162018-03-30 20:18:20 +000023 $(HOST_OUT_EXECUTABLES)/d8-compat-dx \
David Brazdil11b67b22018-01-18 16:41:40 +000024 $(HOST_OUT_EXECUTABLES)/hiddenapi \
Sebastien Hertz19ac0272015-02-24 17:39:50 +010025 $(HOST_OUT_EXECUTABLES)/jasmin \
Orion Hodson64fe3be2018-06-15 12:50:22 +010026 $(HOST_OUT_EXECUTABLES)/smali
Sebastien Hertz19ac0272015-02-24 17:39:50 +010027
Andreas Gampe63fc30e2014-10-24 21:58:16 -070028# We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync
29# only once).
30TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS)
Ian Rogersafd9acc2014-06-17 08:21:54 -070031
Alex Light7233c7e2016-07-28 10:07:45 -070032# Also need libartagent.
Andreas Gampe47200462017-11-09 11:40:03 -080033TEST_ART_TARGET_SYNC_DEPS += libartagent-target libartagentd-target
Alex Light7233c7e2016-07-28 10:07:45 -070034
Alex Light49948e92016-08-11 15:35:28 -070035# Also need libtiagent.
Andreas Gampe47200462017-11-09 11:40:03 -080036TEST_ART_TARGET_SYNC_DEPS += libtiagent-target libtiagentd-target
Alex Light49948e92016-08-11 15:35:28 -070037
Alex Light8f2c6d42017-04-10 16:27:35 -070038# Also need libtistress.
Andreas Gampe47200462017-11-09 11:40:03 -080039TEST_ART_TARGET_SYNC_DEPS += libtistress-target libtistressd-target
Alex Light8f2c6d42017-04-10 16:27:35 -070040
Andreas Gampe1c83cbc2014-07-22 18:52:29 -070041# Also need libarttest.
Andreas Gampe47200462017-11-09 11:40:03 -080042TEST_ART_TARGET_SYNC_DEPS += libarttest-target libarttestd-target
Andreas Gampe1c83cbc2014-07-22 18:52:29 -070043
Andreas Gampe855564b2014-07-25 02:32:19 -070044# Also need libnativebridgetest.
Andreas Gampe47200462017-11-09 11:40:03 -080045TEST_ART_TARGET_SYNC_DEPS += libnativebridgetest-target
Andreas Gampe855564b2014-07-25 02:32:19 -070046
Nicolas Geoffrayd026ee52016-11-23 10:47:02 +000047# Also need libopenjdkjvmti.
Andreas Gampe47200462017-11-09 11:40:03 -080048TEST_ART_TARGET_SYNC_DEPS += libopenjdkjvmti-target libopenjdkjvmtid-target
Nicolas Geoffrayd026ee52016-11-23 10:47:02 +000049
Nicolas Geoffray320ccca2017-03-01 10:03:08 +000050TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/core-libart-testdex.jar
51TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/core-oj-testdex.jar
52TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/okhttp-testdex.jar
53TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/bouncycastle-testdex.jar
54TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/conscrypt-testdex.jar
55
Andreas Gampe63fc30e2014-10-24 21:58:16 -070056# All tests require the host executables. The tests also depend on the core images, but on
57# specific version depending on the compiler.
Ian Rogersafd9acc2014-06-17 08:21:54 -070058ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \
59 $(ART_HOST_EXECUTABLES) \
Nicolas Geoffraya6fbe392017-03-25 14:05:28 +000060 $(HOST_OUT_EXECUTABLES)/hprof-conv \
Colin Crossafd3c9e2016-09-16 13:47:21 -070061 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtiagent) \
62 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtiagentd) \
Alex Light8f2c6d42017-04-10 16:27:35 -070063 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtistress) \
64 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtistressd) \
Colin Crossafd3c9e2016-09-16 13:47:21 -070065 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libartagent) \
66 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libartagentd) \
67 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libarttest) \
68 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libarttestd) \
69 $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libnativebridgetest) \
Narayan Kamath67ef2c92015-11-16 10:17:35 +000070 $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe10edbb12016-01-06 17:59:49 -080071 $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampef2c5dbd2016-11-17 22:50:33 -080072 $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$(ART_HOST_SHLIB_EXTENSION) \
73 $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmti$(ART_HOST_SHLIB_EXTENSION) \
74 $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmtid$(ART_HOST_SHLIB_EXTENSION) \
Ian Rogers665de8a2014-06-24 21:34:09 -070075
76ifneq ($(HOST_PREFER_32_BIT),true)
77ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \
Andreas Gampe0ccd1e22017-04-12 21:53:55 -070078 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtiagent) \
79 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtiagentd) \
Alex Light8f2c6d42017-04-10 16:27:35 -070080 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtistress) \
81 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtistressd) \
Colin Crossafd3c9e2016-09-16 13:47:21 -070082 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libartagent) \
83 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libartagentd) \
84 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libarttest) \
85 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libarttestd) \
86 $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libnativebridgetest) \
Narayan Kamath67ef2c92015-11-16 10:17:35 +000087 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampe10edbb12016-01-06 17:59:49 -080088 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \
Andreas Gampef2c5dbd2016-11-17 22:50:33 -080089 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$(ART_HOST_SHLIB_EXTENSION) \
90 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmti$(ART_HOST_SHLIB_EXTENSION) \
91 $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmtid$(ART_HOST_SHLIB_EXTENSION) \
92
Ian Rogers665de8a2014-06-24 21:34:09 -070093endif
Ian Rogersafd9acc2014-06-17 08:21:54 -070094
Shubham Ajmera65adb8b2017-02-06 16:04:25 +000095# Host executables.
96host_prereq_rules := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES)
97
Orion Hodson64fe3be2018-06-15 12:50:22 +010098# Required for jasmin and smali.
Shubham Ajmera65adb8b2017-02-06 16:04:25 +000099host_prereq_rules += $(TEST_ART_RUN_TEST_DEPENDENCIES)
100
Shubham Ajmera65adb8b2017-02-06 16:04:25 +0000101# Sync test files to the target, depends upon all things that must be pushed
102#to the target.
103target_prereq_rules += test-art-target-sync
104
105define core-image-dependencies
106 image_suffix := $(3)
107 ifeq ($(3),regalloc_gc)
108 image_suffix:=optimizing
109 else
110 ifeq ($(3),jit)
111 image_suffix:=interpreter
112 endif
113 endif
114 ifeq ($(2),no-image)
Colin Cross3d08bbd2018-02-08 15:26:13 -0800115 $(1)_prereq_rules += $$($(call to-upper,$(1))_CORE_IMAGE_$$(image_suffix)_$(4))
Shubham Ajmera65adb8b2017-02-06 16:04:25 +0000116 else
Richard Uhlerbb00f812017-02-16 14:21:10 +0000117 ifeq ($(2),picimage)
Colin Cross3d08bbd2018-02-08 15:26:13 -0800118 $(1)_prereq_rules += $$($(call to-upper,$(1))_CORE_IMAGE_$$(image_suffix)_$(4))
Shubham Ajmera65adb8b2017-02-06 16:04:25 +0000119 else
Richard Uhlerbb00f812017-02-16 14:21:10 +0000120 ifeq ($(2),multipicimage)
Colin Cross3d08bbd2018-02-08 15:26:13 -0800121 $(1)_prereq_rules += $$($(call to-upper,$(1))_CORE_IMAGE_$$(image_suffix)_multi_$(4))
Shubham Ajmera65adb8b2017-02-06 16:04:25 +0000122 endif
123 endif
124 endif
125endef
126
Shubham Ajmera4a5a1622017-03-22 10:07:19 -0700127TARGET_TYPES := host target
Jeff Hao002b9312017-03-27 16:23:08 -0700128COMPILER_TYPES := jit interpreter optimizing regalloc_gc jit interp-ac speed-profile
Shubham Ajmera4a5a1622017-03-22 10:07:19 -0700129IMAGE_TYPES := picimage no-image multipicimage
130ALL_ADDRESS_SIZES := 64 32
Shubham Ajmera07a8c702017-02-16 19:50:12 +0000131
Shubham Ajmera65adb8b2017-02-06 16:04:25 +0000132# Add core image dependencies required for given target - HOST or TARGET,
133# IMAGE_TYPE, COMPILER_TYPE and ADDRESS_SIZE to the prereq_rules.
134$(foreach target, $(TARGET_TYPES), \
Shubham Ajmera4a5a1622017-03-22 10:07:19 -0700135 $(foreach image, $(IMAGE_TYPES), \
136 $(foreach compiler, $(COMPILER_TYPES), \
137 $(foreach address_size, $(ALL_ADDRESS_SIZES), $(eval \
Shubham Ajmera65adb8b2017-02-06 16:04:25 +0000138 $(call core-image-dependencies,$(target),$(image),$(compiler),$(address_size)))))))
139
140test-art-host-run-test-dependencies : $(host_prereq_rules)
Dan Willemsen03b03462018-06-18 20:29:18 -0700141.PHONY: test-art-host-run-test-dependencies
Shubham Ajmera65adb8b2017-02-06 16:04:25 +0000142test-art-target-run-test-dependencies : $(target_prereq_rules)
Dan Willemsen03b03462018-06-18 20:29:18 -0700143.PHONY: test-art-target-run-test-dependencies
Shubham Ajmera65adb8b2017-02-06 16:04:25 +0000144test-art-run-test-dependencies : test-art-host-run-test-dependencies test-art-target-run-test-dependencies
Dan Willemsen03b03462018-06-18 20:29:18 -0700145.PHONY: test-art-run-test-dependencies
Shubham Ajmera65adb8b2017-02-06 16:04:25 +0000146
Shubham Ajmera4a5a1622017-03-22 10:07:19 -0700147# Create a rule to build and run a test group of the following form:
148# test-art-{1: host target}-run-test
149define define-test-art-host-or-target-run-test-group
150 build_target := test-art-$(1)-run-test
151 .PHONY: $$(build_target)
152
153 $$(build_target) : args := --$(1) --verbose
154 $$(build_target) : test-art-$(1)-run-test-dependencies
155 ./art/test/testrunner/testrunner.py $$(args)
156 build_target :=
157 args :=
158endef # define-test-art-host-or-target-run-test-group
159
160$(foreach target, $(TARGET_TYPES), $(eval \
161 $(call define-test-art-host-or-target-run-test-group,$(target))))
162
163test-art-run-test : test-art-host-run-test test-art-target-run-test
164
165host_prereq_rules :=
166target_prereq_rules :=
167core-image-dependencies :=
Shubham Ajmera4a5a1622017-03-22 10:07:19 -0700168define-test-art-host-or-target-run-test-group :=
169TARGET_TYPES :=
170COMPILER_TYPES :=
171IMAGE_TYPES :=
172ALL_ADDRESS_SIZES :=
Alex Light7233c7e2016-07-28 10:07:45 -0700173LOCAL_PATH :=