blob: b3836f390d17247239cb6121f3a1acbf0906fe26 [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 \
Sebastien Hertz0462c4c2015-04-01 16:34:17 +020030 Instrumentation \
Ian Rogersafd9acc2014-06-17 08:21:54 -070031 Interfaces \
Artem Udovichenkod9786b02015-10-14 16:36:55 +030032 Lookup \
Ian Rogersafd9acc2014-06-17 08:21:54 -070033 Main \
Richard Uhler66d874d2015-01-15 09:37:19 -080034 MultiDex \
Richard Uhler67ff7d12015-05-14 13:21:13 -070035 MultiDexModifiedSecondary \
Ian Rogersafd9acc2014-06-17 08:21:54 -070036 MyClass \
37 MyClassNatives \
38 Nested \
39 NonStaticLeafMethods \
Mathieu Chartier279ac5c2016-09-08 17:34:25 -070040 Packages \
Ian Rogersafd9acc2014-06-17 08:21:54 -070041 ProtoCompare \
42 ProtoCompare2 \
Calin Juravle877fd962016-01-05 14:29:29 +000043 ProfileTestMultiDex \
Ian Rogersafd9acc2014-06-17 08:21:54 -070044 StaticLeafMethods \
45 Statics \
46 StaticsFromCode \
47 Transaction \
48 XandY
49
50# Create build rules for each dex file recording the dependency.
51$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval $(call build-art-test-dex,art-gtest,$(dir), \
Ian Rogers1a2f84e2014-07-07 16:05:18 -070052 $(ART_TARGET_NATIVETEST_OUT),art/build/Android.gtest.mk,ART_TEST_TARGET_GTEST_$(dir)_DEX, \
53 ART_TEST_HOST_GTEST_$(dir)_DEX)))
Ian Rogersafd9acc2014-06-17 08:21:54 -070054
Richard Uhler66d874d2015-01-15 09:37:19 -080055# Create rules for MainStripped, a copy of Main with the classes.dex stripped
56# for the oat file assistant tests.
57ART_TEST_HOST_GTEST_MainStripped_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
58ART_TEST_TARGET_GTEST_MainStripped_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
59
60$(ART_TEST_HOST_GTEST_MainStripped_DEX): $(ART_TEST_HOST_GTEST_Main_DEX)
61 cp $< $@
62 $(call dexpreopt-remove-classes.dex,$@)
63
64$(ART_TEST_TARGET_GTEST_MainStripped_DEX): $(ART_TEST_TARGET_GTEST_Main_DEX)
65 cp $< $@
66 $(call dexpreopt-remove-classes.dex,$@)
67
David Brazdilca3c8c32016-09-06 14:04:48 +010068ART_TEST_GTEST_VerifierDeps_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifierDeps/*.smali))
69ART_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 +010070ART_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 +010071
72$(ART_TEST_HOST_GTEST_VerifierDeps_DEX): $(ART_TEST_GTEST_VerifierDeps_SRC) $(HOST_OUT_EXECUTABLES)/smali
73 $(HOST_OUT_EXECUTABLES)/smali --output=$@ $(filter %.smali,$^)
74
David Brazdilf906f122016-09-16 16:33:31 +010075$(ART_TEST_TARGET_GTEST_VerifierDeps_DEX): $(ART_TEST_GTEST_VerifierDeps_SRC) $(HOST_OUT_EXECUTABLES)/smali
76 $(HOST_OUT_EXECUTABLES)/smali --output=$@ $(filter %.smali,$^)
77
Ian Rogersafd9acc2014-06-17 08:21:54 -070078# Dex file dependencies for each gtest.
Andreas Gampee1459ae2016-06-29 09:36:30 -070079ART_GTEST_dex2oat_environment_tests_DEX_DEPS := Main MainStripped MultiDex MultiDexModifiedSecondary Nested
80
Andreas Gampe81c6f8d2015-03-25 17:19:53 -070081ART_GTEST_class_linker_test_DEX_DEPS := Interfaces MultiDex MyClass Nested Statics StaticsFromCode
Calin Juravle877fd962016-01-05 14:29:29 +000082ART_GTEST_compiler_driver_test_DEX_DEPS := AbstractMethod StaticLeafMethods ProfileTestMultiDex
Mathieu Chartier279ac5c2016-09-08 17:34:25 -070083ART_GTEST_dex_cache_test_DEX_DEPS := Main Packages
Andreas Gampeda823442014-11-03 15:36:53 -080084ART_GTEST_dex_file_test_DEX_DEPS := GetMethodSignature Main Nested
Andreas Gampe7adeda82016-07-25 08:27:35 -070085ART_GTEST_dex2oat_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) Statics
Brian Carlstromeb85f2b2014-06-25 13:23:00 -070086ART_GTEST_exception_test_DEX_DEPS := ExceptionHandle
Sebastien Hertz0462c4c2015-04-01 16:34:17 +020087ART_GTEST_instrumentation_test_DEX_DEPS := Instrumentation
Brian Carlstromeb85f2b2014-06-25 13:23:00 -070088ART_GTEST_jni_compiler_test_DEX_DEPS := MyClassNatives
89ART_GTEST_jni_internal_test_DEX_DEPS := AllFields StaticLeafMethods
Andreas Gampee1459ae2016-06-29 09:36:30 -070090ART_GTEST_oat_file_assistant_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS)
Andreas Gampe7848da42015-04-09 11:15:04 -070091ART_GTEST_oat_file_test_DEX_DEPS := Main MultiDex
Mathieu Chartier07ddb6f2015-11-05 11:16:34 -080092ART_GTEST_oat_test_DEX_DEPS := Main
Brian Carlstromeb85f2b2014-06-25 13:23:00 -070093ART_GTEST_object_test_DEX_DEPS := ProtoCompare ProtoCompare2 StaticsFromCode XandY
94ART_GTEST_proxy_test_DEX_DEPS := Interfaces
95ART_GTEST_reflection_test_DEX_DEPS := Main NonStaticLeafMethods StaticLeafMethods
Calin Juravle877fd962016-01-05 14:29:29 +000096ART_GTEST_profile_assistant_test_DEX_DEPS := ProfileTestMultiDex
97ART_GTEST_profile_compilation_info_test_DEX_DEPS := ProfileTestMultiDex
Brian Carlstromeb85f2b2014-06-25 13:23:00 -070098ART_GTEST_stub_test_DEX_DEPS := AllFields
99ART_GTEST_transaction_test_DEX_DEPS := Transaction
Artem Udovichenkod9786b02015-10-14 16:36:55 +0300100ART_GTEST_type_lookup_table_test_DEX_DEPS := Lookup
David Brazdilca3c8c32016-09-06 14:04:48 +0100101ART_GTEST_verifier_deps_test_DEX_DEPS := VerifierDeps
Ian Rogersafd9acc2014-06-17 08:21:54 -0700102
103# The elf writer test has dependencies on core.oat.
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000104ART_GTEST_elf_writer_test_HOST_DEPS := $(HOST_CORE_IMAGE_optimizing_no-pic_64) $(HOST_CORE_IMAGE_optimizing_no-pic_32)
105ART_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 -0800106
Andreas Gampee1459ae2016-06-29 09:36:30 -0700107ART_GTEST_dex2oat_environment_tests_HOST_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000108 $(HOST_CORE_IMAGE_optimizing_pic_64) \
109 $(HOST_CORE_IMAGE_optimizing_pic_32) \
Richard Uhlerf51ac422016-07-08 09:22:33 -0700110 $(HOST_OUT_EXECUTABLES)/patchoatd
Andreas Gampee1459ae2016-06-29 09:36:30 -0700111ART_GTEST_dex2oat_environment_tests_TARGET_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000112 $(TARGET_CORE_IMAGE_optimizing_pic_64) \
113 $(TARGET_CORE_IMAGE_optimizing_pic_32) \
Richard Uhlerf51ac422016-07-08 09:22:33 -0700114 $(TARGET_OUT_EXECUTABLES)/patchoatd
Andreas Gampee1459ae2016-06-29 09:36:30 -0700115
116ART_GTEST_oat_file_assistant_test_HOST_DEPS := \
Richard Uhlerf51ac422016-07-08 09:22:33 -0700117 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS)
Andreas Gampee1459ae2016-06-29 09:36:30 -0700118ART_GTEST_oat_file_assistant_test_TARGET_DEPS := \
Richard Uhlerf51ac422016-07-08 09:22:33 -0700119 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS)
Andreas Gampee1459ae2016-06-29 09:36:30 -0700120
121
122ART_GTEST_dex2oat_test_HOST_DEPS := \
123 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS)
124ART_GTEST_dex2oat_test_TARGET_DEPS := \
125 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS)
Richard Uhler66d874d2015-01-15 09:37:19 -0800126
Brian Carlstrom53463ea2014-11-09 14:11:51 -0800127# TODO: document why this is needed.
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000128ART_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 -0700129
Aart Bikcfbe53c2015-07-06 14:27:27 -0700130# The dexdump test requires an image and the dexdump utility.
Aart Bik22c26f52015-07-08 21:20:13 +0000131# TODO: rename into dexdump when migration completes
Aart Bikcfbe53c2015-07-06 14:27:27 -0700132ART_GTEST_dexdump_test_HOST_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000133 $(HOST_CORE_IMAGE_optimizing_no-pic_64) \
134 $(HOST_CORE_IMAGE_optimizing_no-pic_32) \
Aart Bik22c26f52015-07-08 21:20:13 +0000135 $(HOST_OUT_EXECUTABLES)/dexdump2
Aart Bikcfbe53c2015-07-06 14:27:27 -0700136ART_GTEST_dexdump_test_TARGET_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000137 $(TARGET_CORE_IMAGE_optimizing_no-pic_64) \
138 $(TARGET_CORE_IMAGE_optimizing_no-pic_32) \
Aart Bik22c26f52015-07-08 21:20:13 +0000139 dexdump2
Aart Bikcfbe53c2015-07-06 14:27:27 -0700140
Jeff Haoc3acfc52016-08-29 14:18:26 -0700141# The dexlayout test requires an image and the dexlayout utility.
142# TODO: rename into dexdump when migration completes
143ART_GTEST_dexlayout_test_HOST_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000144 $(HOST_CORE_IMAGE_optimizing_no-pic_64) \
145 $(HOST_CORE_IMAGE_optimizing_no-pic_32) \
Jeff Haoc3acfc52016-08-29 14:18:26 -0700146 $(HOST_OUT_EXECUTABLES)/dexlayout \
147 $(HOST_OUT_EXECUTABLES)/dexdump2
148ART_GTEST_dexlayout_test_TARGET_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000149 $(TARGET_CORE_IMAGE_optimizing_no-pic_64) \
150 $(TARGET_CORE_IMAGE_optimizing_no-pic_32) \
Jeff Haoc3acfc52016-08-29 14:18:26 -0700151 dexlayout \
152 dexdump2
153
Aart Bik3e40f4a2015-07-07 17:09:41 -0700154# The dexlist test requires an image and the dexlist utility.
Aart Bik3e40f4a2015-07-07 17:09:41 -0700155ART_GTEST_dexlist_test_HOST_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000156 $(HOST_CORE_IMAGE_optimizing_no-pic_64) \
157 $(HOST_CORE_IMAGE_optimizing_no-pic_32) \
Aart Bikb1b45be2015-08-28 11:09:29 -0700158 $(HOST_OUT_EXECUTABLES)/dexlist
Aart Bik3e40f4a2015-07-07 17:09:41 -0700159ART_GTEST_dexlist_test_TARGET_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000160 $(TARGET_CORE_IMAGE_optimizing_no-pic_64) \
161 $(TARGET_CORE_IMAGE_optimizing_no-pic_32) \
Aart Bikb1b45be2015-08-28 11:09:29 -0700162 dexlist
Aart Bik3e40f4a2015-07-07 17:09:41 -0700163
Igor Murashkin37743352014-11-13 14:38:00 -0800164# The imgdiag test has dependencies on core.oat since it needs to load it during the test.
Andreas Gampec93b8b52014-12-19 23:12:25 -0800165# For the host, also add the installed tool (in the base size, that should suffice). For the
166# target, just the module is fine, the sync will happen late enough.
167ART_GTEST_imgdiag_test_HOST_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000168 $(HOST_CORE_IMAGE_optimizing_no-pic_64) \
169 $(HOST_CORE_IMAGE_optimizing_no-pic_32) \
Andreas Gampec93b8b52014-12-19 23:12:25 -0800170 $(HOST_OUT_EXECUTABLES)/imgdiagd
171ART_GTEST_imgdiag_test_TARGET_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000172 $(TARGET_CORE_IMAGE_optimizing_no-pic_64) \
173 $(TARGET_CORE_IMAGE_optimizing_no-pic_32) \
Andreas Gampec93b8b52014-12-19 23:12:25 -0800174 imgdiagd
Igor Murashkin37743352014-11-13 14:38:00 -0800175
Mathieu Chartierea216b32015-05-26 19:48:16 -0700176# Oatdump test requires an image and oatfile to dump.
177ART_GTEST_oatdump_test_HOST_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000178 $(HOST_CORE_IMAGE_optimizing_no-pic_64) \
179 $(HOST_CORE_IMAGE_optimizing_no-pic_32) \
Mathieu Chartierea216b32015-05-26 19:48:16 -0700180 $(HOST_OUT_EXECUTABLES)/oatdumpd
181ART_GTEST_oatdump_test_TARGET_DEPS := \
Nicolas Geoffrayb76bc782016-09-14 12:33:34 +0000182 $(TARGET_CORE_IMAGE_optimizing_no-pic_64) \
183 $(TARGET_CORE_IMAGE_optimizing_no-pic_32) \
Mathieu Chartierea216b32015-05-26 19:48:16 -0700184 oatdump
185
Calin Juravle2e2db782016-02-23 12:00:03 +0000186# Profile assistant tests requires profman utility.
187ART_GTEST_profile_assistant_test_HOST_DEPS := \
188 $(HOST_OUT_EXECUTABLES)/profmand
189ART_GTEST_profile_assistant_test_TARGET_DEPS := \
190 profman
191
Ian Rogersafd9acc2014-06-17 08:21:54 -0700192# The path for which all the source files are relative, not actually the current directory.
Brian Carlstrom7940e442013-07-12 13:46:57 -0700193LOCAL_PATH := art
194
Colin Cross6e95dd52016-09-12 15:37:10 -0700195ART_TEST_MODULES := \
196 art_cmdline_tests \
197 art_compiler_tests \
198 art_compiler_host_tests \
199 art_dex2oat_tests \
200 art_dexdump_tests \
201 art_dexlayout_tests \
202 art_dexlist_tests \
203 art_imgdiag_tests \
204 art_oatdump_tests \
205 art_profman_tests \
206 art_runtime_tests \
207 art_runtime_compiler_tests \
Brian Carlstroma1ce1fe2014-02-24 23:23:58 -0800208
Colin Cross6e95dd52016-09-12 15:37:10 -0700209ART_TARGET_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\
210 $(ART_TEST_LIST_device_$(TARGET_ARCH)_$(m)))
Alex Light50fa9932015-08-10 15:30:07 -0700211
Colin Cross6e95dd52016-09-12 15:37:10 -0700212ART_HOST_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\
Colin Cross124f8812016-09-15 20:57:47 -0700213 $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_$(m)))
Alex Light50fa9932015-08-10 15:30:07 -0700214
Shih-wei Liaoc4c98812012-03-10 21:55:51 -0800215ART_TEST_CFLAGS :=
buzbee2cfc6392012-05-07 14:51:40 -0700216
Ian Rogersafd9acc2014-06-17 08:21:54 -0700217# Variables holding collections of gtest pre-requisits used to run a number of gtests.
218ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
219ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
220ART_TEST_HOST_GTEST_RULES :=
221ART_TEST_HOST_VALGRIND_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
222ART_TEST_HOST_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
223ART_TEST_HOST_VALGRIND_GTEST_RULES :=
224ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
225ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
226ART_TEST_TARGET_GTEST_RULES :=
Anton Kirilove5e76f42016-05-03 16:15:36 +0100227ART_TEST_TARGET_VALGRIND_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
228ART_TEST_TARGET_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
229ART_TEST_TARGET_VALGRIND_GTEST_RULES :=
Nicolas Geoffray58035ae2015-05-27 19:10:27 +0100230ART_TEST_HOST_GTEST_DEPENDENCIES :=
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700231
Nicolas Geoffray96a37c82014-10-29 23:50:40 +0000232ART_GTEST_TARGET_ANDROID_ROOT := '/system'
233ifneq ($(ART_TEST_ANDROID_ROOT),)
234 ART_GTEST_TARGET_ANDROID_ROOT := $(ART_TEST_ANDROID_ROOT)
235endif
236
Anton Kirilove5e76f42016-05-03 16:15:36 +0100237ART_VALGRIND_TARGET_DEPENDENCIES := \
238 $(TARGET_OUT_EXECUTABLES)/valgrind \
239 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/memcheck-$(TARGET_ARCH)-linux \
240 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_core-$(TARGET_ARCH)-linux.so \
241 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_memcheck-$(TARGET_ARCH)-linux.so \
242 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/default.supp
243
244ifdef TARGET_2ND_ARCH
245ART_VALGRIND_TARGET_DEPENDENCIES += \
246 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/memcheck-$(TARGET_2ND_ARCH)-linux \
247 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_core-$(TARGET_2ND_ARCH)-linux.so \
248 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_memcheck-$(TARGET_2ND_ARCH)-linux.so
249endif
250
251include $(CLEAR_VARS)
252LOCAL_MODULE := valgrind-target-suppressions.txt
253LOCAL_MODULE_CLASS := ETC
254LOCAL_MODULE_TAGS := optional
255LOCAL_SRC_FILES := test/valgrind-target-suppressions.txt
256LOCAL_MODULE_PATH := $(ART_TARGET_TEST_OUT)
257include $(BUILD_PREBUILT)
258
Ian Rogersafd9acc2014-06-17 08:21:54 -0700259# Define a make rule for a target device gtest.
260# $(1): gtest name - the name of the test we're building such as leb128_test.
Colin Cross6e95dd52016-09-12 15:37:10 -0700261# $(2): path relative to $OUT to the test binary
262# $(3): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
263# $(4): LD_LIBRARY_PATH or undefined - used in case libartd.so is not in /system/lib/
Ian Rogersafd9acc2014-06-17 08:21:54 -0700264define define-art-gtest-rule-target
Colin Cross6e95dd52016-09-12 15:37:10 -0700265 gtest_rule := test-art-target-gtest-$(1)$$($(3)ART_PHONY_TEST_TARGET_SUFFIX)
266 gtest_exe := $(OUT_DIR)/$(2)
267 gtest_target_exe := $$(patsubst $(PRODUCT_OUT)/%,/%,$$(gtest_exe))
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700268
Brian Carlstrom532714a2014-06-25 02:15:31 -0700269 # Add the test dependencies to test-art-target-sync, which will be a prerequisite for the test
Ian Rogersafd9acc2014-06-17 08:21:54 -0700270 # to ensure files are pushed to the device.
271 TEST_ART_TARGET_SYNC_DEPS += \
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700272 $$(ART_GTEST_$(1)_TARGET_DEPS) \
Ian Rogers1a2f84e2014-07-07 16:05:18 -0700273 $(foreach file,$(ART_GTEST_$(1)_DEX_DEPS),$(ART_TEST_TARGET_GTEST_$(file)_DEX)) \
Colin Cross6e95dd52016-09-12 15:37:10 -0700274 $$(gtest_exe) \
275 $$($(3)TARGET_OUT_SHARED_LIBRARIES)/libjavacore.so \
276 $$($(3)TARGET_OUT_SHARED_LIBRARIES)/libopenjdkd.so \
Andreas Gampec7d4a582015-09-30 11:52:02 -0700277 $$(TARGET_OUT_JAVA_LIBRARIES)/core-libart-testdex.jar \
Anton Kirilove5e76f42016-05-03 16:15:36 +0100278 $$(TARGET_OUT_JAVA_LIBRARIES)/core-oj-testdex.jar \
279 $$(ART_TARGET_TEST_OUT)/valgrind-target-suppressions.txt
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700280
Colin Cross6e95dd52016-09-12 15:37:10 -0700281$$(gtest_rule) valgrind-$$(gtest_rule): PRIVATE_TARGET_EXE := $$(gtest_target_exe)
282
Ian Rogersafd9acc2014-06-17 08:21:54 -0700283.PHONY: $$(gtest_rule)
284$$(gtest_rule): test-art-target-sync
Colin Cross6e95dd52016-09-12 15:37:10 -0700285 $(hide) adb shell touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID
286 $(hide) adb shell rm $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID
287 $(hide) adb shell chmod 755 $$(PRIVATE_TARGET_EXE)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700288 $(hide) $$(call ART_TEST_SKIP,$$@) && \
Colin Cross6e95dd52016-09-12 15:37:10 -0700289 (adb shell "$(GCOV_ENV) LD_LIBRARY_PATH=$(4) ANDROID_ROOT=$(ART_GTEST_TARGET_ANDROID_ROOT) \
290 $$(PRIVATE_TARGET_EXE) && touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID" \
291 && (adb pull $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID /tmp/ \
Ian Rogersafd9acc2014-06-17 08:21:54 -0700292 && $$(call ART_TEST_PASSED,$$@)) \
293 || $$(call ART_TEST_FAILED,$$@))
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700294 $(hide) rm -f /tmp/$$@-$$$$PPID
Ian Rogersafd9acc2014-06-17 08:21:54 -0700295
Colin Cross6e95dd52016-09-12 15:37:10 -0700296 ART_TEST_TARGET_GTEST$($(3)ART_PHONY_TEST_TARGET_SUFFIX)_RULES += $$(gtest_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700297 ART_TEST_TARGET_GTEST_RULES += $$(gtest_rule)
298 ART_TEST_TARGET_GTEST_$(1)_RULES += $$(gtest_rule)
299
Anton Kirilove5e76f42016-05-03 16:15:36 +0100300.PHONY: valgrind-$$(gtest_rule)
301valgrind-$$(gtest_rule): $(ART_VALGRIND_TARGET_DEPENDENCIES) test-art-target-sync
Colin Cross6e95dd52016-09-12 15:37:10 -0700302 $(hide) adb shell touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID
303 $(hide) adb shell rm $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID
304 $(hide) adb shell chmod 755 $$(PRIVATE_TARGET_EXE)
Anton Kirilove5e76f42016-05-03 16:15:36 +0100305 $(hide) $$(call ART_TEST_SKIP,$$@) && \
Colin Cross6e95dd52016-09-12 15:37:10 -0700306 (adb shell "$(GCOV_ENV) LD_LIBRARY_PATH=$(4) ANDROID_ROOT=$(ART_GTEST_TARGET_ANDROID_ROOT) \
Anton Kirilove5e76f42016-05-03 16:15:36 +0100307 valgrind --leak-check=full --error-exitcode=1 --workaround-gcc296-bugs=yes \
308 --suppressions=$(ART_TARGET_TEST_DIR)/valgrind-target-suppressions.txt \
Andreas Gampebf13e802016-09-02 19:43:09 -0700309 --num-callers=50 \
Colin Cross6e95dd52016-09-12 15:37:10 -0700310 $$(PRIVATE_TARGET_EXE) && touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID" \
311 && (adb pull $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID /tmp/ \
Anton Kirilove5e76f42016-05-03 16:15:36 +0100312 && $$(call ART_TEST_PASSED,$$@)) \
313 || $$(call ART_TEST_FAILED,$$@))
314 $(hide) rm -f /tmp/$$@-$$$$PPID
315
Colin Cross6e95dd52016-09-12 15:37:10 -0700316 ART_TEST_TARGET_VALGRIND_GTEST$$($(3)ART_PHONY_TEST_TARGET_SUFFIX)_RULES += valgrind-$$(gtest_rule)
Anton Kirilove5e76f42016-05-03 16:15:36 +0100317 ART_TEST_TARGET_VALGRIND_GTEST_RULES += valgrind-$$(gtest_rule)
318 ART_TEST_TARGET_VALGRIND_GTEST_$(1)_RULES += valgrind-$$(gtest_rule)
319
Ian Rogersafd9acc2014-06-17 08:21:54 -0700320 # Clear locally defined variables.
Anton Kirilove5e76f42016-05-03 16:15:36 +0100321 valgrind_gtest_rule :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700322 gtest_rule :=
Colin Cross6e95dd52016-09-12 15:37:10 -0700323 gtest_exe :=
324 gtest_target_exe :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700325endef # define-art-gtest-rule-target
326
Andreas Gampe3c0bb312015-02-19 10:02:19 -0800327ART_VALGRIND_DEPENDENCIES := \
328 $(HOST_OUT_EXECUTABLES)/valgrind \
329 $(HOST_OUT)/lib64/valgrind/memcheck-amd64-linux \
330 $(HOST_OUT)/lib64/valgrind/memcheck-x86-linux \
331 $(HOST_OUT)/lib64/valgrind/default.supp \
332 $(HOST_OUT)/lib64/valgrind/vgpreload_core-amd64-linux.so \
333 $(HOST_OUT)/lib64/valgrind/vgpreload_core-x86-linux.so \
334 $(HOST_OUT)/lib64/valgrind/vgpreload_memcheck-amd64-linux.so \
335 $(HOST_OUT)/lib64/valgrind/vgpreload_memcheck-x86-linux.so
336
Ian Rogersafd9acc2014-06-17 08:21:54 -0700337# Define make rules for a host gtests.
338# $(1): gtest name - the name of the test we're building such as leb128_test.
Colin Cross6e95dd52016-09-12 15:37:10 -0700339# $(2): path relative to $OUT to the test binary
340# $(3): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700341define define-art-gtest-rule-host
Colin Cross6e95dd52016-09-12 15:37:10 -0700342 gtest_rule := test-art-host-gtest-$(1)$$($(3)ART_PHONY_TEST_HOST_SUFFIX)
343 gtest_exe := $(OUT_DIR)/$(2)
Ian Rogers665de8a2014-06-24 21:34:09 -0700344 # Dependencies for all host gtests.
345 gtest_deps := $$(HOST_CORE_DEX_LOCATIONS) \
Colin Cross6e95dd52016-09-12 15:37:10 -0700346 $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$$(ART_HOST_SHLIB_EXTENSION) \
347 $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$$(ART_HOST_SHLIB_EXTENSION) \
Nicolas Geoffray58035ae2015-05-27 19:10:27 +0100348 $$(gtest_exe) \
349 $$(ART_GTEST_$(1)_HOST_DEPS) \
350 $(foreach file,$(ART_GTEST_$(1)_DEX_DEPS),$(ART_TEST_HOST_GTEST_$(file)_DEX))
Ian Rogers665de8a2014-06-24 21:34:09 -0700351
Nicolas Geoffray58035ae2015-05-27 19:10:27 +0100352 ART_TEST_HOST_GTEST_DEPENDENCIES += $$(gtest_deps)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700353
354.PHONY: $$(gtest_rule)
Nicolas Geoffray0f7c06d2015-05-28 10:21:03 +0100355$$(gtest_rule): $$(gtest_exe) $$(gtest_deps)
Dmitriy Ivanov8508a432014-10-14 11:38:46 -0700356 $(hide) ($$(call ART_TEST_SKIP,$$@) && $$< && $$(call ART_TEST_PASSED,$$@)) \
Ian Rogersafd9acc2014-06-17 08:21:54 -0700357 || $$(call ART_TEST_FAILED,$$@)
358
Colin Cross6e95dd52016-09-12 15:37:10 -0700359 ART_TEST_HOST_GTEST$$($(3)ART_PHONY_TEST_HOST_SUFFIX)_RULES += $$(gtest_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700360 ART_TEST_HOST_GTEST_RULES += $$(gtest_rule)
361 ART_TEST_HOST_GTEST_$(1)_RULES += $$(gtest_rule)
362
Andreas Gampe3c0bb312015-02-19 10:02:19 -0800363
Ian Rogersafd9acc2014-06-17 08:21:54 -0700364.PHONY: valgrind-$$(gtest_rule)
Andreas Gampe3db36002015-05-28 20:17:09 -0700365valgrind-$$(gtest_rule): $$(gtest_exe) $$(gtest_deps) $(ART_VALGRIND_DEPENDENCIES)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700366 $(hide) $$(call ART_TEST_SKIP,$$@) && \
Andreas Gampe8df91ac2015-02-20 13:15:15 -0800367 VALGRIND_LIB=$(HOST_OUT)/lib64/valgrind \
Hiroshi Yamauchidc15e892016-03-10 13:49:14 -0800368 $(HOST_OUT_EXECUTABLES)/valgrind --leak-check=full --error-exitcode=1 \
Andreas Gampebf13e802016-09-02 19:43:09 -0700369 --suppressions=art/test/valgrind-suppressions.txt --num-callers=50 \
370 $$< && \
Andreas Gampe3c0bb312015-02-19 10:02:19 -0800371 $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700372
Colin Cross6e95dd52016-09-12 15:37:10 -0700373 ART_TEST_HOST_VALGRIND_GTEST$$($(3)ART_PHONY_TEST_HOST_SUFFIX)_RULES += valgrind-$$(gtest_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700374 ART_TEST_HOST_VALGRIND_GTEST_RULES += valgrind-$$(gtest_rule)
375 ART_TEST_HOST_VALGRIND_GTEST_$(1)_RULES += valgrind-$$(gtest_rule)
376
377 # Clear locally defined variables.
378 valgrind_gtest_rule :=
379 gtest_rule :=
380 gtest_exe :=
Ian Rogers665de8a2014-06-24 21:34:09 -0700381 gtest_deps :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700382endef # define-art-gtest-rule-host
383
384# Define the rules to build and run host and target gtests.
Brian Carlstrom07d579f2011-07-27 13:31:51 -0700385# $(1): target or host
Brian Carlstrom0796af02011-10-12 14:31:45 -0700386# $(2): file name
Ian Rogersafd9acc2014-06-17 08:21:54 -0700387define define-art-gtest
Brian Carlstrom0796af02011-10-12 14:31:45 -0700388 ifneq ($(1),target)
389 ifneq ($(1),host)
390 $$(error expected target or host for argument 1, received $(1))
391 endif
392 endif
393
394 art_target_or_host := $(1)
395 art_gtest_filename := $(2)
396
Ian Rogersafd9acc2014-06-17 08:21:54 -0700397 include $$(CLEAR_VARS)
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -0700398 art_gtest_name := $$(notdir $$(basename $$(art_gtest_filename)))
Colin Cross6e95dd52016-09-12 15:37:10 -0700399
Brian Carlstrom871599a2012-09-06 13:27:49 -0700400 ifeq ($$(art_target_or_host),target)
Nicolas Geoffray9eb40742014-10-29 22:38:53 +0000401 library_path :=
402 2nd_library_path :=
403 ifneq ($$(ART_TEST_ANDROID_ROOT),)
404 ifdef TARGET_2ND_ARCH
405 2nd_library_path := $$(ART_TEST_ANDROID_ROOT)/lib
406 library_path := $$(ART_TEST_ANDROID_ROOT)/lib64
407 else
Nicolas Geoffrayc1dea4a2014-11-10 08:33:52 +0000408 ifneq ($(filter %64,$(TARGET_ARCH)),)
409 library_path := $$(ART_TEST_ANDROID_ROOT)/lib64
410 else
411 library_path := $$(ART_TEST_ANDROID_ROOT)/lib
412 endif
Nicolas Geoffray9eb40742014-10-29 22:38:53 +0000413 endif
414 endif
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -0700415
Ian Rogersafd9acc2014-06-17 08:21:54 -0700416 ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES :=
Anton Kirilove5e76f42016-05-03 16:15:36 +0100417 ART_TEST_TARGET_VALGRIND_GTEST_$$(art_gtest_name)_RULES :=
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700418 ifdef TARGET_2ND_ARCH
Colin Cross6e95dd52016-09-12 15:37:10 -0700419 $$(eval $$(call define-art-gtest-rule-target,$$(art_gtest_name),$$(art_gtest_filename),2ND_,$$(2nd_library_path)))
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700420 endif
Colin Cross6e95dd52016-09-12 15:37:10 -0700421 $$(eval $$(call define-art-gtest-rule-target,$$(art_gtest_name),$$(art_gtest_filename),,$$(library_path)))
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700422
Ian Rogersafd9acc2014-06-17 08:21:54 -0700423 # A rule to run the different architecture versions of the gtest.
424.PHONY: test-art-target-gtest-$$(art_gtest_name)
425test-art-target-gtest-$$(art_gtest_name): $$(ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES)
426 $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
427
Anton Kirilove5e76f42016-05-03 16:15:36 +0100428.PHONY: valgrind-test-art-target-gtest-$$(art_gtest_name)
429valgrind-test-art-target-gtest-$$(art_gtest_name): $$(ART_TEST_TARGET_VALGRIND_GTEST_$$(art_gtest_name)_RULES)
430 $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
431
Ian Rogersafd9acc2014-06-17 08:21:54 -0700432 # Clear locally defined variables.
433 ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES :=
Anton Kirilove5e76f42016-05-03 16:15:36 +0100434 ART_TEST_TARGET_VALGRIND_GTEST_$$(art_gtest_name)_RULES :=
Brian Carlstrom0796af02011-10-12 14:31:45 -0700435 else # host
Ian Rogersafd9acc2014-06-17 08:21:54 -0700436 ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES :=
437 ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES :=
438 ifneq ($$(HOST_PREFER_32_BIT),true)
Colin Cross6e95dd52016-09-12 15:37:10 -0700439 $$(eval $$(call define-art-gtest-rule-host,$$(art_gtest_name),$$(art_gtest_filename),2ND_))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700440 endif
Colin Cross6e95dd52016-09-12 15:37:10 -0700441 $$(eval $$(call define-art-gtest-rule-host,$$(art_gtest_name),$$(art_gtest_filename),))
Ian Rogersd912e5c2013-11-13 12:40:11 -0800442
Ian Rogersafd9acc2014-06-17 08:21:54 -0700443 # Rules to run the different architecture versions of the gtest.
444.PHONY: test-art-host-gtest-$$(art_gtest_name)
445test-art-host-gtest-$$(art_gtest_name): $$(ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES)
446 $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
Ian Rogersd912e5c2013-11-13 12:40:11 -0800447
Ian Rogersafd9acc2014-06-17 08:21:54 -0700448.PHONY: valgrind-test-art-host-gtest-$$(art_gtest_name)
449valgrind-test-art-host-gtest-$$(art_gtest_name): $$(ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES)
450 $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
451
452 # Clear locally defined variables.
453 ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES :=
454 ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES :=
455 endif # host_or_target
456
457 # Clear locally defined variables.
458 art_target_or_host :=
459 art_gtest_filename :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700460 art_gtest_name :=
Nicolas Geoffray96a37c82014-10-29 23:50:40 +0000461 library_path :=
462 2nd_library_path :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700463endef # define-art-gtest
Carl Shapiro008e4122011-06-23 17:27:46 -0700464
Alex Light50fa9932015-08-10 15:30:07 -0700465
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700466ifeq ($(ART_BUILD_TARGET),true)
Colin Cross6e95dd52016-09-12 15:37:10 -0700467 $(foreach file,$(ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest,target,$(file))))
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700468endif
Ian Rogersc5f17732014-06-05 20:48:42 -0700469ifeq ($(ART_BUILD_HOST),true)
Colin Cross6e95dd52016-09-12 15:37:10 -0700470 $(foreach file,$(ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest,host,$(file))))
Brian Carlstrom07d579f2011-07-27 13:31:51 -0700471endif
Tsu Chiang Chuangec245a42014-05-15 21:16:21 -0700472
473# Used outside the art project to get a list of the current tests
474RUNTIME_TARGET_GTEST_MAKE_TARGETS :=
Colin Cross6e95dd52016-09-12 15:37:10 -0700475$(foreach file, $(ART_TARGET_GTEST_FILES), $(eval RUNTIME_TARGET_GTEST_MAKE_TARGETS += $$(notdir $$(basename $$(file)))))
Tsu Chiang Chuangec245a42014-05-15 21:16:21 -0700476COMPILER_TARGET_GTEST_MAKE_TARGETS :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700477
478# Define all the combinations of host/target, valgrind and suffix such as:
479# test-art-host-gtest or valgrind-test-art-host-gtest64
480# $(1): host or target
481# $(2): HOST or TARGET
482# $(3): valgrind- or undefined
483# $(4): undefined, 32 or 64
484define define-test-art-gtest-combination
485 ifeq ($(1),host)
486 ifneq ($(2),HOST)
487 $$(error argument mismatch $(1) and ($2))
488 endif
489 else
490 ifneq ($(1),target)
491 $$(error found $(1) expected host or target)
492 endif
493 ifneq ($(2),TARGET)
494 $$(error argument mismatch $(1) and ($2))
495 endif
496 endif
497
498 rule_name := $(3)test-art-$(1)-gtest$(4)
Andreas Gampe928f72b2014-09-09 19:53:48 -0700499 ifeq ($(3),valgrind-)
Andreas Gampe928f72b2014-09-09 19:53:48 -0700500 dependencies := $$(ART_TEST_$(2)_VALGRIND_GTEST$(4)_RULES)
501 else
502 dependencies := $$(ART_TEST_$(2)_GTEST$(4)_RULES)
503 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700504
505.PHONY: $$(rule_name)
506$$(rule_name): $$(dependencies)
507 $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
508
509 # Clear locally defined variables.
510 rule_name :=
511 dependencies :=
512endef # define-test-art-gtest-combination
513
514$(eval $(call define-test-art-gtest-combination,target,TARGET,,))
Anton Kirilove5e76f42016-05-03 16:15:36 +0100515$(eval $(call define-test-art-gtest-combination,target,TARGET,valgrind-,))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700516$(eval $(call define-test-art-gtest-combination,target,TARGET,,$(ART_PHONY_TEST_TARGET_SUFFIX)))
Anton Kirilove5e76f42016-05-03 16:15:36 +0100517$(eval $(call define-test-art-gtest-combination,target,TARGET,valgrind-,$(ART_PHONY_TEST_TARGET_SUFFIX)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700518ifdef TARGET_2ND_ARCH
519$(eval $(call define-test-art-gtest-combination,target,TARGET,,$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)))
Anton Kirilove5e76f42016-05-03 16:15:36 +0100520$(eval $(call define-test-art-gtest-combination,target,TARGET,valgrind-,$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700521endif
522$(eval $(call define-test-art-gtest-combination,host,HOST,,))
523$(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,))
524$(eval $(call define-test-art-gtest-combination,host,HOST,,$(ART_PHONY_TEST_HOST_SUFFIX)))
525$(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,$(ART_PHONY_TEST_HOST_SUFFIX)))
526ifneq ($(HOST_PREFER_32_BIT),true)
527$(eval $(call define-test-art-gtest-combination,host,HOST,,$(2ND_ART_PHONY_TEST_HOST_SUFFIX)))
528$(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,$(2ND_ART_PHONY_TEST_HOST_SUFFIX)))
529endif
530
531# Clear locally defined variables.
532define-art-gtest-rule-target :=
533define-art-gtest-rule-host :=
534define-art-gtest :=
535define-test-art-gtest-combination :=
536RUNTIME_GTEST_COMMON_SRC_FILES :=
537COMPILER_GTEST_COMMON_SRC_FILES :=
538RUNTIME_GTEST_TARGET_SRC_FILES :=
539RUNTIME_GTEST_HOST_SRC_FILES :=
540COMPILER_GTEST_TARGET_SRC_FILES :=
541COMPILER_GTEST_HOST_SRC_FILES :=
542ART_TEST_CFLAGS :=
543ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
544ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
545ART_TEST_HOST_GTEST_RULES :=
546ART_TEST_HOST_VALGRIND_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
547ART_TEST_HOST_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
548ART_TEST_HOST_VALGRIND_GTEST_RULES :=
549ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
550ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
551ART_TEST_TARGET_GTEST_RULES :=
Anton Kirilove5e76f42016-05-03 16:15:36 +0100552ART_TEST_TARGET_VALGRIND_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
553ART_TEST_TARGET_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
554ART_TEST_TARGET_VALGRIND_GTEST_RULES :=
Nicolas Geoffray96a37c82014-10-29 23:50:40 +0000555ART_GTEST_TARGET_ANDROID_ROOT :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700556ART_GTEST_class_linker_test_DEX_DEPS :=
557ART_GTEST_compiler_driver_test_DEX_DEPS :=
558ART_GTEST_dex_file_test_DEX_DEPS :=
559ART_GTEST_exception_test_DEX_DEPS :=
560ART_GTEST_elf_writer_test_HOST_DEPS :=
561ART_GTEST_elf_writer_test_TARGET_DEPS :=
562ART_GTEST_jni_compiler_test_DEX_DEPS :=
563ART_GTEST_jni_internal_test_DEX_DEPS :=
Richard Uhler66d874d2015-01-15 09:37:19 -0800564ART_GTEST_oat_file_assistant_test_DEX_DEPS :=
565ART_GTEST_oat_file_assistant_test_HOST_DEPS :=
566ART_GTEST_oat_file_assistant_test_TARGET_DEPS :=
Andreas Gampee1459ae2016-06-29 09:36:30 -0700567ART_GTEST_dex2oat_test_DEX_DEPS :=
568ART_GTEST_dex2oat_test_HOST_DEPS :=
569ART_GTEST_dex2oat_test_TARGET_DEPS :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700570ART_GTEST_object_test_DEX_DEPS :=
571ART_GTEST_proxy_test_DEX_DEPS :=
572ART_GTEST_reflection_test_DEX_DEPS :=
573ART_GTEST_stub_test_DEX_DEPS :=
574ART_GTEST_transaction_test_DEX_DEPS :=
Andreas Gampee1459ae2016-06-29 09:36:30 -0700575ART_GTEST_dex2oat_environment_tests_DEX_DEPS :=
David Brazdilca3c8c32016-09-06 14:04:48 +0100576ART_GTEST_verifier_deps_test_DEX_DEPS :=
Andreas Gampe3c0bb312015-02-19 10:02:19 -0800577ART_VALGRIND_DEPENDENCIES :=
Anton Kirilove5e76f42016-05-03 16:15:36 +0100578ART_VALGRIND_TARGET_DEPENDENCIES :=
Ian Rogers1a2f84e2014-07-07 16:05:18 -0700579$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_TARGET_GTEST_$(dir)_DEX :=))
580$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_HOST_GTEST_$(dir)_DEX :=))
Richard Uhler66d874d2015-01-15 09:37:19 -0800581ART_TEST_HOST_GTEST_MainStripped_DEX :=
582ART_TEST_TARGET_GTEST_MainStripped_DEX :=
David Brazdilca3c8c32016-09-06 14:04:48 +0100583ART_TEST_GTEST_VerifierDeps_SRC :=
584ART_TEST_HOST_GTEST_VerifierDeps_DEX :=
David Brazdilf906f122016-09-16 16:33:31 +0100585ART_TEST_TARGET_GTEST_VerifierDeps_DEX :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700586GTEST_DEX_DIRECTORIES :=
Brian Carlstrom532714a2014-06-25 02:15:31 -0700587LOCAL_PATH :=