1#
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
17# 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
22include art/build/Android.common_build.mk
23
24# Subdirectories in art/test which contain dex files used as inputs for gtests.
25GTEST_DEX_DIRECTORIES := \
26  AbstractMethod \
27  AllFields \
28  DefaultMethods \
29  DexToDexDecompiler \
30  ErroneousA \
31  ErroneousB \
32  ErroneousInit \
33  ForClassLoaderA \
34  ForClassLoaderB \
35  ForClassLoaderC \
36  ForClassLoaderD \
37  ExceptionHandle \
38  GetMethodSignature \
39  HiddenApi \
40  HiddenApiSignatures \
41  HiddenApiStubs \
42  ImageLayoutA \
43  ImageLayoutB \
44  IMTA \
45  IMTB \
46  Instrumentation \
47  Interfaces \
48  Lookup \
49  Main \
50  ManyMethods \
51  MethodTypes \
52  MultiDex \
53  MultiDexModifiedSecondary \
54  MyClass \
55  MyClassNatives \
56  Nested \
57  NonStaticLeafMethods \
58  Packages \
59  ProtoCompare \
60  ProtoCompare2 \
61  ProfileTestMultiDex \
62  StaticLeafMethods \
63  Statics \
64  StaticsFromCode \
65  StringLiterals \
66  Transaction \
67  XandY
68
69# Create build rules for each dex file recording the dependency.
70$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval $(call build-art-test-dex,art-gtest,$(dir), \
71  $(ART_TARGET_NATIVETEST_OUT),art/build/Android.gtest.mk,ART_TEST_TARGET_GTEST_$(dir)_DEX, \
72  ART_TEST_HOST_GTEST_$(dir)_DEX)))
73
74# Create rules for MainStripped, a copy of Main with the classes.dex stripped
75# for the oat file assistant tests.
76ART_TEST_HOST_GTEST_MainStripped_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
77ART_TEST_TARGET_GTEST_MainStripped_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
78
79# Create rules for MainUncompressed, a copy of Main with the classes.dex uncompressed
80# for the dex2oat tests.
81ART_TEST_HOST_GTEST_MainUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))Uncompressed$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
82ART_TEST_TARGET_GTEST_MainUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))Uncompressed$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
83
84# Create rules for UncompressedEmpty, a classes.dex that is empty and uncompressed
85# for the dex2oat tests.
86ART_TEST_HOST_GTEST_EmptyUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))EmptyUncompressed$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
87ART_TEST_TARGET_GTEST_EmptyUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))EmptyUncompressed$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
88
89# Create rules for UncompressedEmptyAligned, a classes.dex that is empty, uncompressed,
90# and 4 byte aligned for the dex2oat tests.
91ART_TEST_HOST_GTEST_EmptyUncompressedAligned_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))EmptyUncompressedAligned$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
92ART_TEST_TARGET_GTEST_EmptyUncompressedAligned_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))EmptyUncompressedAligned$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
93
94# Create rules for MultiDexUncompressed, a copy of MultiDex with the classes.dex uncompressed
95# for the OatFile tests.
96ART_TEST_HOST_GTEST_MultiDexUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_MultiDex_DEX))Uncompressed$(suffix $(ART_TEST_HOST_GTEST_MultiDex_DEX))
97ART_TEST_TARGET_GTEST_MultiDexUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_MultiDex_DEX))Uncompressed$(suffix $(ART_TEST_TARGET_GTEST_MultiDex_DEX))
98
99ifdef ART_TEST_HOST_GTEST_Main_DEX
100$(ART_TEST_HOST_GTEST_MainStripped_DEX): $(ART_TEST_HOST_GTEST_Main_DEX)
101	cp $< $@
102	$(call dexpreopt-remove-classes.dex,$@)
103endif
104
105ifdef ART_TEST_TARGET_GTEST_Main_DEX
106$(ART_TEST_TARGET_GTEST_MainStripped_DEX): $(ART_TEST_TARGET_GTEST_Main_DEX)
107	cp $< $@
108	$(call dexpreopt-remove-classes.dex,$@)
109endif
110
111ifdef ART_TEST_HOST_GTEST_Main_DEX
112$(ART_TEST_HOST_GTEST_MainUncompressed_DEX): $(ART_TEST_HOST_GTEST_Main_DEX) $(ZIPALIGN)
113	cp $< $@
114	$(call uncompress-dexs, $@)
115	$(call align-package, $@)
116endif
117
118ifdef ART_TEST_TARGET_GTEST_Main_DEX
119$(ART_TEST_TARGET_GTEST_MainUncompressed_DEX): $(ART_TEST_TARGET_GTEST_Main_DEX) $(ZIPALIGN)
120	cp $< $@
121	$(call uncompress-dexs, $@)
122	$(call align-package, $@)
123endif
124
125ifdef ART_TEST_HOST_GTEST_Main_DEX
126$(ART_TEST_HOST_GTEST_EmptyUncompressed_DEX):
127	touch $(dir $@)classes.dex
128	zip -j -qD -X -0 $@ $(dir $@)classes.dex
129	rm $(dir $@)classes.dex
130endif
131
132ifdef ART_TEST_TARGET_GTEST_Main_DEX
133$(ART_TEST_TARGET_GTEST_EmptyUncompressed_DEX):
134	touch $(dir $@)classes.dex
135	zip -j -qD -X -0 $@ $(dir $@)classes.dex
136	rm $(dir $@)classes.dex
137endif
138
139ifdef ART_TEST_HOST_GTEST_Main_DEX
140$(ART_TEST_HOST_GTEST_EmptyUncompressedAligned_DEX): $(ZIPALIGN)
141	touch $(dir $@)classes.dex
142	zip -j -0 $(dir $@)temp.zip $(dir $@)classes.dex
143	$(ZIPALIGN) -f -v 4 $(dir $@)temp.zip $@
144	rm $(dir $@)classes.dex
145	rm $(dir $@)temp.zip
146endif
147
148ifdef ART_TEST_TARGET_GTEST_Main_DEX
149$(ART_TEST_TARGET_GTEST_EmptyUncompressedAligned_DEX): $(ZIPALIGN)
150	touch $(dir $@)classes.dex
151	zip -j -0 $(dir $@)temp.zip $(dir $@)classes.dex
152	$(ZIPALIGN) -f -v 4 $(dir $@)temp.zip $@
153	rm $(dir $@)classes.dex
154	rm $(dir $@)temp.zip
155endif
156
157ifdef ART_TEST_HOST_GTEST_MultiDex_DEX
158$(ART_TEST_HOST_GTEST_MultiDexUncompressed_DEX): $(ART_TEST_HOST_GTEST_MultiDex_DEX) $(ZIPALIGN)
159	cp $< $@
160	$(call uncompress-dexs, $@)
161	$(call align-package, $@)
162endif
163
164ifdef ART_TEST_TARGET_GTEST_MultiDex_DEX
165$(ART_TEST_TARGET_GTEST_MultiDexUncompressed_DEX): $(ART_TEST_TARGET_GTEST_MultiDex_DEX) $(ZIPALIGN)
166	cp $< $@
167	$(call uncompress-dexs, $@)
168	$(call align-package, $@)
169endif
170
171ART_TEST_GTEST_VerifierDeps_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifierDeps/*.smali))
172ART_TEST_GTEST_VerifierDepsMulti_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifierDepsMulti/*.smali))
173ART_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))
174ART_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))
175ART_TEST_HOST_GTEST_VerifierDepsMulti_DEX := $(dir $(ART_TEST_HOST_GTEST_Main_DEX))$(subst Main,VerifierDepsMulti,$(basename $(notdir $(ART_TEST_HOST_GTEST_Main_DEX))))$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
176ART_TEST_TARGET_GTEST_VerifierDepsMulti_DEX := $(dir $(ART_TEST_TARGET_GTEST_Main_DEX))$(subst Main,VerifierDepsMulti,$(basename $(notdir $(ART_TEST_TARGET_GTEST_Main_DEX))))$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
177
178$(ART_TEST_HOST_GTEST_VerifierDeps_DEX): $(ART_TEST_GTEST_VerifierDeps_SRC) $(HOST_OUT_EXECUTABLES)/smali
179	 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
180
181$(ART_TEST_TARGET_GTEST_VerifierDeps_DEX): $(ART_TEST_GTEST_VerifierDeps_SRC) $(HOST_OUT_EXECUTABLES)/smali
182	 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
183
184$(ART_TEST_HOST_GTEST_VerifierDepsMulti_DEX): $(ART_TEST_GTEST_VerifierDepsMulti_SRC) $(HOST_OUT_EXECUTABLES)/smali
185	 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
186
187$(ART_TEST_TARGET_GTEST_VerifierDepsMulti_DEX): $(ART_TEST_GTEST_VerifierDepsMulti_SRC) $(HOST_OUT_EXECUTABLES)/smali
188	 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
189
190ART_TEST_GTEST_VerifySoftFailDuringClinit_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifySoftFailDuringClinit/*.smali))
191ART_TEST_HOST_GTEST_VerifySoftFailDuringClinit_DEX := $(dir $(ART_TEST_HOST_GTEST_Main_DEX))$(subst Main,VerifySoftFailDuringClinit,$(basename $(notdir $(ART_TEST_HOST_GTEST_Main_DEX))))$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
192ART_TEST_TARGET_GTEST_VerifySoftFailDuringClinit_DEX := $(dir $(ART_TEST_TARGET_GTEST_Main_DEX))$(subst Main,VerifySoftFailDuringClinit,$(basename $(notdir $(ART_TEST_TARGET_GTEST_Main_DEX))))$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
193
194$(ART_TEST_HOST_GTEST_VerifySoftFailDuringClinit_DEX): $(ART_TEST_GTEST_VerifySoftFailDuringClinit_SRC) $(HOST_OUT_EXECUTABLES)/smali
195	 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
196
197$(ART_TEST_TARGET_GTEST_VerifySoftFailDuringClinit_DEX): $(ART_TEST_GTEST_VerifySoftFailDuringClinit_SRC) $(HOST_OUT_EXECUTABLES)/smali
198	 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
199
200# Dex file dependencies for each gtest.
201ART_GTEST_art_dex_file_loader_test_DEX_DEPS := GetMethodSignature Main Nested MultiDex
202ART_GTEST_dex2oat_environment_tests_DEX_DEPS := Main MainStripped MultiDex MultiDexModifiedSecondary MyClassNatives Nested VerifierDeps VerifierDepsMulti
203
204ART_GTEST_atomic_dex_ref_map_test_DEX_DEPS := Interfaces
205ART_GTEST_class_linker_test_DEX_DEPS := AllFields ErroneousA ErroneousB ErroneousInit ForClassLoaderA ForClassLoaderB ForClassLoaderC ForClassLoaderD Interfaces MethodTypes MultiDex MyClass Nested Statics StaticsFromCode
206ART_GTEST_class_loader_context_test_DEX_DEPS := Main MultiDex MyClass ForClassLoaderA ForClassLoaderB ForClassLoaderC ForClassLoaderD
207ART_GTEST_class_table_test_DEX_DEPS := XandY
208ART_GTEST_compiler_driver_test_DEX_DEPS := AbstractMethod StaticLeafMethods ProfileTestMultiDex
209ART_GTEST_dex_cache_test_DEX_DEPS := Main Packages MethodTypes
210ART_GTEST_dexanalyze_test_DEX_DEPS := MultiDex
211ART_GTEST_dexlayout_test_DEX_DEPS := ManyMethods
212ART_GTEST_dex2oat_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) ManyMethods Statics VerifierDeps MainUncompressed EmptyUncompressed EmptyUncompressedAligned StringLiterals
213ART_GTEST_dex2oat_image_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) Statics VerifierDeps
214ART_GTEST_exception_test_DEX_DEPS := ExceptionHandle
215ART_GTEST_hiddenapi_test_DEX_DEPS := HiddenApi HiddenApiStubs
216ART_GTEST_hidden_api_test_DEX_DEPS := HiddenApiSignatures Main MultiDex
217ART_GTEST_image_test_DEX_DEPS := ImageLayoutA ImageLayoutB DefaultMethods VerifySoftFailDuringClinit
218ART_GTEST_imtable_test_DEX_DEPS := IMTA IMTB
219ART_GTEST_instrumentation_test_DEX_DEPS := Instrumentation
220ART_GTEST_jni_compiler_test_DEX_DEPS := MyClassNatives
221ART_GTEST_jni_internal_test_DEX_DEPS := AllFields StaticLeafMethods MyClassNatives
222ART_GTEST_oat_file_assistant_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS)
223ART_GTEST_dexoptanalyzer_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS)
224ART_GTEST_image_space_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS)
225ART_GTEST_oat_file_test_DEX_DEPS := Main MultiDex MainUncompressed MultiDexUncompressed MainStripped Nested MultiDexModifiedSecondary
226ART_GTEST_oat_test_DEX_DEPS := Main
227ART_GTEST_oat_writer_test_DEX_DEPS := Main
228# two_runtimes_test build off dex2oat_environment_test, which does sanity checks on the following dex files.
229ART_GTEST_two_runtimes_test_DEX_DEPS := Main MainStripped Nested MultiDex MultiDexModifiedSecondary
230ART_GTEST_object_test_DEX_DEPS := ProtoCompare ProtoCompare2 StaticsFromCode XandY
231ART_GTEST_proxy_test_DEX_DEPS := Interfaces
232ART_GTEST_reflection_test_DEX_DEPS := Main NonStaticLeafMethods StaticLeafMethods
233ART_GTEST_profile_assistant_test_DEX_DEPS := ProfileTestMultiDex
234ART_GTEST_profile_compilation_info_test_DEX_DEPS := ManyMethods ProfileTestMultiDex
235ART_GTEST_profiling_info_test_DEX_DEPS := ProfileTestMultiDex
236ART_GTEST_runtime_callbacks_test_DEX_DEPS := XandY
237ART_GTEST_stub_test_DEX_DEPS := AllFields
238ART_GTEST_transaction_test_DEX_DEPS := Transaction
239ART_GTEST_type_lookup_table_test_DEX_DEPS := Lookup
240ART_GTEST_unstarted_runtime_test_DEX_DEPS := Nested
241ART_GTEST_heap_verification_test_DEX_DEPS := ProtoCompare ProtoCompare2 StaticsFromCode XandY
242ART_GTEST_verifier_deps_test_DEX_DEPS := VerifierDeps VerifierDepsMulti MultiDex
243ART_GTEST_dex_to_dex_decompiler_test_DEX_DEPS := VerifierDeps DexToDexDecompiler
244ART_GTEST_oatdump_app_test_DEX_DEPS := ProfileTestMultiDex
245ART_GTEST_oatdump_test_DEX_DEPS := ProfileTestMultiDex
246
247# The elf writer test has dependencies on core.oat.
248ART_GTEST_elf_writer_test_HOST_DEPS := $(HOST_CORE_IMAGE_DEFAULT_64) $(HOST_CORE_IMAGE_DEFAULT_32)
249ART_GTEST_elf_writer_test_TARGET_DEPS := $(TARGET_CORE_IMAGE_DEFAULT_64) $(TARGET_CORE_IMAGE_DEFAULT_32)
250
251# The two_runtimes_test test has dependencies on core.oat.
252ART_GTEST_two_runtimes_test_HOST_DEPS := $(HOST_CORE_IMAGE_DEFAULT_64) $(HOST_CORE_IMAGE_DEFAULT_32)
253ART_GTEST_two_runtimes_test_TARGET_DEPS := $(TARGET_CORE_IMAGE_DEFAULT_64) $(TARGET_CORE_IMAGE_DEFAULT_32)
254
255ART_GTEST_dex2oat_environment_tests_HOST_DEPS := \
256  $(HOST_CORE_IMAGE_optimizing_64) \
257  $(HOST_CORE_IMAGE_optimizing_32) \
258  $(HOST_CORE_IMAGE_interpreter_64) \
259  $(HOST_CORE_IMAGE_interpreter_32)
260ART_GTEST_dex2oat_environment_tests_TARGET_DEPS := \
261  $(TARGET_CORE_IMAGE_optimizing_64) \
262  $(TARGET_CORE_IMAGE_optimizing_32) \
263  $(TARGET_CORE_IMAGE_interpreter_64) \
264  $(TARGET_CORE_IMAGE_interpreter_32)
265
266ART_GTEST_oat_file_test_HOST_DEPS := \
267  $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) \
268  $(HOST_OUT_EXECUTABLES)/dex2oatd
269ART_GTEST_oat_file_test_TARGET_DEPS := \
270  $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
271  $(TARGET_OUT_EXECUTABLES)/dex2oatd
272
273ART_GTEST_oat_file_assistant_test_HOST_DEPS := \
274  $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS)
275ART_GTEST_oat_file_assistant_test_TARGET_DEPS := \
276  $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS)
277
278ART_GTEST_dexoptanalyzer_test_HOST_DEPS := \
279  $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) \
280  $(HOST_OUT_EXECUTABLES)/dexoptanalyzerd
281ART_GTEST_dexoptanalyzer_test_TARGET_DEPS := \
282  $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
283  $(TARGET_OUT_EXECUTABLES)/dexoptanalyzerd
284
285ART_GTEST_image_space_test_HOST_DEPS := \
286  $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS)
287ART_GTEST_image_space_test_TARGET_DEPS := \
288  $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS)
289
290ART_GTEST_dex2oat_test_HOST_DEPS := \
291  $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) \
292  $(HOST_OUT_EXECUTABLES)/dex2oatd
293ART_GTEST_dex2oat_test_TARGET_DEPS := \
294  $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
295  $(TARGET_OUT_EXECUTABLES)/dex2oatd
296
297ART_GTEST_dex2oat_image_test_HOST_DEPS := \
298  $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) \
299  $(HOST_OUT_EXECUTABLES)/dex2oatd
300ART_GTEST_dex2oat_image_test_TARGET_DEPS := \
301  $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
302  $(TARGET_OUT_EXECUTABLES)/dex2oatd
303
304# TODO: document why this is needed.
305ART_GTEST_proxy_test_HOST_DEPS := $(HOST_CORE_IMAGE_DEFAULT_64) $(HOST_CORE_IMAGE_DEFAULT_32)
306
307# The dexdiag test requires the dexdiag utility.
308ART_GTEST_dexdiag_test_HOST_DEPS := $(HOST_OUT_EXECUTABLES)/dexdiag
309ART_GTEST_dexdiag_test_TARGET_DEPS := $(TARGET_OUT_EXECUTABLES)/dexdiag
310
311# The dexdump test requires an image and the dexdump utility.
312# TODO: rename into dexdump when migration completes
313ART_GTEST_dexdump_test_HOST_DEPS := \
314  $(HOST_CORE_IMAGE_DEFAULT_64) \
315  $(HOST_CORE_IMAGE_DEFAULT_32) \
316  $(HOST_OUT_EXECUTABLES)/dexdump2
317ART_GTEST_dexdump_test_TARGET_DEPS := \
318  $(TARGET_CORE_IMAGE_DEFAULT_64) \
319  $(TARGET_CORE_IMAGE_DEFAULT_32) \
320  $(TARGET_OUT_EXECUTABLES)/dexdump2
321
322# The dexanalyze test requires an image and the dexanalyze utility.
323ART_GTEST_dexanalyze_test_HOST_DEPS := \
324  $(HOST_CORE_IMAGE_DEFAULT_64) \
325  $(HOST_CORE_IMAGE_DEFAULT_32) \
326  $(HOST_OUT_EXECUTABLES)/dexanalyze
327ART_GTEST_dexanalyze_test_TARGET_DEPS := \
328  $(TARGET_CORE_IMAGE_DEFAULT_64) \
329  $(TARGET_CORE_IMAGE_DEFAULT_32) \
330  $(TARGET_OUT_EXECUTABLES)/dexanalyze
331
332# The dexlayout test requires an image and the dexlayout utility.
333# TODO: rename into dexdump when migration completes
334ART_GTEST_dexlayout_test_HOST_DEPS := \
335  $(HOST_CORE_IMAGE_DEFAULT_64) \
336  $(HOST_CORE_IMAGE_DEFAULT_32) \
337  $(HOST_OUT_EXECUTABLES)/dexlayoutd \
338  $(HOST_OUT_EXECUTABLES)/dexdump2
339ART_GTEST_dexlayout_test_TARGET_DEPS := \
340  $(TARGET_CORE_IMAGE_DEFAULT_64) \
341  $(TARGET_CORE_IMAGE_DEFAULT_32) \
342  $(TARGET_OUT_EXECUTABLES)/dexlayoutd \
343  $(TARGET_OUT_EXECUTABLES)/dexdump2
344
345# The dexlist test requires an image and the dexlist utility.
346ART_GTEST_dexlist_test_HOST_DEPS := \
347  $(HOST_CORE_IMAGE_DEFAULT_64) \
348  $(HOST_CORE_IMAGE_DEFAULT_32) \
349  $(HOST_OUT_EXECUTABLES)/dexlist
350ART_GTEST_dexlist_test_TARGET_DEPS := \
351  $(TARGET_CORE_IMAGE_DEFAULT_64) \
352  $(TARGET_CORE_IMAGE_DEFAULT_32) \
353  $(TARGET_OUT_EXECUTABLES)/dexlist
354
355# The imgdiag test has dependencies on core.oat since it needs to load it during the test.
356# For the host, also add the installed tool (in the base size, that should suffice). For the
357# target, just the module is fine, the sync will happen late enough.
358ART_GTEST_imgdiag_test_HOST_DEPS := \
359  $(HOST_CORE_IMAGE_DEFAULT_64) \
360  $(HOST_CORE_IMAGE_DEFAULT_32) \
361  $(HOST_OUT_EXECUTABLES)/imgdiagd
362ART_GTEST_imgdiag_test_TARGET_DEPS := \
363  $(TARGET_CORE_IMAGE_DEFAULT_64) \
364  $(TARGET_CORE_IMAGE_DEFAULT_32) \
365  $(TARGET_OUT_EXECUTABLES)/imgdiagd
366
367# Dex analyze test requires dexanalyze.
368ART_GTEST_dexanalyze_test_HOST_DEPS := \
369  $(HOST_OUT_EXECUTABLES)/dexanalyze
370ART_GTEST_dexanalyze_test_TARGET_DEPS := \
371  $(TARGET_OUT_EXECUTABLES)/dexanalyze
372
373# Oatdump test requires an image and oatfile to dump.
374ART_GTEST_oatdump_test_HOST_DEPS := \
375  $(HOST_CORE_IMAGE_DEFAULT_64) \
376  $(HOST_CORE_IMAGE_DEFAULT_32) \
377  $(HOST_OUT_EXECUTABLES)/oatdumpd \
378  $(HOST_OUT_EXECUTABLES)/oatdumpds \
379  $(HOST_OUT_EXECUTABLES)/dexdump2
380ART_GTEST_oatdump_test_TARGET_DEPS := \
381  $(TARGET_CORE_IMAGE_DEFAULT_64) \
382  $(TARGET_CORE_IMAGE_DEFAULT_32) \
383  $(TARGET_OUT_EXECUTABLES)/oatdumpd \
384  $(TARGET_OUT_EXECUTABLES)/dexdump2
385ART_GTEST_oatdump_image_test_HOST_DEPS := $(ART_GTEST_oatdump_test_HOST_DEPS)
386ART_GTEST_oatdump_image_test_TARGET_DEPS := $(ART_GTEST_oatdump_test_TARGET_DEPS)
387ART_GTEST_oatdump_app_test_HOST_DEPS := $(ART_GTEST_oatdump_test_HOST_DEPS) \
388  $(HOST_OUT_EXECUTABLES)/dex2oatd \
389  $(HOST_OUT_EXECUTABLES)/dex2oatds
390ART_GTEST_oatdump_app_test_TARGET_DEPS := $(ART_GTEST_oatdump_test_TARGET_DEPS) \
391  $(TARGET_OUT_EXECUTABLES)/dex2oatd
392
393# Profile assistant tests requires profman utility.
394ART_GTEST_profile_assistant_test_HOST_DEPS := $(HOST_OUT_EXECUTABLES)/profmand
395ART_GTEST_profile_assistant_test_TARGET_DEPS := $(TARGET_OUT_EXECUTABLES)/profmand
396
397ART_GTEST_hiddenapi_test_HOST_DEPS := \
398  $(HOST_CORE_IMAGE_DEFAULT_64) \
399  $(HOST_CORE_IMAGE_DEFAULT_32) \
400  $(HOST_OUT_EXECUTABLES)/hiddenapid
401
402# The path for which all the source files are relative, not actually the current directory.
403LOCAL_PATH := art
404
405ART_TEST_MODULES := \
406    art_cmdline_tests \
407    art_compiler_host_tests \
408    art_compiler_tests \
409    art_dex2oat_tests \
410    art_dexanalyze_tests \
411    art_dexdiag_tests \
412    art_dexdump_tests \
413    art_dexlayout_tests \
414    art_dexlist_tests \
415    art_dexoptanalyzer_tests \
416    art_hiddenapi_tests \
417    art_imgdiag_tests \
418    art_libartbase_tests \
419    art_libartpalette_tests \
420    art_libdexfile_external_tests \
421    art_libdexfile_support_static_tests \
422    art_libdexfile_support_tests \
423    art_libdexfile_tests \
424    art_libprofile_tests \
425    art_oatdump_tests \
426    art_profman_tests \
427    art_runtime_compiler_tests \
428    art_runtime_tests \
429    art_sigchain_tests \
430
431ART_TARGET_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\
432    $(ART_TEST_LIST_device_$(TARGET_ARCH)_$(m)))
433
434ifdef TARGET_2ND_ARCH
4352ND_ART_TARGET_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\
436    $(ART_TEST_LIST_device_$(2ND_TARGET_ARCH)_$(m)))
437endif
438
439ART_HOST_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\
440    $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_$(m)))
441
442ifneq ($(HOST_PREFER_32_BIT),true)
4432ND_ART_HOST_GTEST_FILES += $(foreach m,$(ART_TEST_MODULES),\
444    $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_$(m)))
445endif
446
447# Variables holding collections of gtest pre-requisits used to run a number of gtests.
448ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
449ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
450ART_TEST_HOST_GTEST_RULES :=
451ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
452ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
453ART_TEST_TARGET_GTEST_RULES :=
454ART_TEST_HOST_GTEST_DEPENDENCIES :=
455ART_TEST_TARGET_GTEST_DEPENDENCIES :=
456
457ART_GTEST_TARGET_ANDROID_ROOT := '/system'
458ifneq ($(ART_TEST_ANDROID_ROOT),)
459  ART_GTEST_TARGET_ANDROID_ROOT := $(ART_TEST_ANDROID_ROOT)
460endif
461
462ART_GTEST_TARGET_ANDROID_RUNTIME_ROOT := '/apex/com.android.runtime'
463ifneq ($(ART_TEST_ANDROID_RUNTIME_ROOT),)
464  ART_GTEST_TARGET_ANDROID_RUNTIME_ROOT := $(ART_TEST_ANDROID_RUNTIME_ROOT)
465endif
466
467ART_GTEST_TARGET_ANDROID_TZDATA_ROOT := '/apex/com.android.tzdata'
468ifneq ($(ART_TEST_ANDROID_TZDATA_ROOT),)
469  ART_GTEST_TARGET_ANDROID_TZDATA_ROOT := $(ART_TEST_ANDROID_TZDATA_ROOT)
470endif
471
472# Define a make rule for a target device gtest.
473# $(1): gtest name - the name of the test we're building such as leb128_test.
474# $(2): path relative to $OUT to the test binary
475# $(3): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
476# $(4): LD_LIBRARY_PATH or undefined - used in case libartd.so is not in /system/lib/
477define define-art-gtest-rule-target
478  ifeq ($(ART_TEST_CHROOT),)
479    # Non-chroot configuration.
480    maybe_art_test_chroot :=
481    maybe_chroot_command :=
482  else
483    # Chroot configuration.
484    maybe_art_test_chroot := $(ART_TEST_CHROOT)
485    maybe_chroot_command := chroot $(ART_TEST_CHROOT)
486  endif
487
488  gtest_rule := test-art-target-gtest-$(1)$$($(3)ART_PHONY_TEST_TARGET_SUFFIX)
489  gtest_exe := $(OUT_DIR)/$(2)
490  gtest_target_exe := $$(patsubst $(PRODUCT_OUT)/%,/%,$$(gtest_exe))
491
492  # Add the test dependencies to test-art-target-sync, which will be a prerequisite for the test
493  # to ensure files are pushed to the device.
494  gtest_deps := \
495    $$(ART_GTEST_$(1)_TARGET_DEPS) \
496    $(foreach file,$(ART_GTEST_$(1)_DEX_DEPS),$(ART_TEST_TARGET_GTEST_$(file)_DEX)) \
497    $$(gtest_exe) \
498    $$($(3)TARGET_OUT_SHARED_LIBRARIES)/libjavacore.so \
499    $$($(3)TARGET_OUT_SHARED_LIBRARIES)/libopenjdkd.so \
500    $$(foreach jar,$$(TARGET_TEST_CORE_JARS),$$(TARGET_OUT_JAVA_LIBRARIES)/$$(jar).jar)
501
502  ART_TEST_TARGET_GTEST_DEPENDENCIES += $$(gtest_deps)
503
504$$(gtest_rule): PRIVATE_TARGET_EXE := $$(gtest_target_exe)
505$$(gtest_rule): PRIVATE_MAYBE_CHROOT_COMMAND := $$(maybe_chroot_command)
506
507# File witnessing the success of the gtest, the presence of which means the gtest's success.
508gtest_witness := \
509  $$(maybe_art_test_chroot)$(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$(gtest_rule)-$$$$PPID
510
511$$(gtest_rule): PRIVATE_GTEST_WITNESS := $$(gtest_witness)
512
513.PHONY: $$(gtest_rule)
514$$(gtest_rule): test-art-target-sync
515	$(hide) $(ADB) shell touch $$(PRIVATE_GTEST_WITNESS)
516	$(hide) $(ADB) shell rm $$(PRIVATE_GTEST_WITNESS)
517	$(hide) $(ADB) shell $$(PRIVATE_MAYBE_CHROOT_COMMAND) chmod 755 $$(PRIVATE_TARGET_EXE)
518	$(hide) $$(call ART_TEST_SKIP,$$@) && \
519	  ($(ADB) shell "$$(PRIVATE_MAYBE_CHROOT_COMMAND) env $(GCOV_ENV) LD_LIBRARY_PATH=$(4) \
520	       ANDROID_ROOT=$(ART_GTEST_TARGET_ANDROID_ROOT) \
521	       ANDROID_RUNTIME_ROOT=$(ART_GTEST_TARGET_ANDROID_RUNTIME_ROOT) \
522	       ANDROID_TZDATA_ROOT=$(ART_GTEST_TARGET_ANDROID_TZDATA_ROOT) \
523	       $$(PRIVATE_TARGET_EXE) \
524	     && touch $$(PRIVATE_GTEST_WITNESS)" \
525	   && ($(ADB) pull $$(PRIVATE_GTEST_WITNESS) /tmp/ && $$(call ART_TEST_PASSED,$$@)) \
526	   || $$(call ART_TEST_FAILED,$$@))
527	$(hide) rm -f /tmp/$$@-$$$$PPID
528
529  ART_TEST_TARGET_GTEST$($(3)ART_PHONY_TEST_TARGET_SUFFIX)_RULES += $$(gtest_rule)
530  ART_TEST_TARGET_GTEST_RULES += $$(gtest_rule)
531  ART_TEST_TARGET_GTEST_$(1)_RULES += $$(gtest_rule)
532
533  # Clear locally defined variables.
534  gtest_witness :=
535  maybe_chroot_command :=
536  maybe_art_test_chroot :=
537  gtest_target_exe :=
538  gtest_deps :=
539  gtest_exe :=
540  gtest_rule :=
541endef  # define-art-gtest-rule-target
542
543# Define make rules for a host gtests.
544# $(1): gtest name - the name of the test we're building such as leb128_test.
545# $(2): path relative to $OUT to the test binary
546# $(3): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
547define define-art-gtest-rule-host
548  gtest_suffix := $(1)$$($(3)ART_PHONY_TEST_HOST_SUFFIX)
549  gtest_rule := test-art-host-gtest-$$(gtest_suffix)
550  gtest_output := $(call intermediates-dir-for,PACKAGING,art-host-gtest,HOST)/$$(gtest_suffix).xml
551  $$(call dist-for-goals,$$(gtest_rule),$$(gtest_output):gtest/$$(gtest_suffix))
552  gtest_exe := $(OUT_DIR)/$(2)
553  # Dependencies for all host gtests.
554  gtest_deps := $$(HOST_CORE_DEX_LOCATIONS) \
555    $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$$(ART_HOST_SHLIB_EXTENSION) \
556    $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$$(ART_HOST_SHLIB_EXTENSION) \
557    $$(gtest_exe) \
558    $$(ART_GTEST_$(1)_HOST_DEPS) \
559    $(foreach file,$(ART_GTEST_$(1)_DEX_DEPS),$(ART_TEST_HOST_GTEST_$(file)_DEX)) \
560    $(HOST_OUT_EXECUTABLES)/timeout_dumper
561
562  ART_TEST_HOST_GTEST_DEPENDENCIES += $$(gtest_deps)
563
564.PHONY: $$(gtest_rule)
565$$(gtest_rule): $$(gtest_output)
566
567# Re-run the tests, even if nothing changed. Until the build system has a dedicated "no cache"
568# option, claim to write a file that is never produced.
569$$(gtest_output): .KATI_IMPLICIT_OUTPUTS := $$(gtest_output)-nocache
570$$(gtest_output): NAME := $$(gtest_rule)
571ifeq (,$(SANITIZE_HOST))
572$$(gtest_output): $$(gtest_exe) $$(gtest_deps)
573	$(hide) ($$(call ART_TEST_SKIP,$$(NAME)) && \
574		timeout --foreground -k 120s -s SIGRTMIN+2 2400s $(HOST_OUT_EXECUTABLES)/timeout_dumper \
575			$$< --gtest_output=xml:$$@ && \
576		$$(call ART_TEST_PASSED,$$(NAME))) || $$(call ART_TEST_FAILED,$$(NAME))
577else
578# Note: envsetup currently exports ASAN_OPTIONS=detect_leaks=0 to suppress leak detection, as some
579#       build tools (e.g., ninja) intentionally leak. We want leak checks when we run our tests, so
580#       override ASAN_OPTIONS. b/37751350
581# Note 2: Under sanitization, also capture the output, and run it through the stack tool on failure
582# (with the x86-64 ABI, as this allows symbolization of both x86 and x86-64). We don't do this in
583# general as it loses all the color output, and we have our own symbolization step when not running
584# under ASAN.
585$$(gtest_output): $$(gtest_exe) $$(gtest_deps)
586	$(hide) ($$(call ART_TEST_SKIP,$$(NAME)) && set -o pipefail && \
587		ASAN_OPTIONS=detect_leaks=1 timeout --foreground -k 120s -s SIGRTMIN+2 3600s \
588			$(HOST_OUT_EXECUTABLES)/timeout_dumper \
589				$$< --gtest_output=xml:$$@ 2>&1 | tee $$<.tmp.out >&2 && \
590		{ $$(call ART_TEST_PASSED,$$(NAME)) ; rm $$<.tmp.out ; }) || \
591		( grep -q AddressSanitizer $$<.tmp.out && export ANDROID_BUILD_TOP=`pwd` && \
592			{ echo "ABI: 'x86_64'" | cat - $$<.tmp.out | development/scripts/stack | tail -n 3000 ; } ; \
593		rm $$<.tmp.out ; $$(call ART_TEST_FAILED,$$(NAME)))
594endif
595
596  ART_TEST_HOST_GTEST$$($(3)ART_PHONY_TEST_HOST_SUFFIX)_RULES += $$(gtest_rule)
597  ART_TEST_HOST_GTEST_RULES += $$(gtest_rule)
598  ART_TEST_HOST_GTEST_$(1)_RULES += $$(gtest_rule)
599
600
601  # Clear locally defined variables.
602  gtest_deps :=
603  gtest_exe :=
604  gtest_output :=
605  gtest_rule :=
606  gtest_suffix :=
607endef  # define-art-gtest-rule-host
608
609# Define the rules to build and run host and target gtests.
610# $(1): file name
611# $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
612define define-art-gtest-target
613  art_gtest_filename := $(1)
614
615  include $$(CLEAR_VARS)
616  art_gtest_name := $$(notdir $$(basename $$(art_gtest_filename)))
617
618  library_path :=
619  2ND_library_path :=
620  ifneq ($$(ART_TEST_ANDROID_ROOT),)
621    ifdef TARGET_2ND_ARCH
622      2ND_library_path := $$(ART_TEST_ANDROID_ROOT)/lib
623      library_path := $$(ART_TEST_ANDROID_ROOT)/lib64
624    else
625      ifneq ($(filter %64,$(TARGET_ARCH)),)
626        library_path := $$(ART_TEST_ANDROID_ROOT)/lib64
627      else
628        library_path := $$(ART_TEST_ANDROID_ROOT)/lib
629      endif
630    endif
631  endif
632
633  ifndef ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES
634    ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES :=
635  endif
636  $$(eval $$(call define-art-gtest-rule-target,$$(art_gtest_name),$$(art_gtest_filename),$(2),$$($(2)library_path)))
637
638  # Clear locally defined variables.
639  art_gtest_filename :=
640  art_gtest_name :=
641  library_path :=
642  2ND_library_path :=
643endef  # define-art-gtest-target
644
645# $(1): file name
646# $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
647define define-art-gtest-host
648  art_gtest_filename := $(1)
649
650  include $$(CLEAR_VARS)
651  art_gtest_name := $$(notdir $$(basename $$(art_gtest_filename)))
652  ifndef ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES
653    ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES :=
654  endif
655  $$(eval $$(call define-art-gtest-rule-host,$$(art_gtest_name),$$(art_gtest_filename),$(2)))
656
657  # Clear locally defined variables.
658  art_gtest_filename :=
659  art_gtest_name :=
660endef  # define-art-gtest-host
661
662# Define the rules to build and run gtests for both archs on target.
663# $(1): test name
664define define-art-gtest-target-both
665  art_gtest_name := $(1)
666
667    # A rule to run the different architecture versions of the gtest.
668.PHONY: test-art-target-gtest-$$(art_gtest_name)
669test-art-target-gtest-$$(art_gtest_name): $$(ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES)
670	$$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
671
672  # Clear now unused variables.
673  ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES :=
674  art_gtest_name :=
675endef  # define-art-gtest-target-both
676
677# Define the rules to build and run gtests for both archs on host.
678# $(1): test name
679define define-art-gtest-host-both
680  art_gtest_name := $(1)
681
682.PHONY: test-art-host-gtest-$$(art_gtest_name)
683test-art-host-gtest-$$(art_gtest_name): $$(ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES)
684	$$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
685
686  # Clear now unused variables.
687  ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES :=
688  art_gtest_name :=
689endef  # define-art-gtest-host-both
690
691ifeq ($(ART_BUILD_TARGET),true)
692  $(foreach file,$(ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest-target,$(file),)))
693  ifdef 2ND_ART_PHONY_TEST_TARGET_SUFFIX
694    $(foreach file,$(2ND_ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest-target,$(file),2ND_)))
695  endif
696  # Rules to run the different architecture versions of the gtest.
697  $(foreach file,$(ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest-target-both,$$(notdir $$(basename $$(file))))))
698endif
699ifeq ($(ART_BUILD_HOST),true)
700  $(foreach file,$(ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host,$(file),)))
701  ifneq ($(HOST_PREFER_32_BIT),true)
702    $(foreach file,$(2ND_ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host,$(file),2ND_)))
703  endif
704  # Rules to run the different architecture versions of the gtest.
705  $(foreach file,$(ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host-both,$$(notdir $$(basename $$(file))))))
706endif
707
708# Used outside the art project to get a list of the current tests
709RUNTIME_TARGET_GTEST_MAKE_TARGETS :=
710$(foreach file, $(ART_TARGET_GTEST_FILES), $(eval RUNTIME_TARGET_GTEST_MAKE_TARGETS += $$(notdir $$(patsubst %/,%,$$(dir $$(file))))_$$(notdir $$(basename $$(file)))))
711COMPILER_TARGET_GTEST_MAKE_TARGETS :=
712
713# Define all the combinations of host/target and suffix such as:
714# test-art-host-gtest or test-art-host-gtest64
715# $(1): host or target
716# $(2): HOST or TARGET
717# $(3): undefined, 32 or 64
718define define-test-art-gtest-combination
719  ifeq ($(1),host)
720    ifneq ($(2),HOST)
721      $$(error argument mismatch $(1) and ($2))
722    endif
723  else
724    ifneq ($(1),target)
725      $$(error found $(1) expected host or target)
726    endif
727    ifneq ($(2),TARGET)
728      $$(error argument mismatch $(1) and ($2))
729    endif
730  endif
731
732  rule_name := test-art-$(1)-gtest$(3)
733  dependencies := $$(ART_TEST_$(2)_GTEST$(3)_RULES)
734
735.PHONY: $$(rule_name)
736$$(rule_name): $$(dependencies) d8 d8-compat-dx
737	$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
738
739  # Clear locally defined variables.
740  rule_name :=
741  dependencies :=
742endef  # define-test-art-gtest-combination
743
744$(eval $(call define-test-art-gtest-combination,target,TARGET,))
745$(eval $(call define-test-art-gtest-combination,target,TARGET,$(ART_PHONY_TEST_TARGET_SUFFIX)))
746ifdef 2ND_ART_PHONY_TEST_TARGET_SUFFIX
747$(eval $(call define-test-art-gtest-combination,target,TARGET,$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)))
748endif
749$(eval $(call define-test-art-gtest-combination,host,HOST,))
750$(eval $(call define-test-art-gtest-combination,host,HOST,$(ART_PHONY_TEST_HOST_SUFFIX)))
751ifneq ($(HOST_PREFER_32_BIT),true)
752$(eval $(call define-test-art-gtest-combination,host,HOST,$(2ND_ART_PHONY_TEST_HOST_SUFFIX)))
753endif
754
755# Clear locally defined variables.
756define-art-gtest-rule-target :=
757define-art-gtest-rule-host :=
758define-art-gtest :=
759define-test-art-gtest-combination :=
760RUNTIME_GTEST_COMMON_SRC_FILES :=
761COMPILER_GTEST_COMMON_SRC_FILES :=
762RUNTIME_GTEST_TARGET_SRC_FILES :=
763RUNTIME_GTEST_HOST_SRC_FILES :=
764COMPILER_GTEST_TARGET_SRC_FILES :=
765COMPILER_GTEST_HOST_SRC_FILES :=
766ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
767ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
768ART_TEST_HOST_GTEST_RULES :=
769ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
770ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
771ART_TEST_TARGET_GTEST_RULES :=
772ART_GTEST_TARGET_ANDROID_ROOT :=
773ART_GTEST_TARGET_ANDROID_RUNTIME_ROOT :=
774ART_GTEST_TARGET_ANDROID_TZDATA_ROOT :=
775ART_GTEST_class_linker_test_DEX_DEPS :=
776ART_GTEST_class_table_test_DEX_DEPS :=
777ART_GTEST_compiler_driver_test_DEX_DEPS :=
778ART_GTEST_dex_file_test_DEX_DEPS :=
779ART_GTEST_exception_test_DEX_DEPS :=
780ART_GTEST_elf_writer_test_HOST_DEPS :=
781ART_GTEST_elf_writer_test_TARGET_DEPS :=
782ART_GTEST_imtable_test_DEX_DEPS :=
783ART_GTEST_jni_compiler_test_DEX_DEPS :=
784ART_GTEST_jni_internal_test_DEX_DEPS :=
785ART_GTEST_oat_file_assistant_test_DEX_DEPS :=
786ART_GTEST_oat_file_assistant_test_HOST_DEPS :=
787ART_GTEST_oat_file_assistant_test_TARGET_DEPS :=
788ART_GTEST_dexanalyze_test_DEX_DEPS :=
789ART_GTEST_dexoptanalyzer_test_DEX_DEPS :=
790ART_GTEST_dexoptanalyzer_test_HOST_DEPS :=
791ART_GTEST_dexoptanalyzer_test_TARGET_DEPS :=
792ART_GTEST_image_space_test_DEX_DEPS :=
793ART_GTEST_image_space_test_HOST_DEPS :=
794ART_GTEST_image_space_test_TARGET_DEPS :=
795ART_GTEST_dex2oat_test_DEX_DEPS :=
796ART_GTEST_dex2oat_test_HOST_DEPS :=
797ART_GTEST_dex2oat_test_TARGET_DEPS :=
798ART_GTEST_dex2oat_image_test_DEX_DEPS :=
799ART_GTEST_dex2oat_image_test_HOST_DEPS :=
800ART_GTEST_dex2oat_image_test_TARGET_DEPS :=
801ART_GTEST_object_test_DEX_DEPS :=
802ART_GTEST_proxy_test_DEX_DEPS :=
803ART_GTEST_reflection_test_DEX_DEPS :=
804ART_GTEST_stub_test_DEX_DEPS :=
805ART_GTEST_transaction_test_DEX_DEPS :=
806ART_GTEST_dex2oat_environment_tests_DEX_DEPS :=
807ART_GTEST_heap_verification_test_DEX_DEPS :=
808ART_GTEST_verifier_deps_test_DEX_DEPS :=
809$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_TARGET_GTEST_$(dir)_DEX :=))
810$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_HOST_GTEST_$(dir)_DEX :=))
811ART_TEST_HOST_GTEST_MainStripped_DEX :=
812ART_TEST_TARGET_GTEST_MainStripped_DEX :=
813ART_TEST_HOST_GTEST_MainUncompressed_DEX :=
814ART_TEST_TARGET_GTEST_MainUncompressed_DEX :=
815ART_TEST_HOST_GTEST_EmptyUncompressed_DEX :=
816ART_TEST_TARGET_GTEST_EmptyUncompressed_DEX :=
817ART_TEST_GTEST_VerifierDeps_SRC :=
818ART_TEST_HOST_GTEST_VerifierDeps_DEX :=
819ART_TEST_TARGET_GTEST_VerifierDeps_DEX :=
820ART_TEST_GTEST_VerifySoftFailDuringClinit_SRC :=
821ART_TEST_HOST_GTEST_VerifySoftFailDuringClinit_DEX :=
822ART_TEST_TARGET_GTEST_VerifySoftFailDuringClinit_DEX :=
823GTEST_DEX_DIRECTORIES :=
824LOCAL_PATH :=
825