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 | |
| 20 | # List of all tests of the form 003-omnibus-opcodes. |
| 21 | TEST_ART_RUN_TESTS := $(wildcard $(LOCAL_PATH)/[0-9]*) |
| 22 | TEST_ART_RUN_TESTS := $(subst $(LOCAL_PATH)/,, $(TEST_ART_RUN_TESTS)) |
| 23 | |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 24 | ######################################################################## |
| 25 | # The art-run-tests module, used to build all run-tests into an image. |
Alex Light | 9dcc457 | 2014-08-14 14:16:26 -0700 | [diff] [blame] | 26 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 27 | # The path where build only targets will be output, e.g. |
| 28 | # out/target/product/generic_x86_64/obj/PACKAGING/art-run-tests_intermediates/DATA |
Dan Willemsen | 7fb2c2c | 2016-08-01 22:58:31 -0700 | [diff] [blame] | 29 | art_run_tests_build_dir := $(call intermediates-dir-for,JAVA_LIBRARIES,art-run-tests)/DATA |
| 30 | art_run_tests_install_dir := $(call intermediates-dir-for,PACKAGING,art-run-tests)/DATA |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 31 | |
| 32 | # A generated list of prerequisites that call 'run-test --build-only', the actual prerequisite is |
| 33 | # an empty file touched in the intermediate directory. |
| 34 | TEST_ART_RUN_TEST_BUILD_RULES := |
| 35 | |
Nicolas Geoffray | 07f2bc1 | 2015-05-29 13:40:25 +0100 | [diff] [blame] | 36 | # Dependencies for actually running a run-test. |
Sebastien Hertz | 19ac027 | 2015-02-24 17:39:50 +0100 | [diff] [blame] | 37 | TEST_ART_RUN_TEST_DEPENDENCIES := \ |
| 38 | $(DX) \ |
| 39 | $(HOST_OUT_EXECUTABLES)/jasmin \ |
| 40 | $(HOST_OUT_EXECUTABLES)/smali \ |
Sebastien Hertz | 2b763c3 | 2016-03-31 09:22:50 +0200 | [diff] [blame] | 41 | $(HOST_OUT_EXECUTABLES)/dexmerger \ |
| 42 | $(JACK) |
Sebastien Hertz | 19ac027 | 2015-02-24 17:39:50 +0100 | [diff] [blame] | 43 | |
Sebastien Hertz | 2b763c3 | 2016-03-31 09:22:50 +0200 | [diff] [blame] | 44 | TEST_ART_RUN_TEST_ORDERONLY_DEPENDENCIES := setup-jack-server |
Nicolas Geoffray | 07f2bc1 | 2015-05-29 13:40:25 +0100 | [diff] [blame] | 45 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 46 | # Helper to create individual build targets for tests. Must be called with $(eval). |
| 47 | # $(1): the test number |
| 48 | define define-build-art-run-test |
Dan Willemsen | 7fb2c2c | 2016-08-01 22:58:31 -0700 | [diff] [blame] | 49 | dmart_target := $(art_run_tests_build_dir)/art-run-tests/$(1)/touch |
| 50 | dmart_install_target := $(art_run_tests_install_dir)/art-run-tests/$(1)/touch |
Sebastien Hertz | 19ac027 | 2015-02-24 17:39:50 +0100 | [diff] [blame] | 51 | run_test_options = --build-only |
Alex Light | 91de25f | 2015-10-28 17:00:06 -0700 | [diff] [blame] | 52 | ifeq ($(ART_TEST_QUIET),true) |
| 53 | run_test_options += --quiet |
| 54 | endif |
Sebastien Hertz | 19ac027 | 2015-02-24 17:39:50 +0100 | [diff] [blame] | 55 | $$(dmart_target): PRIVATE_RUN_TEST_OPTIONS := $$(run_test_options) |
Yohann Roussel | 05b9125 | 2015-12-09 12:02:46 +0100 | [diff] [blame] | 56 | $$(dmart_target): $(TEST_ART_RUN_TEST_DEPENDENCIES) $(TARGET_JACK_CLASSPATH_DEPENDENCIES) | $(TEST_ART_RUN_TEST_ORDERONLY_DEPENDENCIES) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 57 | $(hide) rm -rf $$(dir $$@) && mkdir -p $$(dir $$@) |
| 58 | $(hide) DX=$(abspath $(DX)) JASMIN=$(abspath $(HOST_OUT_EXECUTABLES)/jasmin) \ |
Andreas Gampe | 8fda9f2 | 2014-10-03 16:15:37 -0700 | [diff] [blame] | 59 | SMALI=$(abspath $(HOST_OUT_EXECUTABLES)/smali) \ |
| 60 | DXMERGER=$(abspath $(HOST_OUT_EXECUTABLES)/dexmerger) \ |
Yohann Roussel | cc6bb93 | 2016-01-19 23:29:29 +0100 | [diff] [blame] | 61 | JACK_VERSION=$(JACK_DEFAULT_VERSION) \ |
Sebastien Hertz | 19ac027 | 2015-02-24 17:39:50 +0100 | [diff] [blame] | 62 | JACK=$(abspath $(JACK)) \ |
Yohann Roussel | aaa779a | 2016-01-19 17:07:18 +0100 | [diff] [blame] | 63 | JACK_VERSION=$(JACK_DEFAULT_VERSION) \ |
Sebastien Hertz | 19ac027 | 2015-02-24 17:39:50 +0100 | [diff] [blame] | 64 | JACK_CLASSPATH=$(TARGET_JACK_CLASSPATH) \ |
Sebastien Hertz | 19ac027 | 2015-02-24 17:39:50 +0100 | [diff] [blame] | 65 | $(LOCAL_PATH)/run-test $$(PRIVATE_RUN_TEST_OPTIONS) --output-path $$(abspath $$(dir $$@)) $(1) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 66 | $(hide) touch $$@ |
| 67 | |
Dan Willemsen | 7fb2c2c | 2016-08-01 22:58:31 -0700 | [diff] [blame] | 68 | $$(dmart_install_target): $$(dmart_target) |
| 69 | $(hide) rm -rf $$(dir $$@) && mkdir -p $$(dir $$@) |
| 70 | $(hide) cp $$(dir $$<)/* $$(dir $$@)/ |
| 71 | |
| 72 | TEST_ART_RUN_TEST_BUILD_RULES += $$(dmart_install_target) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 73 | dmart_target := |
Dan Willemsen | 7fb2c2c | 2016-08-01 22:58:31 -0700 | [diff] [blame] | 74 | dmart_install_target := |
Sebastien Hertz | 19ac027 | 2015-02-24 17:39:50 +0100 | [diff] [blame] | 75 | run_test_options := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 76 | endef |
Ian Rogers | bf66bce | 2014-06-24 23:15:34 -0700 | [diff] [blame] | 77 | $(foreach test, $(TEST_ART_RUN_TESTS), $(eval $(call define-build-art-run-test,$(test)))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 78 | |
| 79 | include $(CLEAR_VARS) |
| 80 | LOCAL_MODULE_TAGS := tests |
| 81 | LOCAL_MODULE := art-run-tests |
Ian Rogers | abbf242 | 2014-10-15 11:57:01 -0700 | [diff] [blame] | 82 | LOCAL_ADDITIONAL_DEPENDENCIES := $(TEST_ART_RUN_TEST_BUILD_RULES) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 83 | # The build system use this flag to pick up files generated by declare-make-art-run-test. |
Dan Willemsen | 7fb2c2c | 2016-08-01 22:58:31 -0700 | [diff] [blame] | 84 | LOCAL_PICKUP_FILES := $(art_run_tests_install_dir) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 85 | |
| 86 | include $(BUILD_PHONY_PACKAGE) |
| 87 | |
Shubham Ajmera | 6f3d590 | 2017-02-06 06:39:11 +0000 | [diff] [blame] | 88 | # Convert's a rule name to the form used in variables, e.g. no-relocate to NO_RELOCATE |
Ian Rogers | f5c44b3 | 2014-08-19 16:52:36 -0700 | [diff] [blame] | 89 | define name-to-var |
| 90 | $(shell echo $(1) | tr '[:lower:]' '[:upper:]' | tr '-' '_') |
| 91 | endef # name-to-var |
| 92 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 93 | # We need dex2oat and dalvikvm on the target as well as the core images (all images as we sync |
| 94 | # only once). |
| 95 | TEST_ART_TARGET_SYNC_DEPS += $(ART_TARGET_EXECUTABLES) $(TARGET_CORE_IMG_OUTS) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 96 | |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 97 | # Also need libartagent. |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 98 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libartagent) |
| 99 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libartagentd) |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 100 | ifdef TARGET_2ND_ARCH |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 101 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libartagent) |
| 102 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libartagentd) |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 103 | endif |
| 104 | |
Alex Light | 49948e9 | 2016-08-11 15:35:28 -0700 | [diff] [blame] | 105 | # Also need libtiagent. |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 106 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libtiagent) |
| 107 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libtiagentd) |
Alex Light | 49948e9 | 2016-08-11 15:35:28 -0700 | [diff] [blame] | 108 | ifdef TARGET_2ND_ARCH |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 109 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libtiagent) |
| 110 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libtiagentd) |
Alex Light | 49948e9 | 2016-08-11 15:35:28 -0700 | [diff] [blame] | 111 | endif |
| 112 | |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 113 | # Also need libarttest. |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 114 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libarttest) |
| 115 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libarttestd) |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 116 | ifdef TARGET_2ND_ARCH |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 117 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libarttest) |
| 118 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libarttestd) |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 119 | endif |
| 120 | |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 121 | # Also need libnativebridgetest. |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 122 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_ARCH)_libnativebridgetest) |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 123 | ifdef TARGET_2ND_ARCH |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 124 | TEST_ART_TARGET_SYNC_DEPS += $(OUT_DIR)/$(ART_TEST_LIST_device_$(TARGET_2ND_ARCH)_libnativebridgetest) |
Andreas Gampe | 855564b | 2014-07-25 02:32:19 -0700 | [diff] [blame] | 125 | endif |
| 126 | |
Nicolas Geoffray | d026ee5 | 2016-11-23 10:47:02 +0000 | [diff] [blame] | 127 | # Also need libopenjdkjvmti. |
Nicolas Geoffray | ae02d2e | 2016-11-23 16:25:15 +0000 | [diff] [blame] | 128 | TEST_ART_TARGET_SYNC_DEPS += libopenjdkjvmti |
| 129 | TEST_ART_TARGET_SYNC_DEPS += libopenjdkjvmtid |
Nicolas Geoffray | d026ee5 | 2016-11-23 10:47:02 +0000 | [diff] [blame] | 130 | |
Nicolas Geoffray | 320ccca | 2017-03-01 10:03:08 +0000 | [diff] [blame] | 131 | TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/core-libart-testdex.jar |
| 132 | TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/core-oj-testdex.jar |
| 133 | TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/okhttp-testdex.jar |
| 134 | TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/bouncycastle-testdex.jar |
| 135 | TEST_ART_TARGET_SYNC_DEPS += $(TARGET_OUT_JAVA_LIBRARIES)/conscrypt-testdex.jar |
| 136 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 137 | # All tests require the host executables. The tests also depend on the core images, but on |
| 138 | # specific version depending on the compiler. |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 139 | ART_TEST_HOST_RUN_TEST_DEPENDENCIES := \ |
| 140 | $(ART_HOST_EXECUTABLES) \ |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 141 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtiagent) \ |
| 142 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libtiagentd) \ |
| 143 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libartagent) \ |
| 144 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libartagentd) \ |
| 145 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libarttest) \ |
| 146 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libarttestd) \ |
| 147 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(ART_HOST_ARCH)_libnativebridgetest) \ |
Narayan Kamath | 67ef2c9 | 2015-11-16 10:17:35 +0000 | [diff] [blame] | 148 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | 10edbb1 | 2016-01-06 17:59:49 -0800 | [diff] [blame] | 149 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | f2c5dbd | 2016-11-17 22:50:33 -0800 | [diff] [blame] | 150 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$(ART_HOST_SHLIB_EXTENSION) \ |
| 151 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmti$(ART_HOST_SHLIB_EXTENSION) \ |
| 152 | $(ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmtid$(ART_HOST_SHLIB_EXTENSION) \ |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 153 | |
| 154 | ifneq ($(HOST_PREFER_32_BIT),true) |
| 155 | ART_TEST_HOST_RUN_TEST_DEPENDENCIES += \ |
Colin Cross | afd3c9e | 2016-09-16 13:47:21 -0700 | [diff] [blame] | 156 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtiagent) \ |
| 157 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libtiagentd) \ |
| 158 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libartagent) \ |
| 159 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libartagentd) \ |
| 160 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libarttest) \ |
| 161 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libarttestd) \ |
| 162 | $(OUT_DIR)/$(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_libnativebridgetest) \ |
Narayan Kamath | 67ef2c9 | 2015-11-16 10:17:35 +0000 | [diff] [blame] | 163 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | 10edbb1 | 2016-01-06 17:59:49 -0800 | [diff] [blame] | 164 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$(ART_HOST_SHLIB_EXTENSION) \ |
Andreas Gampe | f2c5dbd | 2016-11-17 22:50:33 -0800 | [diff] [blame] | 165 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$(ART_HOST_SHLIB_EXTENSION) \ |
| 166 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmti$(ART_HOST_SHLIB_EXTENSION) \ |
| 167 | $(2ND_ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkjvmtid$(ART_HOST_SHLIB_EXTENSION) \ |
| 168 | |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 169 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 170 | |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 171 | # Host executables. |
| 172 | host_prereq_rules := $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES) |
| 173 | |
| 174 | # Classpath for Jack compilation for host. |
| 175 | host_prereq_rules += $(HOST_JACK_CLASSPATH_DEPENDENCIES) |
| 176 | |
| 177 | # Required for dx, jasmin, smali, dexmerger, jack. |
| 178 | host_prereq_rules += $(TEST_ART_RUN_TEST_DEPENDENCIES) |
| 179 | |
| 180 | host_prereq_rules += $(HOST_OUT_EXECUTABLES)/hprof-conv |
| 181 | |
| 182 | # Classpath for Jack compilation for target. |
| 183 | target_prereq_rules := $(TARGET_JACK_CLASSPATH_DEPENDENCIES) |
| 184 | |
| 185 | # Sync test files to the target, depends upon all things that must be pushed |
| 186 | #to the target. |
| 187 | target_prereq_rules += test-art-target-sync |
| 188 | |
| 189 | define core-image-dependencies |
| 190 | image_suffix := $(3) |
| 191 | ifeq ($(3),regalloc_gc) |
| 192 | image_suffix:=optimizing |
| 193 | else |
| 194 | ifeq ($(3),jit) |
| 195 | image_suffix:=interpreter |
| 196 | endif |
| 197 | endif |
| 198 | ifeq ($(2),no-image) |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 199 | $(1)_prereq_rules += $$($(call name-to-var,$(1))_CORE_IMAGE_$$(image_suffix)_$(4)) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 200 | else |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 201 | ifeq ($(2),picimage) |
| 202 | $(1)_prereq_rules += $$($(call name-to-var,$(1))_CORE_IMAGE_$$(image_suffix)_$(4)) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 203 | else |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 204 | ifeq ($(2),multipicimage) |
| 205 | $(1)_prereq_rules += $$($(call name-to-var,$(1))_CORE_IMAGE_$$(image_suffix)_multi_$(4)) |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 206 | endif |
| 207 | endif |
| 208 | endif |
| 209 | endef |
| 210 | |
Shubham Ajmera | 4a5a162 | 2017-03-22 10:07:19 -0700 | [diff] [blame^] | 211 | TARGET_TYPES := host target |
| 212 | COMPILER_TYPES := jit interpreter optimizing regalloc_gc jit interp-ac |
| 213 | IMAGE_TYPES := picimage no-image multipicimage |
| 214 | ALL_ADDRESS_SIZES := 64 32 |
Shubham Ajmera | 07a8c70 | 2017-02-16 19:50:12 +0000 | [diff] [blame] | 215 | |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 216 | # Add core image dependencies required for given target - HOST or TARGET, |
| 217 | # IMAGE_TYPE, COMPILER_TYPE and ADDRESS_SIZE to the prereq_rules. |
| 218 | $(foreach target, $(TARGET_TYPES), \ |
Shubham Ajmera | 4a5a162 | 2017-03-22 10:07:19 -0700 | [diff] [blame^] | 219 | $(foreach image, $(IMAGE_TYPES), \ |
| 220 | $(foreach compiler, $(COMPILER_TYPES), \ |
| 221 | $(foreach address_size, $(ALL_ADDRESS_SIZES), $(eval \ |
Shubham Ajmera | 65adb8b | 2017-02-06 16:04:25 +0000 | [diff] [blame] | 222 | $(call core-image-dependencies,$(target),$(image),$(compiler),$(address_size))))))) |
| 223 | |
| 224 | test-art-host-run-test-dependencies : $(host_prereq_rules) |
| 225 | test-art-target-run-test-dependencies : $(target_prereq_rules) |
| 226 | test-art-run-test-dependencies : test-art-host-run-test-dependencies test-art-target-run-test-dependencies |
| 227 | |
Shubham Ajmera | 4a5a162 | 2017-03-22 10:07:19 -0700 | [diff] [blame^] | 228 | # Generate list of dependencies required for given target - HOST or TARGET, IMAGE_TYPE, |
| 229 | # COMPILER_TYPE and ADDRESS_SIZE. |
Shubham Ajmera | 6f3d590 | 2017-02-06 06:39:11 +0000 | [diff] [blame] | 230 | $(foreach target, $(TARGET_TYPES), \ |
| 231 | $(foreach image, $(IMAGE_TYPES), \ |
Shubham Ajmera | 4a5a162 | 2017-03-22 10:07:19 -0700 | [diff] [blame^] | 232 | $(foreach compiler, $(COMPILER_TYPES), \ |
| 233 | $(foreach address_size, $(ALL_ADDRESS_SIZES), $(eval \ |
| 234 | $(call core-image-dependencies,$(target),$(image),$(compiler),$(address_size))))))) |
Shubham Ajmera | 6f3d590 | 2017-02-06 06:39:11 +0000 | [diff] [blame] | 235 | |
Shubham Ajmera | 4a5a162 | 2017-03-22 10:07:19 -0700 | [diff] [blame^] | 236 | test-art-host-run-test-dependencies : $(host_prereq_rules) |
| 237 | test-art-target-run-test-dependencies : $(target_prereq_rules) |
| 238 | test-art-run-test-dependencies : test-art-host-run-test-dependencies test-art-target-run-test-dependencies |
| 239 | |
| 240 | # Create a rule to build and run a test group of the following form: |
| 241 | # test-art-{1: host target}-run-test |
| 242 | define define-test-art-host-or-target-run-test-group |
| 243 | build_target := test-art-$(1)-run-test |
| 244 | .PHONY: $$(build_target) |
| 245 | |
| 246 | $$(build_target) : args := --$(1) --verbose |
| 247 | $$(build_target) : test-art-$(1)-run-test-dependencies |
| 248 | ./art/test/testrunner/testrunner.py $$(args) |
| 249 | build_target := |
| 250 | args := |
| 251 | endef # define-test-art-host-or-target-run-test-group |
| 252 | |
| 253 | $(foreach target, $(TARGET_TYPES), $(eval \ |
| 254 | $(call define-test-art-host-or-target-run-test-group,$(target)))) |
| 255 | |
| 256 | test-art-run-test : test-art-host-run-test test-art-target-run-test |
| 257 | |
| 258 | host_prereq_rules := |
| 259 | target_prereq_rules := |
| 260 | core-image-dependencies := |
| 261 | name-to-var := |
| 262 | ART_TEST_HOST_RUN_TEST_DEPENDENCIES := |
| 263 | TEST_ART_TARGET_SYNC_DEPS := |
| 264 | define-test-art-host-or-target-run-test-group := |
| 265 | TARGET_TYPES := |
| 266 | COMPILER_TYPES := |
| 267 | IMAGE_TYPES := |
| 268 | ALL_ADDRESS_SIZES := |
Alex Light | 7233c7e | 2016-07-28 10:07:45 -0700 | [diff] [blame] | 269 | LOCAL_PATH := |