blob: 4f273e597921ea12be0de92a4d76cfbd1968b722 [file] [log] [blame]
Carl Shapiro008e4122011-06-23 17:27:46 -07001#
2# Copyright (C) 2011 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
Ian Rogersafd9acc2014-06-17 08:21:54 -070017# The path for which all the dex files are relative, not actually the current directory.
18LOCAL_PATH := art/test
19
20include art/build/Android.common_test.mk
21include art/build/Android.common_path.mk
Alex Light50fa9932015-08-10 15:30:07 -070022include art/build/Android.common_build.mk
Ian Rogersafd9acc2014-06-17 08:21:54 -070023
24# Subdirectories in art/test which contain dex files used as inputs for gtests.
25GTEST_DEX_DIRECTORIES := \
26 AbstractMethod \
27 AllFields \
28 ExceptionHandle \
29 GetMethodSignature \
Mathieu Chartier496577f2016-09-20 15:33:31 -070030 ImageLayoutA \
31 ImageLayoutB \
Andreas Gampea1ff30f2016-09-27 12:19:45 -070032 IMTA \
33 IMTB \
Sebastien Hertz0462c4c2015-04-01 16:34:17 +020034 Instrumentation \
Ian Rogersafd9acc2014-06-17 08:21:54 -070035 Interfaces \
Artem Udovichenkod9786b02015-10-14 16:36:55 +030036 Lookup \
Ian Rogersafd9acc2014-06-17 08:21:54 -070037 Main \
Narayan Kamath25352fc2016-08-03 12:46:58 +010038 MethodTypes \
Richard Uhler66d874d2015-01-15 09:37:19 -080039 MultiDex \
Richard Uhler67ff7d12015-05-14 13:21:13 -070040 MultiDexModifiedSecondary \
Ian Rogersafd9acc2014-06-17 08:21:54 -070041 MyClass \
42 MyClassNatives \
43 Nested \
44 NonStaticLeafMethods \
Mathieu Chartier279ac5c2016-09-08 17:34:25 -070045 Packages \
Ian Rogersafd9acc2014-06-17 08:21:54 -070046 ProtoCompare \
47 ProtoCompare2 \
Calin Juravle877fd962016-01-05 14:29:29 +000048 ProfileTestMultiDex \
Ian Rogersafd9acc2014-06-17 08:21:54 -070049 StaticLeafMethods \
50 Statics \
51 StaticsFromCode \
52 Transaction \
53 XandY
54
55# Create build rules for each dex file recording the dependency.
56$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval $(call build-art-test-dex,art-gtest,$(dir), \
Ian Rogers1a2f84e2014-07-07 16:05:18 -070057 $(ART_TARGET_NATIVETEST_OUT),art/build/Android.gtest.mk,ART_TEST_TARGET_GTEST_$(dir)_DEX, \
58 ART_TEST_HOST_GTEST_$(dir)_DEX)))
Ian Rogersafd9acc2014-06-17 08:21:54 -070059
Richard Uhler66d874d2015-01-15 09:37:19 -080060# Create rules for MainStripped, a copy of Main with the classes.dex stripped
61# for the oat file assistant tests.
62ART_TEST_HOST_GTEST_MainStripped_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
63ART_TEST_TARGET_GTEST_MainStripped_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
64
65$(ART_TEST_HOST_GTEST_MainStripped_DEX): $(ART_TEST_HOST_GTEST_Main_DEX)
66 cp $< $@
67 $(call dexpreopt-remove-classes.dex,$@)
68
69$(ART_TEST_TARGET_GTEST_MainStripped_DEX): $(ART_TEST_TARGET_GTEST_Main_DEX)
70 cp $< $@
71 $(call dexpreopt-remove-classes.dex,$@)
72
David Brazdilca3c8c32016-09-06 14:04:48 +010073ART_TEST_GTEST_VerifierDeps_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifierDeps/*.smali))
74ART_TEST_HOST_GTEST_VerifierDeps_DEX := $(dir $(ART_TEST_HOST_GTEST_Main_DEX))$(subst Main,VerifierDeps,$(basename $(notdir $(ART_TEST_HOST_GTEST_Main_DEX))))$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
David Brazdilf906f122016-09-16 16:33:31 +010075ART_TEST_TARGET_GTEST_VerifierDeps_DEX := $(dir $(ART_TEST_TARGET_GTEST_Main_DEX))$(subst Main,VerifierDeps,$(basename $(notdir $(ART_TEST_TARGET_GTEST_Main_DEX))))$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
David Brazdilca3c8c32016-09-06 14:04:48 +010076
77$(ART_TEST_HOST_GTEST_VerifierDeps_DEX): $(ART_TEST_GTEST_VerifierDeps_SRC) $(HOST_OUT_EXECUTABLES)/smali
78 $(HOST_OUT_EXECUTABLES)/smali --output=$@ $(filter %.smali,$^)
79
David Brazdilf906f122016-09-16 16:33:31 +010080$(ART_TEST_TARGET_GTEST_VerifierDeps_DEX): $(ART_TEST_GTEST_VerifierDeps_SRC) $(HOST_OUT_EXECUTABLES)/smali
81 $(HOST_OUT_EXECUTABLES)/smali --output=$@ $(filter %.smali,$^)
82
Ian Rogersafd9acc2014-06-17 08:21:54 -070083# Dex file dependencies for each gtest.
Andreas Gampee1459ae2016-06-29 09:36:30 -070084ART_GTEST_dex2oat_environment_tests_DEX_DEPS := Main MainStripped MultiDex MultiDexModifiedSecondary Nested
85
Narayan Kamath25352fc2016-08-03 12:46:58 +010086ART_GTEST_class_linker_test_DEX_DEPS := Interfaces MethodTypes MultiDex MyClass Nested Statics StaticsFromCode
Calin Juravle877fd962016-01-05 14:29:29 +000087ART_GTEST_compiler_driver_test_DEX_DEPS := AbstractMethod StaticLeafMethods ProfileTestMultiDex
Narayan Kamath25352fc2016-08-03 12:46:58 +010088ART_GTEST_dex_cache_test_DEX_DEPS := Main Packages MethodTypes
Andreas Gampeda823442014-11-03 15:36:53 -080089ART_GTEST_dex_file_test_DEX_DEPS := GetMethodSignature Main Nested
Andreas Gampe7adeda82016-07-25 08:27:35 -070090ART_GTEST_dex2oat_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) Statics
Brian Carlstromeb85f2b2014-06-25 13:23:00 -070091ART_GTEST_exception_test_DEX_DEPS := ExceptionHandle
Mathieu Chartier496577f2016-09-20 15:33:31 -070092ART_GTEST_image_test_DEX_DEPS := ImageLayoutA ImageLayoutB
Andreas Gampea1ff30f2016-09-27 12:19:45 -070093ART_GTEST_imtable_test_DEX_DEPS := IMTA IMTB
Sebastien Hertz0462c4c2015-04-01 16:34:17 +020094ART_GTEST_instrumentation_test_DEX_DEPS := Instrumentation
Brian Carlstromeb85f2b2014-06-25 13:23:00 -070095ART_GTEST_jni_compiler_test_DEX_DEPS := MyClassNatives
96ART_GTEST_jni_internal_test_DEX_DEPS := AllFields StaticLeafMethods
Andreas Gampee1459ae2016-06-29 09:36:30 -070097ART_GTEST_oat_file_assistant_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS)
Andreas Gampe7848da42015-04-09 11:15:04 -070098ART_GTEST_oat_file_test_DEX_DEPS := Main MultiDex
Mathieu Chartier07ddb6f2015-11-05 11:16:34 -080099ART_GTEST_oat_test_DEX_DEPS := Main
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700100ART_GTEST_object_test_DEX_DEPS := ProtoCompare ProtoCompare2 StaticsFromCode XandY
101ART_GTEST_proxy_test_DEX_DEPS := Interfaces
102ART_GTEST_reflection_test_DEX_DEPS := Main NonStaticLeafMethods StaticLeafMethods
Calin Juravle877fd962016-01-05 14:29:29 +0000103ART_GTEST_profile_assistant_test_DEX_DEPS := ProfileTestMultiDex
104ART_GTEST_profile_compilation_info_test_DEX_DEPS := ProfileTestMultiDex
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700105ART_GTEST_stub_test_DEX_DEPS := AllFields
106ART_GTEST_transaction_test_DEX_DEPS := Transaction
Artem Udovichenkod9786b02015-10-14 16:36:55 +0300107ART_GTEST_type_lookup_table_test_DEX_DEPS := Lookup
David Brazdilca3c8c32016-09-06 14:04:48 +0100108ART_GTEST_verifier_deps_test_DEX_DEPS := VerifierDeps
Ian Rogersafd9acc2014-06-17 08:21:54 -0700109
110# The elf writer test has dependencies on core.oat.
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000111ART_GTEST_elf_writer_test_HOST_DEPS := $(HOST_CORE_IMAGE_optimizing_no-pic_64) $(HOST_CORE_IMAGE_optimizing_no-pic_32)
112ART_GTEST_elf_writer_test_TARGET_DEPS := $(TARGET_CORE_IMAGE_optimizing_no-pic_64) $(TARGET_CORE_IMAGE_optimizing_no-pic_32)
Brian Carlstrom53463ea2014-11-09 14:11:51 -0800113
Andreas Gampee1459ae2016-06-29 09:36:30 -0700114ART_GTEST_dex2oat_environment_tests_HOST_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000115 $(HOST_CORE_IMAGE_optimizing_pic_64) \
116 $(HOST_CORE_IMAGE_optimizing_pic_32) \
Richard Uhlerf51ac422016-07-08 09:22:33 -0700117 $(HOST_OUT_EXECUTABLES)/patchoatd
Andreas Gampee1459ae2016-06-29 09:36:30 -0700118ART_GTEST_dex2oat_environment_tests_TARGET_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000119 $(TARGET_CORE_IMAGE_optimizing_pic_64) \
120 $(TARGET_CORE_IMAGE_optimizing_pic_32) \
Richard Uhlerf51ac422016-07-08 09:22:33 -0700121 $(TARGET_OUT_EXECUTABLES)/patchoatd
Andreas Gampee1459ae2016-06-29 09:36:30 -0700122
123ART_GTEST_oat_file_assistant_test_HOST_DEPS := \
Richard Uhlerf51ac422016-07-08 09:22:33 -0700124 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS)
Andreas Gampee1459ae2016-06-29 09:36:30 -0700125ART_GTEST_oat_file_assistant_test_TARGET_DEPS := \
Richard Uhlerf51ac422016-07-08 09:22:33 -0700126 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS)
Andreas Gampee1459ae2016-06-29 09:36:30 -0700127
128
129ART_GTEST_dex2oat_test_HOST_DEPS := \
130 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS)
131ART_GTEST_dex2oat_test_TARGET_DEPS := \
132 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS)
Richard Uhler66d874d2015-01-15 09:37:19 -0800133
Brian Carlstrom53463ea2014-11-09 14:11:51 -0800134# TODO: document why this is needed.
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000135ART_GTEST_proxy_test_HOST_DEPS := $(HOST_CORE_IMAGE_optimizing_no-pic_64) $(HOST_CORE_IMAGE_optimizing_no-pic_32)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700136
Aart Bikcfbe53c2015-07-06 14:27:27 -0700137# The dexdump test requires an image and the dexdump utility.
Aart Bik22c26f52015-07-08 21:20:13 +0000138# TODO: rename into dexdump when migration completes
Aart Bikcfbe53c2015-07-06 14:27:27 -0700139ART_GTEST_dexdump_test_HOST_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000140 $(HOST_CORE_IMAGE_optimizing_no-pic_64) \
141 $(HOST_CORE_IMAGE_optimizing_no-pic_32) \
Aart Bik22c26f52015-07-08 21:20:13 +0000142 $(HOST_OUT_EXECUTABLES)/dexdump2
Aart Bikcfbe53c2015-07-06 14:27:27 -0700143ART_GTEST_dexdump_test_TARGET_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000144 $(TARGET_CORE_IMAGE_optimizing_no-pic_64) \
145 $(TARGET_CORE_IMAGE_optimizing_no-pic_32) \
Aart Bik22c26f52015-07-08 21:20:13 +0000146 dexdump2
Aart Bikcfbe53c2015-07-06 14:27:27 -0700147
Jeff Haoc3acfc52016-08-29 14:18:26 -0700148# The dexlayout test requires an image and the dexlayout utility.
149# TODO: rename into dexdump when migration completes
150ART_GTEST_dexlayout_test_HOST_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000151 $(HOST_CORE_IMAGE_optimizing_no-pic_64) \
152 $(HOST_CORE_IMAGE_optimizing_no-pic_32) \
Jeff Haoc3acfc52016-08-29 14:18:26 -0700153 $(HOST_OUT_EXECUTABLES)/dexlayout \
154 $(HOST_OUT_EXECUTABLES)/dexdump2
155ART_GTEST_dexlayout_test_TARGET_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000156 $(TARGET_CORE_IMAGE_optimizing_no-pic_64) \
157 $(TARGET_CORE_IMAGE_optimizing_no-pic_32) \
Jeff Haoc3acfc52016-08-29 14:18:26 -0700158 dexlayout \
159 dexdump2
160
Aart Bik3e40f4a2015-07-07 17:09:41 -0700161# The dexlist test requires an image and the dexlist utility.
Aart Bik3e40f4a2015-07-07 17:09:41 -0700162ART_GTEST_dexlist_test_HOST_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000163 $(HOST_CORE_IMAGE_optimizing_no-pic_64) \
164 $(HOST_CORE_IMAGE_optimizing_no-pic_32) \
Aart Bikb1b45be2015-08-28 11:09:29 -0700165 $(HOST_OUT_EXECUTABLES)/dexlist
Aart Bik3e40f4a2015-07-07 17:09:41 -0700166ART_GTEST_dexlist_test_TARGET_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000167 $(TARGET_CORE_IMAGE_optimizing_no-pic_64) \
168 $(TARGET_CORE_IMAGE_optimizing_no-pic_32) \
Aart Bikb1b45be2015-08-28 11:09:29 -0700169 dexlist
Aart Bik3e40f4a2015-07-07 17:09:41 -0700170
Igor Murashkin37743352014-11-13 14:38:00 -0800171# The imgdiag test has dependencies on core.oat since it needs to load it during the test.
Andreas Gampec93b8b52014-12-19 23:12:25 -0800172# For the host, also add the installed tool (in the base size, that should suffice). For the
173# target, just the module is fine, the sync will happen late enough.
174ART_GTEST_imgdiag_test_HOST_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000175 $(HOST_CORE_IMAGE_optimizing_no-pic_64) \
176 $(HOST_CORE_IMAGE_optimizing_no-pic_32) \
Andreas Gampec93b8b52014-12-19 23:12:25 -0800177 $(HOST_OUT_EXECUTABLES)/imgdiagd
178ART_GTEST_imgdiag_test_TARGET_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000179 $(TARGET_CORE_IMAGE_optimizing_no-pic_64) \
180 $(TARGET_CORE_IMAGE_optimizing_no-pic_32) \
Andreas Gampec93b8b52014-12-19 23:12:25 -0800181 imgdiagd
Igor Murashkin37743352014-11-13 14:38:00 -0800182
Mathieu Chartierea216b32015-05-26 19:48:16 -0700183# Oatdump test requires an image and oatfile to dump.
184ART_GTEST_oatdump_test_HOST_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000185 $(HOST_CORE_IMAGE_optimizing_no-pic_64) \
186 $(HOST_CORE_IMAGE_optimizing_no-pic_32) \
Colin Crossb20be212016-09-19 13:02:47 -0700187 $(HOST_OUT_EXECUTABLES)/oatdumpd \
188 $(HOST_OUT_EXECUTABLES)/oatdumpds
Mathieu Chartierea216b32015-05-26 19:48:16 -0700189ART_GTEST_oatdump_test_TARGET_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000190 $(TARGET_CORE_IMAGE_optimizing_no-pic_64) \
191 $(TARGET_CORE_IMAGE_optimizing_no-pic_32) \
Mathieu Chartierea216b32015-05-26 19:48:16 -0700192 oatdump
193
Calin Juravle2e2db782016-02-23 12:00:03 +0000194# Profile assistant tests requires profman utility.
195ART_GTEST_profile_assistant_test_HOST_DEPS := \
196 $(HOST_OUT_EXECUTABLES)/profmand
197ART_GTEST_profile_assistant_test_TARGET_DEPS := \
198 profman
199
Ian Rogersafd9acc2014-06-17 08:21:54 -0700200# The path for which all the source files are relative, not actually the current directory.
Brian Carlstrom7940e442013-07-12 13:46:57 -0700201LOCAL_PATH := art
202
Colin Cross6e95dd52016-09-12 15:37:10 -0700203ART_TEST_MODULES := \
204 art_cmdline_tests \
205 art_compiler_tests \
206 art_compiler_host_tests \
207 art_dex2oat_tests \
208 art_dexdump_tests \
209 art_dexlayout_tests \
210 art_dexlist_tests \
211 art_imgdiag_tests \
212 art_oatdump_tests \
213 art_profman_tests \
214 art_runtime_tests \
215 art_runtime_compiler_tests \
Brian Carlstroma1ce1fe2014-02-24 23:23:58 -0800216
Colin Cross6e95dd52016-09-12 15:37:10 -0700217ART_TARGET_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\
218 $(ART_TEST_LIST_device_$(TARGET_ARCH)_$(m)))
Alex Light50fa9932015-08-10 15:30:07 -0700219
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100220ifdef TARGET_2ND_ARCH
2212ND_ART_TARGET_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\
222 $(ART_TEST_LIST_device_$(2ND_TARGET_ARCH)_$(m)))
223endif
224
Colin Cross6e95dd52016-09-12 15:37:10 -0700225ART_HOST_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\
Colin Cross124f8812016-09-15 20:57:47 -0700226 $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_$(m)))
Alex Light50fa9932015-08-10 15:30:07 -0700227
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100228ifneq ($(HOST_PREFER_32_BIT),true)
2292ND_ART_HOST_GTEST_FILES += $(foreach m,$(ART_TEST_MODULES),\
230 $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_$(m)))
231endif
232
Ian Rogersafd9acc2014-06-17 08:21:54 -0700233# Variables holding collections of gtest pre-requisits used to run a number of gtests.
234ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
235ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
236ART_TEST_HOST_GTEST_RULES :=
237ART_TEST_HOST_VALGRIND_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
238ART_TEST_HOST_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
239ART_TEST_HOST_VALGRIND_GTEST_RULES :=
240ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
241ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
242ART_TEST_TARGET_GTEST_RULES :=
Anton Kirilove5e76f42016-05-03 16:15:36 +0100243ART_TEST_TARGET_VALGRIND_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
244ART_TEST_TARGET_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
245ART_TEST_TARGET_VALGRIND_GTEST_RULES :=
Nicolas Geoffray58035ae2015-05-27 19:10:27 +0100246ART_TEST_HOST_GTEST_DEPENDENCIES :=
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700247
Nicolas Geoffray96a37c82014-10-29 23:50:40 +0000248ART_GTEST_TARGET_ANDROID_ROOT := '/system'
249ifneq ($(ART_TEST_ANDROID_ROOT),)
250 ART_GTEST_TARGET_ANDROID_ROOT := $(ART_TEST_ANDROID_ROOT)
251endif
252
Anton Kirilove5e76f42016-05-03 16:15:36 +0100253ART_VALGRIND_TARGET_DEPENDENCIES := \
254 $(TARGET_OUT_EXECUTABLES)/valgrind \
255 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/memcheck-$(TARGET_ARCH)-linux \
256 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_core-$(TARGET_ARCH)-linux.so \
257 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_memcheck-$(TARGET_ARCH)-linux.so \
258 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/default.supp
259
260ifdef TARGET_2ND_ARCH
261ART_VALGRIND_TARGET_DEPENDENCIES += \
262 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/memcheck-$(TARGET_2ND_ARCH)-linux \
263 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_core-$(TARGET_2ND_ARCH)-linux.so \
264 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_memcheck-$(TARGET_2ND_ARCH)-linux.so
265endif
266
267include $(CLEAR_VARS)
268LOCAL_MODULE := valgrind-target-suppressions.txt
269LOCAL_MODULE_CLASS := ETC
270LOCAL_MODULE_TAGS := optional
271LOCAL_SRC_FILES := test/valgrind-target-suppressions.txt
272LOCAL_MODULE_PATH := $(ART_TARGET_TEST_OUT)
273include $(BUILD_PREBUILT)
274
Ian Rogersafd9acc2014-06-17 08:21:54 -0700275# Define a make rule for a target device gtest.
276# $(1): gtest name - the name of the test we're building such as leb128_test.
Colin Cross6e95dd52016-09-12 15:37:10 -0700277# $(2): path relative to $OUT to the test binary
278# $(3): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
279# $(4): LD_LIBRARY_PATH or undefined - used in case libartd.so is not in /system/lib/
Ian Rogersafd9acc2014-06-17 08:21:54 -0700280define define-art-gtest-rule-target
Colin Cross6e95dd52016-09-12 15:37:10 -0700281 gtest_rule := test-art-target-gtest-$(1)$$($(3)ART_PHONY_TEST_TARGET_SUFFIX)
282 gtest_exe := $(OUT_DIR)/$(2)
283 gtest_target_exe := $$(patsubst $(PRODUCT_OUT)/%,/%,$$(gtest_exe))
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700284
Brian Carlstrom532714a2014-06-25 02:15:31 -0700285 # Add the test dependencies to test-art-target-sync, which will be a prerequisite for the test
Ian Rogersafd9acc2014-06-17 08:21:54 -0700286 # to ensure files are pushed to the device.
287 TEST_ART_TARGET_SYNC_DEPS += \
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700288 $$(ART_GTEST_$(1)_TARGET_DEPS) \
Ian Rogers1a2f84e2014-07-07 16:05:18 -0700289 $(foreach file,$(ART_GTEST_$(1)_DEX_DEPS),$(ART_TEST_TARGET_GTEST_$(file)_DEX)) \
Colin Cross6e95dd52016-09-12 15:37:10 -0700290 $$(gtest_exe) \
291 $$($(3)TARGET_OUT_SHARED_LIBRARIES)/libjavacore.so \
292 $$($(3)TARGET_OUT_SHARED_LIBRARIES)/libopenjdkd.so \
Andreas Gampec7d4a582015-09-30 11:52:02 -0700293 $$(TARGET_OUT_JAVA_LIBRARIES)/core-libart-testdex.jar \
Anton Kirilove5e76f42016-05-03 16:15:36 +0100294 $$(TARGET_OUT_JAVA_LIBRARIES)/core-oj-testdex.jar \
295 $$(ART_TARGET_TEST_OUT)/valgrind-target-suppressions.txt
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700296
Colin Cross6e95dd52016-09-12 15:37:10 -0700297$$(gtest_rule) valgrind-$$(gtest_rule): PRIVATE_TARGET_EXE := $$(gtest_target_exe)
298
Ian Rogersafd9acc2014-06-17 08:21:54 -0700299.PHONY: $$(gtest_rule)
300$$(gtest_rule): test-art-target-sync
Colin Cross6e95dd52016-09-12 15:37:10 -0700301 $(hide) adb shell touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID
302 $(hide) adb shell rm $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID
303 $(hide) adb shell chmod 755 $$(PRIVATE_TARGET_EXE)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700304 $(hide) $$(call ART_TEST_SKIP,$$@) && \
Colin Cross6e95dd52016-09-12 15:37:10 -0700305 (adb shell "$(GCOV_ENV) LD_LIBRARY_PATH=$(4) ANDROID_ROOT=$(ART_GTEST_TARGET_ANDROID_ROOT) \
306 $$(PRIVATE_TARGET_EXE) && touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID" \
307 && (adb pull $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID /tmp/ \
Ian Rogersafd9acc2014-06-17 08:21:54 -0700308 && $$(call ART_TEST_PASSED,$$@)) \
309 || $$(call ART_TEST_FAILED,$$@))
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700310 $(hide) rm -f /tmp/$$@-$$$$PPID
Ian Rogersafd9acc2014-06-17 08:21:54 -0700311
Colin Cross6e95dd52016-09-12 15:37:10 -0700312 ART_TEST_TARGET_GTEST$($(3)ART_PHONY_TEST_TARGET_SUFFIX)_RULES += $$(gtest_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700313 ART_TEST_TARGET_GTEST_RULES += $$(gtest_rule)
314 ART_TEST_TARGET_GTEST_$(1)_RULES += $$(gtest_rule)
315
Anton Kirilove5e76f42016-05-03 16:15:36 +0100316.PHONY: valgrind-$$(gtest_rule)
317valgrind-$$(gtest_rule): $(ART_VALGRIND_TARGET_DEPENDENCIES) test-art-target-sync
Colin Cross6e95dd52016-09-12 15:37:10 -0700318 $(hide) adb shell touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID
319 $(hide) adb shell rm $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID
320 $(hide) adb shell chmod 755 $$(PRIVATE_TARGET_EXE)
Anton Kirilove5e76f42016-05-03 16:15:36 +0100321 $(hide) $$(call ART_TEST_SKIP,$$@) && \
Colin Cross6e95dd52016-09-12 15:37:10 -0700322 (adb shell "$(GCOV_ENV) LD_LIBRARY_PATH=$(4) ANDROID_ROOT=$(ART_GTEST_TARGET_ANDROID_ROOT) \
Anton Kirilove5e76f42016-05-03 16:15:36 +0100323 valgrind --leak-check=full --error-exitcode=1 --workaround-gcc296-bugs=yes \
324 --suppressions=$(ART_TARGET_TEST_DIR)/valgrind-target-suppressions.txt \
Andreas Gampebf13e802016-09-02 19:43:09 -0700325 --num-callers=50 \
Colin Cross6e95dd52016-09-12 15:37:10 -0700326 $$(PRIVATE_TARGET_EXE) && touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID" \
327 && (adb pull $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID /tmp/ \
Anton Kirilove5e76f42016-05-03 16:15:36 +0100328 && $$(call ART_TEST_PASSED,$$@)) \
329 || $$(call ART_TEST_FAILED,$$@))
330 $(hide) rm -f /tmp/$$@-$$$$PPID
331
Colin Cross6e95dd52016-09-12 15:37:10 -0700332 ART_TEST_TARGET_VALGRIND_GTEST$$($(3)ART_PHONY_TEST_TARGET_SUFFIX)_RULES += valgrind-$$(gtest_rule)
Anton Kirilove5e76f42016-05-03 16:15:36 +0100333 ART_TEST_TARGET_VALGRIND_GTEST_RULES += valgrind-$$(gtest_rule)
334 ART_TEST_TARGET_VALGRIND_GTEST_$(1)_RULES += valgrind-$$(gtest_rule)
335
Ian Rogersafd9acc2014-06-17 08:21:54 -0700336 # Clear locally defined variables.
Anton Kirilove5e76f42016-05-03 16:15:36 +0100337 valgrind_gtest_rule :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700338 gtest_rule :=
Colin Cross6e95dd52016-09-12 15:37:10 -0700339 gtest_exe :=
340 gtest_target_exe :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700341endef # define-art-gtest-rule-target
342
Andreas Gampe3c0bb312015-02-19 10:02:19 -0800343ART_VALGRIND_DEPENDENCIES := \
344 $(HOST_OUT_EXECUTABLES)/valgrind \
345 $(HOST_OUT)/lib64/valgrind/memcheck-amd64-linux \
346 $(HOST_OUT)/lib64/valgrind/memcheck-x86-linux \
347 $(HOST_OUT)/lib64/valgrind/default.supp \
348 $(HOST_OUT)/lib64/valgrind/vgpreload_core-amd64-linux.so \
349 $(HOST_OUT)/lib64/valgrind/vgpreload_core-x86-linux.so \
350 $(HOST_OUT)/lib64/valgrind/vgpreload_memcheck-amd64-linux.so \
351 $(HOST_OUT)/lib64/valgrind/vgpreload_memcheck-x86-linux.so
352
Ian Rogersafd9acc2014-06-17 08:21:54 -0700353# Define make rules for a host gtests.
354# $(1): gtest name - the name of the test we're building such as leb128_test.
Colin Cross6e95dd52016-09-12 15:37:10 -0700355# $(2): path relative to $OUT to the test binary
356# $(3): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700357define define-art-gtest-rule-host
Colin Cross6e95dd52016-09-12 15:37:10 -0700358 gtest_rule := test-art-host-gtest-$(1)$$($(3)ART_PHONY_TEST_HOST_SUFFIX)
359 gtest_exe := $(OUT_DIR)/$(2)
Ian Rogers665de8a2014-06-24 21:34:09 -0700360 # Dependencies for all host gtests.
361 gtest_deps := $$(HOST_CORE_DEX_LOCATIONS) \
Colin Cross6e95dd52016-09-12 15:37:10 -0700362 $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$$(ART_HOST_SHLIB_EXTENSION) \
363 $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$$(ART_HOST_SHLIB_EXTENSION) \
Nicolas Geoffray58035ae2015-05-27 19:10:27 +0100364 $$(gtest_exe) \
365 $$(ART_GTEST_$(1)_HOST_DEPS) \
366 $(foreach file,$(ART_GTEST_$(1)_DEX_DEPS),$(ART_TEST_HOST_GTEST_$(file)_DEX))
Ian Rogers665de8a2014-06-24 21:34:09 -0700367
Nicolas Geoffray58035ae2015-05-27 19:10:27 +0100368 ART_TEST_HOST_GTEST_DEPENDENCIES += $$(gtest_deps)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700369
370.PHONY: $$(gtest_rule)
Nicolas Geoffray0f7c06d2015-05-28 10:21:03 +0100371$$(gtest_rule): $$(gtest_exe) $$(gtest_deps)
Dmitriy Ivanov8508a432014-10-14 11:38:46 -0700372 $(hide) ($$(call ART_TEST_SKIP,$$@) && $$< && $$(call ART_TEST_PASSED,$$@)) \
Ian Rogersafd9acc2014-06-17 08:21:54 -0700373 || $$(call ART_TEST_FAILED,$$@)
374
Colin Cross6e95dd52016-09-12 15:37:10 -0700375 ART_TEST_HOST_GTEST$$($(3)ART_PHONY_TEST_HOST_SUFFIX)_RULES += $$(gtest_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700376 ART_TEST_HOST_GTEST_RULES += $$(gtest_rule)
377 ART_TEST_HOST_GTEST_$(1)_RULES += $$(gtest_rule)
378
Andreas Gampe3c0bb312015-02-19 10:02:19 -0800379
Ian Rogersafd9acc2014-06-17 08:21:54 -0700380.PHONY: valgrind-$$(gtest_rule)
Andreas Gampe3db36002015-05-28 20:17:09 -0700381valgrind-$$(gtest_rule): $$(gtest_exe) $$(gtest_deps) $(ART_VALGRIND_DEPENDENCIES)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700382 $(hide) $$(call ART_TEST_SKIP,$$@) && \
Andreas Gampe8df91ac2015-02-20 13:15:15 -0800383 VALGRIND_LIB=$(HOST_OUT)/lib64/valgrind \
Hiroshi Yamauchidc15e892016-03-10 13:49:14 -0800384 $(HOST_OUT_EXECUTABLES)/valgrind --leak-check=full --error-exitcode=1 \
Andreas Gampebf13e802016-09-02 19:43:09 -0700385 --suppressions=art/test/valgrind-suppressions.txt --num-callers=50 \
386 $$< && \
Andreas Gampe3c0bb312015-02-19 10:02:19 -0800387 $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700388
Colin Cross6e95dd52016-09-12 15:37:10 -0700389 ART_TEST_HOST_VALGRIND_GTEST$$($(3)ART_PHONY_TEST_HOST_SUFFIX)_RULES += valgrind-$$(gtest_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700390 ART_TEST_HOST_VALGRIND_GTEST_RULES += valgrind-$$(gtest_rule)
391 ART_TEST_HOST_VALGRIND_GTEST_$(1)_RULES += valgrind-$$(gtest_rule)
392
393 # Clear locally defined variables.
394 valgrind_gtest_rule :=
395 gtest_rule :=
396 gtest_exe :=
Ian Rogers665de8a2014-06-24 21:34:09 -0700397 gtest_deps :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700398endef # define-art-gtest-rule-host
399
400# Define the rules to build and run host and target gtests.
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100401# $(1): file name
402# $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
403define define-art-gtest-target
404 art_gtest_filename := $(1)
Brian Carlstrom0796af02011-10-12 14:31:45 -0700405
Ian Rogersafd9acc2014-06-17 08:21:54 -0700406 include $$(CLEAR_VARS)
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -0700407 art_gtest_name := $$(notdir $$(basename $$(art_gtest_filename)))
Colin Cross6e95dd52016-09-12 15:37:10 -0700408
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100409 library_path :=
410 2ND_library_path :=
411 ifneq ($$(ART_TEST_ANDROID_ROOT),)
412 ifdef TARGET_2ND_ARCH
413 2ND_library_path := $$(ART_TEST_ANDROID_ROOT)/lib
414 library_path := $$(ART_TEST_ANDROID_ROOT)/lib64
415 else
416 ifneq ($(filter %64,$(TARGET_ARCH)),)
Nicolas Geoffray9eb40742014-10-29 22:38:53 +0000417 library_path := $$(ART_TEST_ANDROID_ROOT)/lib64
418 else
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100419 library_path := $$(ART_TEST_ANDROID_ROOT)/lib
Nicolas Geoffray9eb40742014-10-29 22:38:53 +0000420 endif
421 endif
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100422 endif
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -0700423
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100424 ifndef ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700425 ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES :=
Anton Kirilove5e76f42016-05-03 16:15:36 +0100426 ART_TEST_TARGET_VALGRIND_GTEST_$$(art_gtest_name)_RULES :=
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100427 endif
428 $$(eval $$(call define-art-gtest-rule-target,$$(art_gtest_name),$$(art_gtest_filename),$(2),$$($(2)library_path)))
429
430 # Clear locally defined variables.
431 art_gtest_filename :=
432 art_gtest_name :=
433 library_path :=
434 2ND_library_path :=
435endef # define-art-gtest-target
436
437# $(1): file name
438# $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
439define define-art-gtest-host
440 art_gtest_filename := $(1)
441
442 include $$(CLEAR_VARS)
443 art_gtest_name := $$(notdir $$(basename $$(art_gtest_filename)))
444 ifndef ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES
445 ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES :=
446 ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES :=
447 endif
448 $$(eval $$(call define-art-gtest-rule-host,$$(art_gtest_name),$$(art_gtest_filename),$(2)))
449
450 # Clear locally defined variables.
451 art_gtest_filename :=
452 art_gtest_name :=
453endef # define-art-gtest-host
454
455# Define the rules to build and run gtests for both archs on target.
456# $(1): test name
457define define-art-gtest-target-both
458 art_gtest_name := $(1)
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700459
Ian Rogersafd9acc2014-06-17 08:21:54 -0700460 # A rule to run the different architecture versions of the gtest.
461.PHONY: test-art-target-gtest-$$(art_gtest_name)
462test-art-target-gtest-$$(art_gtest_name): $$(ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES)
463 $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
464
Anton Kirilove5e76f42016-05-03 16:15:36 +0100465.PHONY: valgrind-test-art-target-gtest-$$(art_gtest_name)
466valgrind-test-art-target-gtest-$$(art_gtest_name): $$(ART_TEST_TARGET_VALGRIND_GTEST_$$(art_gtest_name)_RULES)
467 $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
468
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100469 # Clear now unused variables.
470 ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES :=
471 ART_TEST_TARGET_VALGRIND_GTEST_$$(art_gtest_name)_RULES :=
472 art_gtest_name :=
473endef # define-art-gtest-target-both
Ian Rogersd912e5c2013-11-13 12:40:11 -0800474
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100475# Define the rules to build and run gtests for both archs on host.
476# $(1): test name
477define define-art-gtest-host-both
478 art_gtest_name := $(1)
479
Ian Rogersafd9acc2014-06-17 08:21:54 -0700480.PHONY: test-art-host-gtest-$$(art_gtest_name)
481test-art-host-gtest-$$(art_gtest_name): $$(ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES)
482 $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
Ian Rogersd912e5c2013-11-13 12:40:11 -0800483
Ian Rogersafd9acc2014-06-17 08:21:54 -0700484.PHONY: valgrind-test-art-host-gtest-$$(art_gtest_name)
485valgrind-test-art-host-gtest-$$(art_gtest_name): $$(ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES)
486 $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
487
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100488 # Clear now unused variables.
489 ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES :=
490 ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700491 art_gtest_name :=
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100492endef # define-art-gtest-host-both
Alex Light50fa9932015-08-10 15:30:07 -0700493
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700494ifeq ($(ART_BUILD_TARGET),true)
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100495 $(foreach file,$(ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest-target,$(file),)))
496 ifdef TARGET_2ND_ARCH
497 $(foreach file,$(2ND_ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest-target,$(file),2ND_)))
498 endif
499 # Rules to run the different architecture versions of the gtest.
500 $(foreach file,$(ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest-target-both,$$(notdir $$(basename $$(file))))))
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700501endif
Ian Rogersc5f17732014-06-05 20:48:42 -0700502ifeq ($(ART_BUILD_HOST),true)
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100503 $(foreach file,$(ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host,$(file),)))
504 ifneq ($(HOST_PREFER_32_BIT),true)
505 $(foreach file,$(2ND_ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host,$(file),2ND_)))
506 endif
507 # Rules to run the different architecture versions of the gtest.
508 $(foreach file,$(ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host-both,$$(notdir $$(basename $$(file))))))
Brian Carlstrom07d579f2011-07-27 13:31:51 -0700509endif
Tsu Chiang Chuangec245a42014-05-15 21:16:21 -0700510
511# Used outside the art project to get a list of the current tests
512RUNTIME_TARGET_GTEST_MAKE_TARGETS :=
Colin Cross6e95dd52016-09-12 15:37:10 -0700513$(foreach file, $(ART_TARGET_GTEST_FILES), $(eval RUNTIME_TARGET_GTEST_MAKE_TARGETS += $$(notdir $$(basename $$(file)))))
Tsu Chiang Chuangec245a42014-05-15 21:16:21 -0700514COMPILER_TARGET_GTEST_MAKE_TARGETS :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700515
516# Define all the combinations of host/target, valgrind and suffix such as:
517# test-art-host-gtest or valgrind-test-art-host-gtest64
518# $(1): host or target
519# $(2): HOST or TARGET
520# $(3): valgrind- or undefined
521# $(4): undefined, 32 or 64
522define define-test-art-gtest-combination
523 ifeq ($(1),host)
524 ifneq ($(2),HOST)
525 $$(error argument mismatch $(1) and ($2))
526 endif
527 else
528 ifneq ($(1),target)
529 $$(error found $(1) expected host or target)
530 endif
531 ifneq ($(2),TARGET)
532 $$(error argument mismatch $(1) and ($2))
533 endif
534 endif
535
536 rule_name := $(3)test-art-$(1)-gtest$(4)
Andreas Gampe928f72b2014-09-09 19:53:48 -0700537 ifeq ($(3),valgrind-)
Andreas Gampe928f72b2014-09-09 19:53:48 -0700538 dependencies := $$(ART_TEST_$(2)_VALGRIND_GTEST$(4)_RULES)
539 else
540 dependencies := $$(ART_TEST_$(2)_GTEST$(4)_RULES)
541 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700542
543.PHONY: $$(rule_name)
544$$(rule_name): $$(dependencies)
545 $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
546
547 # Clear locally defined variables.
548 rule_name :=
549 dependencies :=
550endef # define-test-art-gtest-combination
551
552$(eval $(call define-test-art-gtest-combination,target,TARGET,,))
Anton Kirilove5e76f42016-05-03 16:15:36 +0100553$(eval $(call define-test-art-gtest-combination,target,TARGET,valgrind-,))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700554$(eval $(call define-test-art-gtest-combination,target,TARGET,,$(ART_PHONY_TEST_TARGET_SUFFIX)))
Anton Kirilove5e76f42016-05-03 16:15:36 +0100555$(eval $(call define-test-art-gtest-combination,target,TARGET,valgrind-,$(ART_PHONY_TEST_TARGET_SUFFIX)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700556ifdef TARGET_2ND_ARCH
557$(eval $(call define-test-art-gtest-combination,target,TARGET,,$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)))
Anton Kirilove5e76f42016-05-03 16:15:36 +0100558$(eval $(call define-test-art-gtest-combination,target,TARGET,valgrind-,$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700559endif
560$(eval $(call define-test-art-gtest-combination,host,HOST,,))
561$(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,))
562$(eval $(call define-test-art-gtest-combination,host,HOST,,$(ART_PHONY_TEST_HOST_SUFFIX)))
563$(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,$(ART_PHONY_TEST_HOST_SUFFIX)))
564ifneq ($(HOST_PREFER_32_BIT),true)
565$(eval $(call define-test-art-gtest-combination,host,HOST,,$(2ND_ART_PHONY_TEST_HOST_SUFFIX)))
566$(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,$(2ND_ART_PHONY_TEST_HOST_SUFFIX)))
567endif
568
569# Clear locally defined variables.
570define-art-gtest-rule-target :=
571define-art-gtest-rule-host :=
572define-art-gtest :=
573define-test-art-gtest-combination :=
574RUNTIME_GTEST_COMMON_SRC_FILES :=
575COMPILER_GTEST_COMMON_SRC_FILES :=
576RUNTIME_GTEST_TARGET_SRC_FILES :=
577RUNTIME_GTEST_HOST_SRC_FILES :=
578COMPILER_GTEST_TARGET_SRC_FILES :=
579COMPILER_GTEST_HOST_SRC_FILES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700580ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
581ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
582ART_TEST_HOST_GTEST_RULES :=
583ART_TEST_HOST_VALGRIND_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
584ART_TEST_HOST_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
585ART_TEST_HOST_VALGRIND_GTEST_RULES :=
586ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
587ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
588ART_TEST_TARGET_GTEST_RULES :=
Anton Kirilove5e76f42016-05-03 16:15:36 +0100589ART_TEST_TARGET_VALGRIND_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
590ART_TEST_TARGET_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
591ART_TEST_TARGET_VALGRIND_GTEST_RULES :=
Nicolas Geoffray96a37c82014-10-29 23:50:40 +0000592ART_GTEST_TARGET_ANDROID_ROOT :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700593ART_GTEST_class_linker_test_DEX_DEPS :=
594ART_GTEST_compiler_driver_test_DEX_DEPS :=
595ART_GTEST_dex_file_test_DEX_DEPS :=
596ART_GTEST_exception_test_DEX_DEPS :=
597ART_GTEST_elf_writer_test_HOST_DEPS :=
598ART_GTEST_elf_writer_test_TARGET_DEPS :=
Andreas Gampea1ff30f2016-09-27 12:19:45 -0700599ART_GTEST_imtable_test_DEX_DEPS :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700600ART_GTEST_jni_compiler_test_DEX_DEPS :=
601ART_GTEST_jni_internal_test_DEX_DEPS :=
Richard Uhler66d874d2015-01-15 09:37:19 -0800602ART_GTEST_oat_file_assistant_test_DEX_DEPS :=
603ART_GTEST_oat_file_assistant_test_HOST_DEPS :=
604ART_GTEST_oat_file_assistant_test_TARGET_DEPS :=
Andreas Gampee1459ae2016-06-29 09:36:30 -0700605ART_GTEST_dex2oat_test_DEX_DEPS :=
606ART_GTEST_dex2oat_test_HOST_DEPS :=
607ART_GTEST_dex2oat_test_TARGET_DEPS :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700608ART_GTEST_object_test_DEX_DEPS :=
609ART_GTEST_proxy_test_DEX_DEPS :=
610ART_GTEST_reflection_test_DEX_DEPS :=
611ART_GTEST_stub_test_DEX_DEPS :=
612ART_GTEST_transaction_test_DEX_DEPS :=
Andreas Gampee1459ae2016-06-29 09:36:30 -0700613ART_GTEST_dex2oat_environment_tests_DEX_DEPS :=
David Brazdilca3c8c32016-09-06 14:04:48 +0100614ART_GTEST_verifier_deps_test_DEX_DEPS :=
Andreas Gampe3c0bb312015-02-19 10:02:19 -0800615ART_VALGRIND_DEPENDENCIES :=
Anton Kirilove5e76f42016-05-03 16:15:36 +0100616ART_VALGRIND_TARGET_DEPENDENCIES :=
Ian Rogers1a2f84e2014-07-07 16:05:18 -0700617$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_TARGET_GTEST_$(dir)_DEX :=))
618$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_HOST_GTEST_$(dir)_DEX :=))
Richard Uhler66d874d2015-01-15 09:37:19 -0800619ART_TEST_HOST_GTEST_MainStripped_DEX :=
620ART_TEST_TARGET_GTEST_MainStripped_DEX :=
David Brazdilca3c8c32016-09-06 14:04:48 +0100621ART_TEST_GTEST_VerifierDeps_SRC :=
622ART_TEST_HOST_GTEST_VerifierDeps_DEX :=
David Brazdilf906f122016-09-16 16:33:31 +0100623ART_TEST_TARGET_GTEST_VerifierDeps_DEX :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700624GTEST_DEX_DIRECTORIES :=
Brian Carlstrom532714a2014-06-25 02:15:31 -0700625LOCAL_PATH :=