Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 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 | |
| 16 | LOCAL_PATH := $(call my-dir) |
Shubham Ajmera | 6f3d590 | 2017-02-06 06:39:11 +0000 | [diff] [blame] | 17 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 18 | include art/build/Android.common_test.mk |
| 19 | |
Nicolas Geoffray | 07f2bc1 | 2015-05-29 13:40:25 +0100 | [diff] [blame] | 20 | # Dependencies for actually running a run-test. |
Sebastien Hertz | 19ac027 | 2015-02-24 17:39:50 +0100 | [diff] [blame] | 21 | TEST_ART_RUN_TEST_DEPENDENCIES := \ |
Alex Light | cc917d9 | 2018-02-22 13:28:28 -0800 | [diff] [blame] | 22 | $(HOST_OUT_EXECUTABLES)/d8 \ |
Alan Leung | cf2de16 | 2018-03-30 20:18:20 +0000 | [diff] [blame] | 23 | $(HOST_OUT_EXECUTABLES)/d8-compat-dx \ |
David Brazdil | 11b67b2 | 2018-01-18 16:41:40 +0000 | [diff] [blame] | 24 | $(HOST_OUT_EXECUTABLES)/hiddenapi \ |
Sebastien Hertz | 19ac027 | 2015-02-24 17:39:50 +0100 | [diff] [blame] | 25 | $(HOST_OUT_EXECUTABLES)/jasmin \ |
Orion Hodson | 64fe3be | 2018-06-15 12:50:22 +0100 | [diff] [blame] | 26 | $(HOST_OUT_EXECUTABLES)/smali |
Sebastien Hertz | 19ac027 | 2015-02-24 17:39:50 +0100 | [diff] [blame] | 27 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 28 | # We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync |
| 29 | # only once). |
| 30 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 31 | |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 32 | # Also need libartagent. |
Andreas Gampe | 4720046 | 2017-11-09 11:40:03 -0800 | [diff] [blame] | 33 | TEST_ART_TARGET_SYNC_DEPS += libartagent-target libartagentd-target |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 34 | |
Alex Light | 49948e9 | 2016-08-11 15:35:28 -0700 | [diff] [blame] | 35 | # Also need libtiagent. |
Andreas Gampe | 4720046 | 2017-11-09 11:40:03 -0800 | [diff] [blame] | 36 | TEST_ART_TARGET_SYNC_DEPS += libtiagent-target libtiagentd-target |
Alex Light | 49948e9 | 2016-08-11 15:35:28 -0700 | [diff] [blame] | 37 | |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 38 | # Also need libtistress. |
Andreas Gampe | 4720046 | 2017-11-09 11:40:03 -0800 | [diff] [blame] | 39 | TEST_ART_TARGET_SYNC_DEPS += libtistress-target libtistressd-target |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 40 | |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 41 | # Also need libarttest. |
Andreas Gampe | 4720046 | 2017-11-09 11:40:03 -0800 | [diff] [blame] | 42 | TEST_ART_TARGET_SYNC_DEPS += libarttest-target libarttestd-target |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 43 | |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 44 | # Also need libnativebridgetest. |
Andreas Gampe | 4720046 | 2017-11-09 11:40:03 -0800 | [diff] [blame] | 45 | TEST_ART_TARGET_SYNC_DEPS += libnativebridgetest-target |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 46 | |
Nicolas Geoffray | d026ee5 | 2016-11-23 10:47:02 +0000 | [diff] [blame] | 47 | # Also need libopenjdkjvmti. |
Andreas Gampe | 4720046 | 2017-11-09 11:40:03 -0800 | [diff] [blame] | 48 | TEST_ART_TARGET_SYNC_DEPS += libopenjdkjvmti-target libopenjdkjvmtid-target |
Nicolas Geoffray | d026ee5 | 2016-11-23 10:47:02 +0000 | [diff] [blame] | 49 | |
Nicolas Geoffray | 320ccca | 2017-03-01 10:03:08 +0000 | [diff] [blame] | 50 | TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/core-libart-testdex.jar |
| 51 | TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/core-oj-testdex.jar |
| 52 | TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/okhttp-testdex.jar |
| 53 | TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/bouncycastle-testdex.jar |
| 54 | TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/conscrypt-testdex.jar |
| 55 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 56 | # All tests require the host executables. The tests also depend on the core images, but on |
| 57 | # specific version depending on the compiler. |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 58 | ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \ |
| 59 | $(ART_HOST_EXECUTABLES) \ |
Nicolas Geoffray | a6fbe39 | 2017-03-25 14:05:28 +0000 | [diff] [blame] | 60 | $(HOST_OUT_EXECUTABLES)/hprof-conv \ |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 61 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtiagent) \ |
| 62 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtiagentd) \ |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 63 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtistress) \ |
| 64 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtistressd) \ |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 65 | $(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 Kamath | 67ef2c9 | 2015-11-16 10:17:35 +0000 | [diff] [blame] | 70 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | 10edbb1 | 2016-01-06 17:59:49 -0800 | [diff] [blame] | 71 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | f2c5dbd | 2016-11-17 22:50:33 -0800 | [diff] [blame] | 72 | $(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 Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 75 | |
| 76 | ifneq ($(HOST_PREFER_32_BIT),true) |
| 77 | ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \ |
Andreas Gampe | 0ccd1e2 | 2017-04-12 21:53:55 -0700 | [diff] [blame] | 78 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtiagent) \ |
| 79 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtiagentd) \ |
Alex Light | 8f2c6d4 | 2017-04-10 16:27:35 -0700 | [diff] [blame] | 80 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtistress) \ |
| 81 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtistressd) \ |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 82 | $(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 Kamath | 67ef2c9 | 2015-11-16 10:17:35 +0000 | [diff] [blame] | 87 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | 10edbb1 | 2016-01-06 17:59:49 -0800 | [diff] [blame] | 88 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | f2c5dbd | 2016-11-17 22:50:33 -0800 | [diff] [blame] | 89 | $(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 Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 93 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 94 | |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 95 | # Host executables. |
| 96 | host_prereq_rules := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES) |
| 97 | |
Orion Hodson | 64fe3be | 2018-06-15 12:50:22 +0100 | [diff] [blame] | 98 | # Required for jasmin and smali. |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 99 | host_prereq_rules += $(TEST_ART_RUN_TEST_DEPENDENCIES) |
| 100 | |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 101 | # Sync test files to the target, depends upon all things that must be pushed |
| 102 | #to the target. |
| 103 | target_prereq_rules += test-art-target-sync |
| 104 | |
| 105 | define 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 Cross | 3d08bbd | 2018-02-08 15:26:13 -0800 | [diff] [blame] | 115 | $(1)_prereq_rules += $$($(call to-upper,$(1))_CORE_IMAGE_$$(image_suffix)_$(4)) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 116 | else |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 117 | ifeq ($(2),picimage) |
Colin Cross | 3d08bbd | 2018-02-08 15:26:13 -0800 | [diff] [blame] | 118 | $(1)_prereq_rules += $$($(call to-upper,$(1))_CORE_IMAGE_$$(image_suffix)_$(4)) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 119 | else |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 120 | ifeq ($(2),multipicimage) |
Colin Cross | 3d08bbd | 2018-02-08 15:26:13 -0800 | [diff] [blame] | 121 | $(1)_prereq_rules += $$($(call to-upper,$(1))_CORE_IMAGE_$$(image_suffix)_multi_$(4)) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 122 | endif |
| 123 | endif |
| 124 | endif |
| 125 | endef |
| 126 | |
Shubham Ajmera | 4a5a162 | 2017-03-22 10:07:19 -0700 | [diff] [blame] | 127 | TARGET_TYPES := host target |
Jeff Hao | 002b931 | 2017-03-27 16:23:08 -0700 | [diff] [blame] | 128 | COMPILER_TYPES := jit interpreter optimizing regalloc_gc jit interp-ac speed-profile |
Shubham Ajmera | 4a5a162 | 2017-03-22 10:07:19 -0700 | [diff] [blame] | 129 | IMAGE_TYPES := picimage no-image multipicimage |
| 130 | ALL_ADDRESS_SIZES := 64 32 |
Shubham Ajmera | 07a8c70 | 2017-02-16 19:50:12 +0000 | [diff] [blame] | 131 | |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 132 | # 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 Ajmera | 4a5a162 | 2017-03-22 10:07:19 -0700 | [diff] [blame] | 135 | $(foreach image, $(IMAGE_TYPES), \ |
| 136 | $(foreach compiler, $(COMPILER_TYPES), \ |
| 137 | $(foreach address_size, $(ALL_ADDRESS_SIZES), $(eval \ |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 138 | $(call core-image-dependencies,$(target),$(image),$(compiler),$(address_size))))))) |
| 139 | |
| 140 | test-art-host-run-test-dependencies : $(host_prereq_rules) |
Dan Willemsen | 03b0346 | 2018-06-18 20:29:18 -0700 | [diff] [blame] | 141 | .PHONY: test-art-host-run-test-dependencies |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 142 | test-art-target-run-test-dependencies : $(target_prereq_rules) |
Dan Willemsen | 03b0346 | 2018-06-18 20:29:18 -0700 | [diff] [blame] | 143 | .PHONY: test-art-target-run-test-dependencies |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 144 | test-art-run-test-dependencies : test-art-host-run-test-dependencies test-art-target-run-test-dependencies |
Dan Willemsen | 03b0346 | 2018-06-18 20:29:18 -0700 | [diff] [blame] | 145 | .PHONY: test-art-run-test-dependencies |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 146 | |
Shubham Ajmera | 4a5a162 | 2017-03-22 10:07:19 -0700 | [diff] [blame] | 147 | # Create a rule to build and run a test group of the following form: |
| 148 | # test-art-{1: host target}-run-test |
| 149 | define 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 := |
| 158 | endef # 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 | |
| 163 | test-art-run-test : test-art-host-run-test test-art-target-run-test |
| 164 | |
| 165 | host_prereq_rules := |
| 166 | target_prereq_rules := |
| 167 | core-image-dependencies := |
Shubham Ajmera | 4a5a162 | 2017-03-22 10:07:19 -0700 | [diff] [blame] | 168 | define-test-art-host-or-target-run-test-group := |
| 169 | TARGET_TYPES := |
| 170 | COMPILER_TYPES := |
| 171 | IMAGE_TYPES := |
| 172 | ALL_ADDRESS_SIZES := |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 173 | LOCAL_PATH := |