blob: ac0ba47e0309b4b02a4dc935220ef69de7621bef [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 \
Artem Udovichenkob3f2b5c2017-01-31 11:49:33 +030028 DefaultMethods \
Nicolas Geoffray01b70e82016-11-17 10:58:36 +000029 DexToDexDecompiler \
Mathieu Chartier1e4841e2016-12-15 14:21:04 -080030 ErroneousA \
31 ErroneousB \
Vladimir Marko72ab6842017-01-20 19:32:50 +000032 ErroneousInit \
Calin Juravlecdd49122017-07-05 20:09:53 -070033 ForClassLoaderA \
34 ForClassLoaderB \
35 ForClassLoaderC \
36 ForClassLoaderD \
Ian Rogersafd9acc2014-06-17 08:21:54 -070037 ExceptionHandle \
38 GetMethodSignature \
David Brazdil2b9c35b2018-01-12 15:44:43 +000039 HiddenApi \
Mathew Inwood7d74ef52018-03-16 14:18:33 +000040 HiddenApiSignatures \
David Brazdil2da3cbb2019-01-30 16:17:50 +000041 HiddenApiStubs \
Mathieu Chartier496577f2016-09-20 15:33:31 -070042 ImageLayoutA \
43 ImageLayoutB \
Andreas Gampea1ff30f2016-09-27 12:19:45 -070044 IMTA \
45 IMTB \
Sebastien Hertz0462c4c2015-04-01 16:34:17 +020046 Instrumentation \
Ian Rogersafd9acc2014-06-17 08:21:54 -070047 Interfaces \
Artem Udovichenkod9786b02015-10-14 16:36:55 +030048 Lookup \
Ian Rogersafd9acc2014-06-17 08:21:54 -070049 Main \
Mathieu Chartierd00e02b2017-05-24 12:04:13 -070050 ManyMethods \
Narayan Kamath25352fc2016-08-03 12:46:58 +010051 MethodTypes \
Richard Uhler66d874d2015-01-15 09:37:19 -080052 MultiDex \
Richard Uhler67ff7d12015-05-14 13:21:13 -070053 MultiDexModifiedSecondary \
Ian Rogersafd9acc2014-06-17 08:21:54 -070054 MyClass \
55 MyClassNatives \
56 Nested \
57 NonStaticLeafMethods \
Mathieu Chartier279ac5c2016-09-08 17:34:25 -070058 Packages \
Ian Rogersafd9acc2014-06-17 08:21:54 -070059 ProtoCompare \
60 ProtoCompare2 \
Calin Juravle877fd962016-01-05 14:29:29 +000061 ProfileTestMultiDex \
Ian Rogersafd9acc2014-06-17 08:21:54 -070062 StaticLeafMethods \
63 Statics \
64 StaticsFromCode \
Mathieu Chartiercd0f38f2018-10-15 09:44:35 -070065 StringLiterals \
Ian Rogersafd9acc2014-06-17 08:21:54 -070066 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), \
Ian Rogers1a2f84e2014-07-07 16:05:18 -070071 $(ART_TARGET_NATIVETEST_OUT),art/build/Android.gtest.mk,ART_TEST_TARGET_GTEST_$(dir)_DEX, \
72 ART_TEST_HOST_GTEST_$(dir)_DEX)))
Ian Rogersafd9acc2014-06-17 08:21:54 -070073
Richard Uhler66d874d2015-01-15 09:37:19 -080074# 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
Nicolas Geoffrayf3075272018-01-08 12:41:19 +000079# 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
Mathieu Chartier700a9852018-02-06 18:27:38 -080084# 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
Andreas Gampefc604a72018-02-08 15:43:37 -080089# Create rules for MultiDexUncompressed, a copy of MultiDex with the classes.dex uncompressed
90# for the OatFile tests.
91ART_TEST_HOST_GTEST_MultiDexUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_MultiDex_DEX))Uncompressed$(suffix $(ART_TEST_HOST_GTEST_MultiDex_DEX))
92ART_TEST_TARGET_GTEST_MultiDexUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_MultiDex_DEX))Uncompressed$(suffix $(ART_TEST_TARGET_GTEST_MultiDex_DEX))
93
Dan Willemsen17769622018-04-06 13:26:36 -070094ifdef ART_TEST_HOST_GTEST_Main_DEX
Richard Uhler66d874d2015-01-15 09:37:19 -080095$(ART_TEST_HOST_GTEST_MainStripped_DEX): $(ART_TEST_HOST_GTEST_Main_DEX)
96 cp $< $@
97 $(call dexpreopt-remove-classes.dex,$@)
Dan Willemsen17769622018-04-06 13:26:36 -070098endif
Richard Uhler66d874d2015-01-15 09:37:19 -080099
Dan Willemsen17769622018-04-06 13:26:36 -0700100ifdef ART_TEST_TARGET_GTEST_Main_DEX
Richard Uhler66d874d2015-01-15 09:37:19 -0800101$(ART_TEST_TARGET_GTEST_MainStripped_DEX): $(ART_TEST_TARGET_GTEST_Main_DEX)
102 cp $< $@
103 $(call dexpreopt-remove-classes.dex,$@)
Dan Willemsen17769622018-04-06 13:26:36 -0700104endif
Richard Uhler66d874d2015-01-15 09:37:19 -0800105
Dan Willemsen17769622018-04-06 13:26:36 -0700106ifdef ART_TEST_HOST_GTEST_Main_DEX
Nicolas Geoffrayf3075272018-01-08 12:41:19 +0000107$(ART_TEST_HOST_GTEST_MainUncompressed_DEX): $(ART_TEST_HOST_GTEST_Main_DEX) $(ZIPALIGN)
108 cp $< $@
109 $(call uncompress-dexs, $@)
110 $(call align-package, $@)
Dan Willemsen17769622018-04-06 13:26:36 -0700111endif
Nicolas Geoffrayf3075272018-01-08 12:41:19 +0000112
Dan Willemsen17769622018-04-06 13:26:36 -0700113ifdef ART_TEST_TARGET_GTEST_Main_DEX
Nicolas Geoffrayf3075272018-01-08 12:41:19 +0000114$(ART_TEST_TARGET_GTEST_MainUncompressed_DEX): $(ART_TEST_TARGET_GTEST_Main_DEX) $(ZIPALIGN)
115 cp $< $@
116 $(call uncompress-dexs, $@)
117 $(call align-package, $@)
Dan Willemsen17769622018-04-06 13:26:36 -0700118endif
Nicolas Geoffrayf3075272018-01-08 12:41:19 +0000119
Dan Willemsen17769622018-04-06 13:26:36 -0700120ifdef ART_TEST_HOST_GTEST_Main_DEX
Mathieu Chartier700a9852018-02-06 18:27:38 -0800121$(ART_TEST_HOST_GTEST_EmptyUncompressed_DEX): $(ZIPALIGN)
122 touch $(dir $@)classes.dex
123 zip -j -qD -X -0 $@ $(dir $@)classes.dex
124 rm $(dir $@)classes.dex
Dan Willemsen17769622018-04-06 13:26:36 -0700125endif
Mathieu Chartier700a9852018-02-06 18:27:38 -0800126
Dan Willemsen17769622018-04-06 13:26:36 -0700127ifdef ART_TEST_TARGET_GTEST_Main_DEX
Mathieu Chartier700a9852018-02-06 18:27:38 -0800128$(ART_TEST_TARGET_GTEST_EmptyUncompressed_DEX): $(ZIPALIGN)
129 touch $(dir $@)classes.dex
130 zip -j -qD -X -0 $@ $(dir $@)classes.dex
131 rm $(dir $@)classes.dex
Dan Willemsen17769622018-04-06 13:26:36 -0700132endif
Mathieu Chartier700a9852018-02-06 18:27:38 -0800133
Dan Willemsen17769622018-04-06 13:26:36 -0700134ifdef ART_TEST_HOST_GTEST_MultiDex_DEX
Andreas Gampefc604a72018-02-08 15:43:37 -0800135$(ART_TEST_HOST_GTEST_MultiDexUncompressed_DEX): $(ART_TEST_HOST_GTEST_MultiDex_DEX) $(ZIPALIGN)
136 cp $< $@
137 $(call uncompress-dexs, $@)
138 $(call align-package, $@)
Dan Willemsen17769622018-04-06 13:26:36 -0700139endif
Andreas Gampefc604a72018-02-08 15:43:37 -0800140
Dan Willemsen17769622018-04-06 13:26:36 -0700141ifdef ART_TEST_TARGET_GTEST_MultiDex_DEX
Andreas Gampefc604a72018-02-08 15:43:37 -0800142$(ART_TEST_TARGET_GTEST_MultiDexUncompressed_DEX): $(ART_TEST_TARGET_GTEST_MultiDex_DEX) $(ZIPALIGN)
143 cp $< $@
144 $(call uncompress-dexs, $@)
145 $(call align-package, $@)
Dan Willemsen17769622018-04-06 13:26:36 -0700146endif
Andreas Gampefc604a72018-02-08 15:43:37 -0800147
David Brazdilca3c8c32016-09-06 14:04:48 +0100148ART_TEST_GTEST_VerifierDeps_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifierDeps/*.smali))
Nicolas Geoffray7cc3ae52017-03-07 14:33:37 +0000149ART_TEST_GTEST_VerifierDepsMulti_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifierDepsMulti/*.smali))
David Brazdilca3c8c32016-09-06 14:04:48 +0100150ART_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 +0100151ART_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))
Nicolas Geoffray7cc3ae52017-03-07 14:33:37 +0000152ART_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))
153ART_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))
David Brazdilca3c8c32016-09-06 14:04:48 +0100154
155$(ART_TEST_HOST_GTEST_VerifierDeps_DEX): $(ART_TEST_GTEST_VerifierDeps_SRC) $(HOST_OUT_EXECUTABLES)/smali
Ben Gruver14fc9db2017-04-28 15:30:49 -0700156 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
David Brazdilca3c8c32016-09-06 14:04:48 +0100157
David Brazdilf906f122016-09-16 16:33:31 +0100158$(ART_TEST_TARGET_GTEST_VerifierDeps_DEX): $(ART_TEST_GTEST_VerifierDeps_SRC) $(HOST_OUT_EXECUTABLES)/smali
Ben Gruver14fc9db2017-04-28 15:30:49 -0700159 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
David Brazdilf906f122016-09-16 16:33:31 +0100160
Nicolas Geoffray7cc3ae52017-03-07 14:33:37 +0000161$(ART_TEST_HOST_GTEST_VerifierDepsMulti_DEX): $(ART_TEST_GTEST_VerifierDepsMulti_SRC) $(HOST_OUT_EXECUTABLES)/smali
Ben Gruver14fc9db2017-04-28 15:30:49 -0700162 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
Nicolas Geoffray7cc3ae52017-03-07 14:33:37 +0000163
164$(ART_TEST_TARGET_GTEST_VerifierDepsMulti_DEX): $(ART_TEST_GTEST_VerifierDepsMulti_SRC) $(HOST_OUT_EXECUTABLES)/smali
Ben Gruver14fc9db2017-04-28 15:30:49 -0700165 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
Nicolas Geoffray7cc3ae52017-03-07 14:33:37 +0000166
Vladimir Markod79b37b2018-11-02 13:06:22 +0000167ART_TEST_GTEST_VerifySoftFailDuringClinit_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifySoftFailDuringClinit/*.smali))
168ART_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))
169ART_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))
170
171$(ART_TEST_HOST_GTEST_VerifySoftFailDuringClinit_DEX): $(ART_TEST_GTEST_VerifySoftFailDuringClinit_SRC) $(HOST_OUT_EXECUTABLES)/smali
172 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
173
174$(ART_TEST_TARGET_GTEST_VerifySoftFailDuringClinit_DEX): $(ART_TEST_GTEST_VerifySoftFailDuringClinit_SRC) $(HOST_OUT_EXECUTABLES)/smali
175 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
176
Ian Rogersafd9acc2014-06-17 08:21:54 -0700177# Dex file dependencies for each gtest.
David Sehr139512d2018-02-08 15:44:50 -0800178ART_GTEST_art_dex_file_loader_test_DEX_DEPS := GetMethodSignature Main Nested MultiDex
Andreas Gampecac31ad2017-11-06 20:01:17 -0800179ART_GTEST_dex2oat_environment_tests_DEX_DEPS := Main MainStripped MultiDex MultiDexModifiedSecondary MyClassNatives Nested VerifierDeps VerifierDepsMulti
Andreas Gampee1459ae2016-06-29 09:36:30 -0700180
Mathieu Chartier93764b82017-07-17 14:51:53 -0700181ART_GTEST_atomic_dex_ref_map_test_DEX_DEPS := Interfaces
Calin Juravlecdd49122017-07-05 20:09:53 -0700182ART_GTEST_class_linker_test_DEX_DEPS := AllFields ErroneousA ErroneousB ErroneousInit ForClassLoaderA ForClassLoaderB ForClassLoaderC ForClassLoaderD Interfaces MethodTypes MultiDex MyClass Nested Statics StaticsFromCode
Calin Juravle57d0acc2017-07-11 17:41:30 -0700183ART_GTEST_class_loader_context_test_DEX_DEPS := Main MultiDex MyClass ForClassLoaderA ForClassLoaderB ForClassLoaderC ForClassLoaderD
Mathieu Chartierdb70ce52016-12-12 11:06:59 -0800184ART_GTEST_class_table_test_DEX_DEPS := XandY
Calin Juravle877fd962016-01-05 14:29:29 +0000185ART_GTEST_compiler_driver_test_DEX_DEPS := AbstractMethod StaticLeafMethods ProfileTestMultiDex
Narayan Kamath25352fc2016-08-03 12:46:58 +0100186ART_GTEST_dex_cache_test_DEX_DEPS := Main Packages MethodTypes
Mathieu Chartier2e0478a2018-04-06 14:33:25 -0700187ART_GTEST_dexanalyze_test_DEX_DEPS := MultiDex
Mathieu Chartierd00e02b2017-05-24 12:04:13 -0700188ART_GTEST_dexlayout_test_DEX_DEPS := ManyMethods
Mathieu Chartiercd0f38f2018-10-15 09:44:35 -0700189ART_GTEST_dex2oat_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) ManyMethods Statics VerifierDeps MainUncompressed EmptyUncompressed StringLiterals
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700190ART_GTEST_dex2oat_image_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) Statics VerifierDeps
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700191ART_GTEST_exception_test_DEX_DEPS := ExceptionHandle
David Brazdil2da3cbb2019-01-30 16:17:50 +0000192ART_GTEST_hiddenapi_test_DEX_DEPS := HiddenApi HiddenApiStubs
David Brazdila5c3a802019-03-08 14:59:41 +0000193ART_GTEST_hidden_api_test_DEX_DEPS := HiddenApiSignatures Main MultiDex
Vladimir Markod79b37b2018-11-02 13:06:22 +0000194ART_GTEST_image_test_DEX_DEPS := ImageLayoutA ImageLayoutB DefaultMethods VerifySoftFailDuringClinit
Andreas Gampea1ff30f2016-09-27 12:19:45 -0700195ART_GTEST_imtable_test_DEX_DEPS := IMTA IMTB
Sebastien Hertz0462c4c2015-04-01 16:34:17 +0200196ART_GTEST_instrumentation_test_DEX_DEPS := Instrumentation
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700197ART_GTEST_jni_compiler_test_DEX_DEPS := MyClassNatives
Nicolas Geoffray928567b2018-08-01 10:21:12 +0100198ART_GTEST_jni_internal_test_DEX_DEPS := AllFields StaticLeafMethods MyClassNatives
Andreas Gampee1459ae2016-06-29 09:36:30 -0700199ART_GTEST_oat_file_assistant_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS)
Calin Juravle36eb3132017-01-13 16:32:38 -0800200ART_GTEST_dexoptanalyzer_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS)
Richard Uhler84f50ae2017-02-06 15:12:45 +0000201ART_GTEST_image_space_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS)
Nicolas Geoffray8baa11a2019-01-24 10:30:03 +0000202ART_GTEST_oat_file_test_DEX_DEPS := Main MultiDex MainUncompressed MultiDexUncompressed MainStripped Nested MultiDexModifiedSecondary
Mathieu Chartier07ddb6f2015-11-05 11:16:34 -0800203ART_GTEST_oat_test_DEX_DEPS := Main
Roland Levillain1f130f12018-03-12 18:39:19 +0000204ART_GTEST_oat_writer_test_DEX_DEPS := Main
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700205ART_GTEST_object_test_DEX_DEPS := ProtoCompare ProtoCompare2 StaticsFromCode XandY
206ART_GTEST_proxy_test_DEX_DEPS := Interfaces
207ART_GTEST_reflection_test_DEX_DEPS := Main NonStaticLeafMethods StaticLeafMethods
Calin Juravle877fd962016-01-05 14:29:29 +0000208ART_GTEST_profile_assistant_test_DEX_DEPS := ProfileTestMultiDex
Mathieu Chartierdb40eac2017-06-09 18:34:11 -0700209ART_GTEST_profile_compilation_info_test_DEX_DEPS := ManyMethods ProfileTestMultiDex
Nicolas Geoffray44078f92018-10-01 12:57:55 +0100210ART_GTEST_profiling_info_test_DEX_DEPS := ProfileTestMultiDex
Andreas Gampe0f01b582017-01-18 15:22:37 -0800211ART_GTEST_runtime_callbacks_test_DEX_DEPS := XandY
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700212ART_GTEST_stub_test_DEX_DEPS := AllFields
213ART_GTEST_transaction_test_DEX_DEPS := Transaction
Artem Udovichenkod9786b02015-10-14 16:36:55 +0300214ART_GTEST_type_lookup_table_test_DEX_DEPS := Lookup
Andreas Gampeae78c262017-02-01 20:40:44 -0800215ART_GTEST_unstarted_runtime_test_DEX_DEPS := Nested
Mathieu Chartier1ca68902017-04-18 11:26:22 -0700216ART_GTEST_heap_verification_test_DEX_DEPS := ProtoCompare ProtoCompare2 StaticsFromCode XandY
Nicolas Geoffray7cc3ae52017-03-07 14:33:37 +0000217ART_GTEST_verifier_deps_test_DEX_DEPS := VerifierDeps VerifierDepsMulti MultiDex
Nicolas Geoffray01b70e82016-11-17 10:58:36 +0000218ART_GTEST_dex_to_dex_decompiler_test_DEX_DEPS := VerifierDeps DexToDexDecompiler
Vladimir Marko421087b2018-02-27 11:00:17 +0000219ART_GTEST_oatdump_app_test_DEX_DEPS := ProfileTestMultiDex
Nicolas Geoffray3ad2c2b2019-01-26 00:19:38 +0000220ART_GTEST_oatdump_test_DEX_DEPS := ProfileTestMultiDex
Ian Rogersafd9acc2014-06-17 08:21:54 -0700221
222# The elf writer test has dependencies on core.oat.
Richard Uhler67e1dc52017-02-06 16:50:17 +0000223ART_GTEST_elf_writer_test_HOST_DEPS := $(HOST_CORE_IMAGE_DEFAULT_64) $(HOST_CORE_IMAGE_DEFAULT_32)
224ART_GTEST_elf_writer_test_TARGET_DEPS := $(TARGET_CORE_IMAGE_DEFAULT_64) $(TARGET_CORE_IMAGE_DEFAULT_32)
Brian Carlstrom53463ea2014-11-09 14:11:51 -0800225
Andreas Gampee1459ae2016-06-29 09:36:30 -0700226ART_GTEST_dex2oat_environment_tests_HOST_DEPS := \
Richard Uhlerbb00f812017-02-16 14:21:10 +0000227 $(HOST_CORE_IMAGE_optimizing_64) \
228 $(HOST_CORE_IMAGE_optimizing_32) \
229 $(HOST_CORE_IMAGE_interpreter_64) \
Vladimir Markoa497a392018-09-26 10:52:50 +0100230 $(HOST_CORE_IMAGE_interpreter_32)
Andreas Gampee1459ae2016-06-29 09:36:30 -0700231ART_GTEST_dex2oat_environment_tests_TARGET_DEPS := \
Richard Uhlerbb00f812017-02-16 14:21:10 +0000232 $(TARGET_CORE_IMAGE_optimizing_64) \
233 $(TARGET_CORE_IMAGE_optimizing_32) \
234 $(TARGET_CORE_IMAGE_interpreter_64) \
Vladimir Markoa497a392018-09-26 10:52:50 +0100235 $(TARGET_CORE_IMAGE_interpreter_32)
Andreas Gampee1459ae2016-06-29 09:36:30 -0700236
David Srbeckyec2cdf42017-12-08 16:21:25 +0000237ART_GTEST_oat_file_test_HOST_DEPS := \
238 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS)
239ART_GTEST_oat_file_test_TARGET_DEPS := \
240 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS)
241
Andreas Gampee1459ae2016-06-29 09:36:30 -0700242ART_GTEST_oat_file_assistant_test_HOST_DEPS := \
Richard Uhlerf51ac422016-07-08 09:22:33 -0700243 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS)
Andreas Gampee1459ae2016-06-29 09:36:30 -0700244ART_GTEST_oat_file_assistant_test_TARGET_DEPS := \
Richard Uhlerf51ac422016-07-08 09:22:33 -0700245 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS)
Andreas Gampee1459ae2016-06-29 09:36:30 -0700246
Calin Juravle36eb3132017-01-13 16:32:38 -0800247ART_GTEST_dexoptanalyzer_test_HOST_DEPS := \
248 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700249 $(HOST_OUT_EXECUTABLES)/dexoptanalyzerd
Calin Juravle36eb3132017-01-13 16:32:38 -0800250ART_GTEST_dexoptanalyzer_test_TARGET_DEPS := \
251 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700252 $(TARGET_OUT_EXECUTABLES)/dexoptanalyzerd
Andreas Gampee1459ae2016-06-29 09:36:30 -0700253
Richard Uhler84f50ae2017-02-06 15:12:45 +0000254ART_GTEST_image_space_test_HOST_DEPS := \
255 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS)
256ART_GTEST_image_space_test_TARGET_DEPS := \
257 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS)
258
Andreas Gampee1459ae2016-06-29 09:36:30 -0700259ART_GTEST_dex2oat_test_HOST_DEPS := \
Andreas Gampe47200462017-11-09 11:40:03 -0800260 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700261 $(HOST_OUT_EXECUTABLES)/dex2oatd
Andreas Gampee1459ae2016-06-29 09:36:30 -0700262ART_GTEST_dex2oat_test_TARGET_DEPS := \
Andreas Gampe47200462017-11-09 11:40:03 -0800263 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700264 $(TARGET_OUT_EXECUTABLES)/dex2oatd
Richard Uhler66d874d2015-01-15 09:37:19 -0800265
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700266ART_GTEST_dex2oat_image_test_HOST_DEPS := \
Andreas Gampe47200462017-11-09 11:40:03 -0800267 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700268 $(HOST_OUT_EXECUTABLES)/dex2oatd
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700269ART_GTEST_dex2oat_image_test_TARGET_DEPS := \
Andreas Gampe47200462017-11-09 11:40:03 -0800270 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700271 $(TARGET_OUT_EXECUTABLES)/dex2oatd
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700272
Brian Carlstrom53463ea2014-11-09 14:11:51 -0800273# TODO: document why this is needed.
Richard Uhler67e1dc52017-02-06 16:50:17 +0000274ART_GTEST_proxy_test_HOST_DEPS := $(HOST_CORE_IMAGE_DEFAULT_64) $(HOST_CORE_IMAGE_DEFAULT_32)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700275
David Sehr55232f12017-04-19 14:06:49 -0700276# The dexdiag test requires the dexdiag utility.
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700277ART_GTEST_dexdiag_test_HOST_DEPS := $(HOST_OUT_EXECUTABLES)/dexdiag
278ART_GTEST_dexdiag_test_TARGET_DEPS := $(TARGET_OUT_EXECUTABLES)/dexdiag
David Sehr55232f12017-04-19 14:06:49 -0700279
Aart Bikcfbe53c2015-07-06 14:27:27 -0700280# The dexdump test requires an image and the dexdump utility.
Aart Bik22c26f52015-07-08 21:20:13 +0000281# TODO: rename into dexdump when migration completes
Aart Bikcfbe53c2015-07-06 14:27:27 -0700282ART_GTEST_dexdump_test_HOST_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000283 $(HOST_CORE_IMAGE_DEFAULT_64) \
284 $(HOST_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700285 $(HOST_OUT_EXECUTABLES)/dexdump2
Aart Bikcfbe53c2015-07-06 14:27:27 -0700286ART_GTEST_dexdump_test_TARGET_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000287 $(TARGET_CORE_IMAGE_DEFAULT_64) \
288 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700289 $(TARGET_OUT_EXECUTABLES)/dexdump2
Aart Bikcfbe53c2015-07-06 14:27:27 -0700290
Mathieu Chartier0226c1d2018-05-17 00:19:12 -0700291# The dexanalyze test requires an image and the dexanalyze utility.
292ART_GTEST_dexanalyze_test_HOST_DEPS := \
293 $(HOST_CORE_IMAGE_DEFAULT_64) \
294 $(HOST_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700295 $(HOST_OUT_EXECUTABLES)/dexanalyze
Mathieu Chartier0226c1d2018-05-17 00:19:12 -0700296ART_GTEST_dexanalyze_test_TARGET_DEPS := \
297 $(TARGET_CORE_IMAGE_DEFAULT_64) \
298 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700299 $(TARGET_OUT_EXECUTABLES)/dexanalyze
Mathieu Chartier0226c1d2018-05-17 00:19:12 -0700300
Jeff Haoc3acfc52016-08-29 14:18:26 -0700301# The dexlayout test requires an image and the dexlayout utility.
302# TODO: rename into dexdump when migration completes
303ART_GTEST_dexlayout_test_HOST_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000304 $(HOST_CORE_IMAGE_DEFAULT_64) \
305 $(HOST_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700306 $(HOST_OUT_EXECUTABLES)/dexlayoutd \
307 $(HOST_OUT_EXECUTABLES)/dexdump2
Jeff Haoc3acfc52016-08-29 14:18:26 -0700308ART_GTEST_dexlayout_test_TARGET_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000309 $(TARGET_CORE_IMAGE_DEFAULT_64) \
310 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700311 $(TARGET_OUT_EXECUTABLES)/dexlayoutd \
312 $(TARGET_OUT_EXECUTABLES)/dexdump2
Jeff Haoc3acfc52016-08-29 14:18:26 -0700313
Aart Bik3e40f4a2015-07-07 17:09:41 -0700314# The dexlist test requires an image and the dexlist utility.
Aart Bik3e40f4a2015-07-07 17:09:41 -0700315ART_GTEST_dexlist_test_HOST_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000316 $(HOST_CORE_IMAGE_DEFAULT_64) \
317 $(HOST_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700318 $(HOST_OUT_EXECUTABLES)/dexlist
Aart Bik3e40f4a2015-07-07 17:09:41 -0700319ART_GTEST_dexlist_test_TARGET_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000320 $(TARGET_CORE_IMAGE_DEFAULT_64) \
321 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700322 $(TARGET_OUT_EXECUTABLES)/dexlist
Aart Bik3e40f4a2015-07-07 17:09:41 -0700323
Igor Murashkin37743352014-11-13 14:38:00 -0800324# The imgdiag test has dependencies on core.oat since it needs to load it during the test.
Andreas Gampec93b8b52014-12-19 23:12:25 -0800325# For the host, also add the installed tool (in the base size, that should suffice). For the
326# target, just the module is fine, the sync will happen late enough.
327ART_GTEST_imgdiag_test_HOST_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000328 $(HOST_CORE_IMAGE_DEFAULT_64) \
329 $(HOST_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700330 $(HOST_OUT_EXECUTABLES)/imgdiagd
Andreas Gampec93b8b52014-12-19 23:12:25 -0800331ART_GTEST_imgdiag_test_TARGET_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000332 $(TARGET_CORE_IMAGE_DEFAULT_64) \
333 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700334 $(TARGET_OUT_EXECUTABLES)/imgdiagd
Igor Murashkin37743352014-11-13 14:38:00 -0800335
Mathieu Chartier2e0478a2018-04-06 14:33:25 -0700336# Dex analyze test requires dexanalyze.
337ART_GTEST_dexanalyze_test_HOST_DEPS := \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700338 $(HOST_OUT_EXECUTABLES)/dexanalyze
Mathieu Chartier2e0478a2018-04-06 14:33:25 -0700339ART_GTEST_dexanalyze_test_TARGET_DEPS := \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700340 $(TARGET_OUT_EXECUTABLES)/dexanalyze
Mathieu Chartier2e0478a2018-04-06 14:33:25 -0700341
Mathieu Chartierea216b32015-05-26 19:48:16 -0700342# Oatdump test requires an image and oatfile to dump.
343ART_GTEST_oatdump_test_HOST_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000344 $(HOST_CORE_IMAGE_DEFAULT_64) \
345 $(HOST_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700346 $(HOST_OUT_EXECUTABLES)/oatdumpd \
347 $(HOST_OUT_EXECUTABLES)/oatdumpds \
348 $(HOST_OUT_EXECUTABLES)/dexdump2
Mathieu Chartierea216b32015-05-26 19:48:16 -0700349ART_GTEST_oatdump_test_TARGET_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000350 $(TARGET_CORE_IMAGE_DEFAULT_64) \
351 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700352 $(TARGET_OUT_EXECUTABLES)/oatdumpd \
353 $(TARGET_OUT_EXECUTABLES)/dexdump2
Vladimir Marko1352f132017-04-28 15:28:29 +0100354ART_GTEST_oatdump_image_test_HOST_DEPS := $(ART_GTEST_oatdump_test_HOST_DEPS)
355ART_GTEST_oatdump_image_test_TARGET_DEPS := $(ART_GTEST_oatdump_test_TARGET_DEPS)
Vladimir Marko421087b2018-02-27 11:00:17 +0000356ART_GTEST_oatdump_app_test_HOST_DEPS := $(ART_GTEST_oatdump_test_HOST_DEPS) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700357 $(HOST_OUT_EXECUTABLES)/dex2oatd \
358 $(HOST_OUT_EXECUTABLES)/dex2oatds
Vladimir Marko421087b2018-02-27 11:00:17 +0000359ART_GTEST_oatdump_app_test_TARGET_DEPS := $(ART_GTEST_oatdump_test_TARGET_DEPS) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700360 $(TARGET_OUT_EXECUTABLES)/dex2oatd
Mathieu Chartierea216b32015-05-26 19:48:16 -0700361
Calin Juravle2e2db782016-02-23 12:00:03 +0000362# Profile assistant tests requires profman utility.
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700363ART_GTEST_profile_assistant_test_HOST_DEPS := $(HOST_OUT_EXECUTABLES)/profmand
364ART_GTEST_profile_assistant_test_TARGET_DEPS := $(TARGET_OUT_EXECUTABLES)/profmand
Calin Juravle2e2db782016-02-23 12:00:03 +0000365
David Brazdil2b9c35b2018-01-12 15:44:43 +0000366ART_GTEST_hiddenapi_test_HOST_DEPS := \
367 $(HOST_CORE_IMAGE_DEFAULT_64) \
368 $(HOST_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700369 $(HOST_OUT_EXECUTABLES)/hiddenapid
David Brazdil2b9c35b2018-01-12 15:44:43 +0000370
Ian Rogersafd9acc2014-06-17 08:21:54 -0700371# The path for which all the source files are relative, not actually the current directory.
Brian Carlstrom7940e442013-07-12 13:46:57 -0700372LOCAL_PATH := art
373
Colin Cross6e95dd52016-09-12 15:37:10 -0700374ART_TEST_MODULES := \
375 art_cmdline_tests \
Colin Cross6e95dd52016-09-12 15:37:10 -0700376 art_compiler_host_tests \
Martin Stjernholm750bf042019-01-09 22:51:12 +0000377 art_compiler_tests \
Colin Cross6e95dd52016-09-12 15:37:10 -0700378 art_dex2oat_tests \
Mathieu Chartier2e0478a2018-04-06 14:33:25 -0700379 art_dexanalyze_tests \
David Sehr55232f12017-04-19 14:06:49 -0700380 art_dexdiag_tests \
Colin Cross6e95dd52016-09-12 15:37:10 -0700381 art_dexdump_tests \
382 art_dexlayout_tests \
383 art_dexlist_tests \
Calin Juravle36eb3132017-01-13 16:32:38 -0800384 art_dexoptanalyzer_tests \
David Brazdil2b9c35b2018-01-12 15:44:43 +0000385 art_hiddenapi_tests \
Colin Cross6e95dd52016-09-12 15:37:10 -0700386 art_imgdiag_tests \
David Sehr67bf42e2018-02-26 16:43:04 -0800387 art_libartbase_tests \
Orion Hodson119733d2019-01-30 15:14:41 +0000388 art_libartpalette_tests \
Martin Stjernholmfdb2f602019-01-09 14:47:00 +0000389 art_libdexfile_external_tests \
Martin Stjernholm70ae00d2019-02-15 22:41:14 +0000390 art_libdexfile_support_static_tests \
Martin Stjernholm750bf042019-01-09 22:51:12 +0000391 art_libdexfile_support_tests \
David Sehr334b9d72018-02-12 18:27:56 -0800392 art_libdexfile_tests \
David Sehrd5f8de82018-04-27 14:12:03 -0700393 art_libprofile_tests \
Colin Cross6e95dd52016-09-12 15:37:10 -0700394 art_oatdump_tests \
395 art_profman_tests \
Colin Cross6e95dd52016-09-12 15:37:10 -0700396 art_runtime_compiler_tests \
Martin Stjernholm750bf042019-01-09 22:51:12 +0000397 art_runtime_tests \
Josh Gao1eac77e2018-02-26 15:54:41 -0800398 art_sigchain_tests \
Brian Carlstroma1ce1fe2014-02-24 23:23:58 -0800399
Colin Cross6e95dd52016-09-12 15:37:10 -0700400ART_TARGET_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\
401 $(ART_TEST_LIST_device_$(TARGET_ARCH)_$(m)))
Alex Light50fa9932015-08-10 15:30:07 -0700402
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100403ifdef TARGET_2ND_ARCH
4042ND_ART_TARGET_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\
405 $(ART_TEST_LIST_device_$(2ND_TARGET_ARCH)_$(m)))
406endif
407
Colin Cross6e95dd52016-09-12 15:37:10 -0700408ART_HOST_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\
Colin Cross124f8812016-09-15 20:57:47 -0700409 $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_$(m)))
Alex Light50fa9932015-08-10 15:30:07 -0700410
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100411ifneq ($(HOST_PREFER_32_BIT),true)
4122ND_ART_HOST_GTEST_FILES += $(foreach m,$(ART_TEST_MODULES),\
413 $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_$(m)))
414endif
415
Ian Rogersafd9acc2014-06-17 08:21:54 -0700416# Variables holding collections of gtest pre-requisits used to run a number of gtests.
417ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
418ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
419ART_TEST_HOST_GTEST_RULES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700420ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
421ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
422ART_TEST_TARGET_GTEST_RULES :=
Nicolas Geoffray58035ae2015-05-27 19:10:27 +0100423ART_TEST_HOST_GTEST_DEPENDENCIES :=
Nicolas Geoffray17b1dcb2018-10-12 15:09:42 +0100424ART_TEST_TARGET_GTEST_DEPENDENCIES :=
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700425
Nicolas Geoffray96a37c82014-10-29 23:50:40 +0000426ART_GTEST_TARGET_ANDROID_ROOT := '/system'
427ifneq ($(ART_TEST_ANDROID_ROOT),)
428 ART_GTEST_TARGET_ANDROID_ROOT := $(ART_TEST_ANDROID_ROOT)
429endif
430
Neil Fuller26c43772018-11-23 17:56:43 +0000431ART_GTEST_TARGET_ANDROID_RUNTIME_ROOT := '/apex/com.android.runtime'
Roland Levillain7c777f82019-01-10 18:00:37 +0000432ifneq ($(ART_TEST_ANDROID_RUNTIME_ROOT),)
433 ART_GTEST_TARGET_ANDROID_RUNTIME_ROOT := $(ART_TEST_ANDROID_RUNTIME_ROOT)
434endif
Neil Fuller26c43772018-11-23 17:56:43 +0000435
Neil Fuller26a5dd62019-03-13 15:16:35 +0000436ART_GTEST_TARGET_ANDROID_TZDATA_ROOT := '/apex/com.android.tzdata'
437ifneq ($(ART_TEST_ANDROID_TZDATA_ROOT),)
438 ART_GTEST_TARGET_ANDROID_TZDATA_ROOT := $(ART_TEST_ANDROID_TZDATA_ROOT)
439endif
440
Ian Rogersafd9acc2014-06-17 08:21:54 -0700441# Define a make rule for a target device gtest.
442# $(1): gtest name - the name of the test we're building such as leb128_test.
Colin Cross6e95dd52016-09-12 15:37:10 -0700443# $(2): path relative to $OUT to the test binary
444# $(3): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
445# $(4): LD_LIBRARY_PATH or undefined - used in case libartd.so is not in /system/lib/
Ian Rogersafd9acc2014-06-17 08:21:54 -0700446define define-art-gtest-rule-target
Roland Levillainc6d02fd2018-05-23 14:31:46 +0100447 ifeq ($(ART_TEST_CHROOT),)
448 # Non-chroot configuration.
449 maybe_art_test_chroot :=
450 maybe_chroot_command :=
451 else
452 # Chroot configuration.
453 maybe_art_test_chroot := $(ART_TEST_CHROOT)
454 maybe_chroot_command := chroot $(ART_TEST_CHROOT)
455 endif
456
Colin Cross6e95dd52016-09-12 15:37:10 -0700457 gtest_rule := test-art-target-gtest-$(1)$$($(3)ART_PHONY_TEST_TARGET_SUFFIX)
458 gtest_exe := $(OUT_DIR)/$(2)
459 gtest_target_exe := $$(patsubst $(PRODUCT_OUT)/%,/%,$$(gtest_exe))
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700460
Brian Carlstrom532714a2014-06-25 02:15:31 -0700461 # Add the test dependencies to test-art-target-sync, which will be a prerequisite for the test
Ian Rogersafd9acc2014-06-17 08:21:54 -0700462 # to ensure files are pushed to the device.
Nicolas Geoffray17b1dcb2018-10-12 15:09:42 +0100463 gtest_deps := \
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700464 $$(ART_GTEST_$(1)_TARGET_DEPS) \
Ian Rogers1a2f84e2014-07-07 16:05:18 -0700465 $(foreach file,$(ART_GTEST_$(1)_DEX_DEPS),$(ART_TEST_TARGET_GTEST_$(file)_DEX)) \
Colin Cross6e95dd52016-09-12 15:37:10 -0700466 $$(gtest_exe) \
467 $$($(3)TARGET_OUT_SHARED_LIBRARIES)/libjavacore.so \
468 $$($(3)TARGET_OUT_SHARED_LIBRARIES)/libopenjdkd.so \
Vladimir Marko0ace5632018-12-14 11:11:47 +0000469 $$(foreach jar,$$(TARGET_TEST_CORE_JARS),$$(TARGET_OUT_JAVA_LIBRARIES)/$$(jar).jar)
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700470
Nicolas Geoffray17b1dcb2018-10-12 15:09:42 +0100471 ART_TEST_TARGET_GTEST_DEPENDENCIES += $$(gtest_deps)
472
Roland Levillain05e34f42018-05-24 13:19:05 +0000473$$(gtest_rule): PRIVATE_TARGET_EXE := $$(gtest_target_exe)
474$$(gtest_rule): PRIVATE_MAYBE_CHROOT_COMMAND := $$(maybe_chroot_command)
Roland Levillain76cfe612017-10-30 13:14:28 +0000475
476# File witnessing the success of the gtest, the presence of which means the gtest's success.
Roland Levillaine1194572018-05-10 17:57:20 +0100477gtest_witness := \
Roland Levillainc6d02fd2018-05-23 14:31:46 +0100478 $$(maybe_art_test_chroot)$(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$(gtest_rule)-$$$$PPID
Roland Levillaine1194572018-05-10 17:57:20 +0100479
Roland Levillainc6d02fd2018-05-23 14:31:46 +0100480$$(gtest_rule): PRIVATE_GTEST_WITNESS := $$(gtest_witness)
Roland Levillain76cfe612017-10-30 13:14:28 +0000481
Ian Rogersafd9acc2014-06-17 08:21:54 -0700482.PHONY: $$(gtest_rule)
483$$(gtest_rule): test-art-target-sync
Nicolas Geoffray64c2d772018-08-31 09:22:44 +0100484 $(hide) $(ADB) shell touch $$(PRIVATE_GTEST_WITNESS)
485 $(hide) $(ADB) shell rm $$(PRIVATE_GTEST_WITNESS)
486 $(hide) $(ADB) shell $$(PRIVATE_MAYBE_CHROOT_COMMAND) chmod 755 $$(PRIVATE_TARGET_EXE)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700487 $(hide) $$(call ART_TEST_SKIP,$$@) && \
Nicolas Geoffray64c2d772018-08-31 09:22:44 +0100488 ($(ADB) shell "$$(PRIVATE_MAYBE_CHROOT_COMMAND) env $(GCOV_ENV) LD_LIBRARY_PATH=$(4) \
Neil Fuller26c43772018-11-23 17:56:43 +0000489 ANDROID_ROOT=$(ART_GTEST_TARGET_ANDROID_ROOT) \
490 ANDROID_RUNTIME_ROOT=$(ART_GTEST_TARGET_ANDROID_RUNTIME_ROOT) \
Neil Fuller26a5dd62019-03-13 15:16:35 +0000491 ANDROID_TZDATA_ROOT=$(ART_GTEST_TARGET_ANDROID_TZDATA_ROOT) \
Neil Fuller26c43772018-11-23 17:56:43 +0000492 $$(PRIVATE_TARGET_EXE) \
Roland Levillainc6d02fd2018-05-23 14:31:46 +0100493 && touch $$(PRIVATE_GTEST_WITNESS)" \
Nicolas Geoffray64c2d772018-08-31 09:22:44 +0100494 && ($(ADB) pull $$(PRIVATE_GTEST_WITNESS) /tmp/ && $$(call ART_TEST_PASSED,$$@)) \
Roland Levillaina42e7042017-10-30 17:24:43 +0000495 || $$(call ART_TEST_FAILED,$$@))
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700496 $(hide) rm -f /tmp/$$@-$$$$PPID
Ian Rogersafd9acc2014-06-17 08:21:54 -0700497
Colin Cross6e95dd52016-09-12 15:37:10 -0700498 ART_TEST_TARGET_GTEST$($(3)ART_PHONY_TEST_TARGET_SUFFIX)_RULES += $$(gtest_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700499 ART_TEST_TARGET_GTEST_RULES += $$(gtest_rule)
500 ART_TEST_TARGET_GTEST_$(1)_RULES += $$(gtest_rule)
501
502 # Clear locally defined variables.
Roland Levillain76cfe612017-10-30 13:14:28 +0000503 gtest_witness :=
504 maybe_chroot_command :=
505 maybe_art_test_chroot :=
Colin Cross6e95dd52016-09-12 15:37:10 -0700506 gtest_target_exe :=
Nicolas Geoffray17b1dcb2018-10-12 15:09:42 +0100507 gtest_deps :=
Roland Levillain76cfe612017-10-30 13:14:28 +0000508 gtest_exe :=
509 gtest_rule :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700510endef # define-art-gtest-rule-target
511
512# Define make rules for a host gtests.
513# $(1): gtest name - the name of the test we're building such as leb128_test.
Colin Cross6e95dd52016-09-12 15:37:10 -0700514# $(2): path relative to $OUT to the test binary
515# $(3): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700516define define-art-gtest-rule-host
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700517 gtest_suffix := $(1)$$($(3)ART_PHONY_TEST_HOST_SUFFIX)
518 gtest_rule := test-art-host-gtest-$$(gtest_suffix)
519 gtest_output := $(call intermediates-dir-for,PACKAGING,art-host-gtest,HOST)/$$(gtest_suffix).xml
Dan Willemsen0ef94572018-10-21 19:00:56 +0000520 $$(call dist-for-goals,$$(gtest_rule),$$(gtest_output):gtest/$$(gtest_suffix))
Colin Cross6e95dd52016-09-12 15:37:10 -0700521 gtest_exe := $(OUT_DIR)/$(2)
Ian Rogers665de8a2014-06-24 21:34:09 -0700522 # Dependencies for all host gtests.
523 gtest_deps := $$(HOST_CORE_DEX_LOCATIONS) \
Colin Cross6e95dd52016-09-12 15:37:10 -0700524 $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$$(ART_HOST_SHLIB_EXTENSION) \
525 $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$$(ART_HOST_SHLIB_EXTENSION) \
Nicolas Geoffray58035ae2015-05-27 19:10:27 +0100526 $$(gtest_exe) \
527 $$(ART_GTEST_$(1)_HOST_DEPS) \
Andreas Gampe28fd62a2018-12-12 15:15:22 -0800528 $(foreach file,$(ART_GTEST_$(1)_DEX_DEPS),$(ART_TEST_HOST_GTEST_$(file)_DEX)) \
529 $(HOST_OUT_EXECUTABLES)/timeout_dumper
Ian Rogers665de8a2014-06-24 21:34:09 -0700530
Nicolas Geoffray58035ae2015-05-27 19:10:27 +0100531 ART_TEST_HOST_GTEST_DEPENDENCIES += $$(gtest_deps)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700532
Andreas Gampe6acebf42018-01-22 22:15:43 -0800533.PHONY: $$(gtest_rule)
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700534$$(gtest_rule): $$(gtest_output)
535
536# Re-run the tests, even if nothing changed. Until the build system has a dedicated "no cache"
537# option, claim to write a file that is never produced.
538$$(gtest_output): .KATI_IMPLICIT_OUTPUTS := $$(gtest_output)-nocache
539$$(gtest_output): NAME := $$(gtest_rule)
Andreas Gampe6acebf42018-01-22 22:15:43 -0800540ifeq (,$(SANITIZE_HOST))
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700541$$(gtest_output): $$(gtest_exe) $$(gtest_deps)
Andreas Gampe28fd62a2018-12-12 15:15:22 -0800542 $(hide) ($$(call ART_TEST_SKIP,$$(NAME)) && \
Andreas Gampe4bdcf5d2018-12-14 10:48:53 -0800543 timeout --foreground -k 120s -s SIGRTMIN+2 2400s $(HOST_OUT_EXECUTABLES)/timeout_dumper \
Andreas Gampe28fd62a2018-12-12 15:15:22 -0800544 $$< --gtest_output=xml:$$@ && \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700545 $$(call ART_TEST_PASSED,$$(NAME))) || $$(call ART_TEST_FAILED,$$(NAME))
Andreas Gampe6acebf42018-01-22 22:15:43 -0800546else
Andreas Gampe03858052017-05-01 08:17:24 -0700547# Note: envsetup currently exports ASAN_OPTIONS=detect_leaks=0 to suppress leak detection, as some
548# build tools (e.g., ninja) intentionally leak. We want leak checks when we run our tests, so
549# override ASAN_OPTIONS. b/37751350
Andreas Gampe6acebf42018-01-22 22:15:43 -0800550# Note 2: Under sanitization, also capture the output, and run it through the stack tool on failure
551# (with the x86-64 ABI, as this allows symbolization of both x86 and x86-64). We don't do this in
552# general as it loses all the color output, and we have our own symbolization step when not running
553# under ASAN.
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700554$$(gtest_output): $$(gtest_exe) $$(gtest_deps)
555 $(hide) ($$(call ART_TEST_SKIP,$$(NAME)) && set -o pipefail && \
Andreas Gampe4bdcf5d2018-12-14 10:48:53 -0800556 ASAN_OPTIONS=detect_leaks=1 timeout --foreground -k 120s -s SIGRTMIN+2 3600s \
Andreas Gampe28fd62a2018-12-12 15:15:22 -0800557 $(HOST_OUT_EXECUTABLES)/timeout_dumper \
558 $$< --gtest_output=xml:$$@ 2>&1 | tee $$<.tmp.out >&2 && \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700559 { $$(call ART_TEST_PASSED,$$(NAME)) ; rm $$<.tmp.out ; }) || \
Andreas Gampec05fd3f2018-01-23 14:22:07 -0800560 ( grep -q AddressSanitizer $$<.tmp.out && export ANDROID_BUILD_TOP=`pwd` && \
Andreas Gampe6acebf42018-01-22 22:15:43 -0800561 { echo "ABI: 'x86_64'" | cat - $$<.tmp.out | development/scripts/stack | tail -n 3000 ; } ; \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700562 rm $$<.tmp.out ; $$(call ART_TEST_FAILED,$$(NAME)))
Andreas Gampe6acebf42018-01-22 22:15:43 -0800563endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700564
Colin Cross6e95dd52016-09-12 15:37:10 -0700565 ART_TEST_HOST_GTEST$$($(3)ART_PHONY_TEST_HOST_SUFFIX)_RULES += $$(gtest_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700566 ART_TEST_HOST_GTEST_RULES += $$(gtest_rule)
567 ART_TEST_HOST_GTEST_$(1)_RULES += $$(gtest_rule)
568
Andreas Gampe3c0bb312015-02-19 10:02:19 -0800569
Ian Rogersafd9acc2014-06-17 08:21:54 -0700570 # Clear locally defined variables.
Ian Rogers665de8a2014-06-24 21:34:09 -0700571 gtest_deps :=
Roland Levillain76cfe612017-10-30 13:14:28 +0000572 gtest_exe :=
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700573 gtest_output :=
Roland Levillain76cfe612017-10-30 13:14:28 +0000574 gtest_rule :=
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700575 gtest_suffix :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700576endef # define-art-gtest-rule-host
577
578# Define the rules to build and run host and target gtests.
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100579# $(1): file name
580# $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
581define define-art-gtest-target
582 art_gtest_filename := $(1)
Brian Carlstrom0796af02011-10-12 14:31:45 -0700583
Ian Rogersafd9acc2014-06-17 08:21:54 -0700584 include $$(CLEAR_VARS)
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -0700585 art_gtest_name := $$(notdir $$(basename $$(art_gtest_filename)))
Colin Cross6e95dd52016-09-12 15:37:10 -0700586
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100587 library_path :=
588 2ND_library_path :=
589 ifneq ($$(ART_TEST_ANDROID_ROOT),)
590 ifdef TARGET_2ND_ARCH
591 2ND_library_path := $$(ART_TEST_ANDROID_ROOT)/lib
592 library_path := $$(ART_TEST_ANDROID_ROOT)/lib64
593 else
594 ifneq ($(filter %64,$(TARGET_ARCH)),)
Nicolas Geoffray9eb40742014-10-29 22:38:53 +0000595 library_path := $$(ART_TEST_ANDROID_ROOT)/lib64
596 else
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100597 library_path := $$(ART_TEST_ANDROID_ROOT)/lib
Nicolas Geoffray9eb40742014-10-29 22:38:53 +0000598 endif
599 endif
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100600 endif
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -0700601
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100602 ifndef ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700603 ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES :=
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100604 endif
605 $$(eval $$(call define-art-gtest-rule-target,$$(art_gtest_name),$$(art_gtest_filename),$(2),$$($(2)library_path)))
606
607 # Clear locally defined variables.
608 art_gtest_filename :=
609 art_gtest_name :=
610 library_path :=
611 2ND_library_path :=
612endef # define-art-gtest-target
613
614# $(1): file name
615# $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
616define define-art-gtest-host
617 art_gtest_filename := $(1)
618
619 include $$(CLEAR_VARS)
620 art_gtest_name := $$(notdir $$(basename $$(art_gtest_filename)))
621 ifndef ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES
622 ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES :=
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100623 endif
624 $$(eval $$(call define-art-gtest-rule-host,$$(art_gtest_name),$$(art_gtest_filename),$(2)))
625
626 # Clear locally defined variables.
627 art_gtest_filename :=
628 art_gtest_name :=
629endef # define-art-gtest-host
630
631# Define the rules to build and run gtests for both archs on target.
632# $(1): test name
633define define-art-gtest-target-both
634 art_gtest_name := $(1)
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700635
Ian Rogersafd9acc2014-06-17 08:21:54 -0700636 # A rule to run the different architecture versions of the gtest.
637.PHONY: test-art-target-gtest-$$(art_gtest_name)
638test-art-target-gtest-$$(art_gtest_name): $$(ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES)
639 $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
640
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100641 # Clear now unused variables.
642 ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES :=
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100643 art_gtest_name :=
644endef # define-art-gtest-target-both
Ian Rogersd912e5c2013-11-13 12:40:11 -0800645
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100646# Define the rules to build and run gtests for both archs on host.
647# $(1): test name
648define define-art-gtest-host-both
649 art_gtest_name := $(1)
650
Ian Rogersafd9acc2014-06-17 08:21:54 -0700651.PHONY: test-art-host-gtest-$$(art_gtest_name)
652test-art-host-gtest-$$(art_gtest_name): $$(ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES)
653 $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
Ian Rogersd912e5c2013-11-13 12:40:11 -0800654
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100655 # Clear now unused variables.
656 ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700657 art_gtest_name :=
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100658endef # define-art-gtest-host-both
Alex Light50fa9932015-08-10 15:30:07 -0700659
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700660ifeq ($(ART_BUILD_TARGET),true)
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100661 $(foreach file,$(ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest-target,$(file),)))
Dan Willemsen5d2dbf82018-04-11 12:31:11 -0700662 ifdef 2ND_ART_PHONY_TEST_TARGET_SUFFIX
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100663 $(foreach file,$(2ND_ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest-target,$(file),2ND_)))
664 endif
665 # Rules to run the different architecture versions of the gtest.
666 $(foreach file,$(ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest-target-both,$$(notdir $$(basename $$(file))))))
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700667endif
Ian Rogersc5f17732014-06-05 20:48:42 -0700668ifeq ($(ART_BUILD_HOST),true)
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100669 $(foreach file,$(ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host,$(file),)))
670 ifneq ($(HOST_PREFER_32_BIT),true)
671 $(foreach file,$(2ND_ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host,$(file),2ND_)))
672 endif
673 # Rules to run the different architecture versions of the gtest.
674 $(foreach file,$(ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host-both,$$(notdir $$(basename $$(file))))))
Brian Carlstrom07d579f2011-07-27 13:31:51 -0700675endif
Tsu Chiang Chuangec245a42014-05-15 21:16:21 -0700676
677# Used outside the art project to get a list of the current tests
678RUNTIME_TARGET_GTEST_MAKE_TARGETS :=
Dan Willemsencf767de2018-04-10 16:40:10 -0700679$(foreach file, $(ART_TARGET_GTEST_FILES), $(eval RUNTIME_TARGET_GTEST_MAKE_TARGETS += $$(notdir $$(patsubst %/,%,$$(dir $$(file))))_$$(notdir $$(basename $$(file)))))
Tsu Chiang Chuangec245a42014-05-15 21:16:21 -0700680COMPILER_TARGET_GTEST_MAKE_TARGETS :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700681
Roland Levillain05e34f42018-05-24 13:19:05 +0000682# Define all the combinations of host/target and suffix such as:
683# test-art-host-gtest or test-art-host-gtest64
Ian Rogersafd9acc2014-06-17 08:21:54 -0700684# $(1): host or target
685# $(2): HOST or TARGET
Roland Levillain05e34f42018-05-24 13:19:05 +0000686# $(3): undefined, 32 or 64
Ian Rogersafd9acc2014-06-17 08:21:54 -0700687define define-test-art-gtest-combination
688 ifeq ($(1),host)
689 ifneq ($(2),HOST)
690 $$(error argument mismatch $(1) and ($2))
691 endif
692 else
693 ifneq ($(1),target)
694 $$(error found $(1) expected host or target)
695 endif
696 ifneq ($(2),TARGET)
697 $$(error argument mismatch $(1) and ($2))
698 endif
699 endif
700
Roland Levillain05e34f42018-05-24 13:19:05 +0000701 rule_name := test-art-$(1)-gtest$(3)
702 dependencies := $$(ART_TEST_$(2)_GTEST$(3)_RULES)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700703
704.PHONY: $$(rule_name)
Orion Hodson64fe3be2018-06-15 12:50:22 +0100705$$(rule_name): $$(dependencies) d8 d8-compat-dx
Ian Rogersafd9acc2014-06-17 08:21:54 -0700706 $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
707
708 # Clear locally defined variables.
709 rule_name :=
710 dependencies :=
711endef # define-test-art-gtest-combination
712
Roland Levillain05e34f42018-05-24 13:19:05 +0000713$(eval $(call define-test-art-gtest-combination,target,TARGET,))
714$(eval $(call define-test-art-gtest-combination,target,TARGET,$(ART_PHONY_TEST_TARGET_SUFFIX)))
Dan Willemsen5d2dbf82018-04-11 12:31:11 -0700715ifdef 2ND_ART_PHONY_TEST_TARGET_SUFFIX
Roland Levillain05e34f42018-05-24 13:19:05 +0000716$(eval $(call define-test-art-gtest-combination,target,TARGET,$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700717endif
Roland Levillain05e34f42018-05-24 13:19:05 +0000718$(eval $(call define-test-art-gtest-combination,host,HOST,))
719$(eval $(call define-test-art-gtest-combination,host,HOST,$(ART_PHONY_TEST_HOST_SUFFIX)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700720ifneq ($(HOST_PREFER_32_BIT),true)
Roland Levillain05e34f42018-05-24 13:19:05 +0000721$(eval $(call define-test-art-gtest-combination,host,HOST,$(2ND_ART_PHONY_TEST_HOST_SUFFIX)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700722endif
723
724# Clear locally defined variables.
725define-art-gtest-rule-target :=
726define-art-gtest-rule-host :=
727define-art-gtest :=
728define-test-art-gtest-combination :=
729RUNTIME_GTEST_COMMON_SRC_FILES :=
730COMPILER_GTEST_COMMON_SRC_FILES :=
731RUNTIME_GTEST_TARGET_SRC_FILES :=
732RUNTIME_GTEST_HOST_SRC_FILES :=
733COMPILER_GTEST_TARGET_SRC_FILES :=
734COMPILER_GTEST_HOST_SRC_FILES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700735ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
736ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
737ART_TEST_HOST_GTEST_RULES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700738ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
739ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
740ART_TEST_TARGET_GTEST_RULES :=
Nicolas Geoffray96a37c82014-10-29 23:50:40 +0000741ART_GTEST_TARGET_ANDROID_ROOT :=
Neil Fuller26c43772018-11-23 17:56:43 +0000742ART_GTEST_TARGET_ANDROID_RUNTIME_ROOT :=
Neil Fuller26a5dd62019-03-13 15:16:35 +0000743ART_GTEST_TARGET_ANDROID_TZDATA_ROOT :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700744ART_GTEST_class_linker_test_DEX_DEPS :=
Mathieu Chartierdb70ce52016-12-12 11:06:59 -0800745ART_GTEST_class_table_test_DEX_DEPS :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700746ART_GTEST_compiler_driver_test_DEX_DEPS :=
747ART_GTEST_dex_file_test_DEX_DEPS :=
748ART_GTEST_exception_test_DEX_DEPS :=
749ART_GTEST_elf_writer_test_HOST_DEPS :=
750ART_GTEST_elf_writer_test_TARGET_DEPS :=
Andreas Gampea1ff30f2016-09-27 12:19:45 -0700751ART_GTEST_imtable_test_DEX_DEPS :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700752ART_GTEST_jni_compiler_test_DEX_DEPS :=
753ART_GTEST_jni_internal_test_DEX_DEPS :=
Richard Uhler66d874d2015-01-15 09:37:19 -0800754ART_GTEST_oat_file_assistant_test_DEX_DEPS :=
755ART_GTEST_oat_file_assistant_test_HOST_DEPS :=
756ART_GTEST_oat_file_assistant_test_TARGET_DEPS :=
Mathieu Chartier0be7fa72018-04-12 10:13:29 -0700757ART_GTEST_dexanalyze_test_DEX_DEPS :=
Calin Juravle36eb3132017-01-13 16:32:38 -0800758ART_GTEST_dexoptanalyzer_test_DEX_DEPS :=
759ART_GTEST_dexoptanalyzer_test_HOST_DEPS :=
760ART_GTEST_dexoptanalyzer_test_TARGET_DEPS :=
Richard Uhler84f50ae2017-02-06 15:12:45 +0000761ART_GTEST_image_space_test_DEX_DEPS :=
762ART_GTEST_image_space_test_HOST_DEPS :=
763ART_GTEST_image_space_test_TARGET_DEPS :=
Andreas Gampee1459ae2016-06-29 09:36:30 -0700764ART_GTEST_dex2oat_test_DEX_DEPS :=
765ART_GTEST_dex2oat_test_HOST_DEPS :=
766ART_GTEST_dex2oat_test_TARGET_DEPS :=
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700767ART_GTEST_dex2oat_image_test_DEX_DEPS :=
768ART_GTEST_dex2oat_image_test_HOST_DEPS :=
769ART_GTEST_dex2oat_image_test_TARGET_DEPS :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700770ART_GTEST_object_test_DEX_DEPS :=
771ART_GTEST_proxy_test_DEX_DEPS :=
772ART_GTEST_reflection_test_DEX_DEPS :=
773ART_GTEST_stub_test_DEX_DEPS :=
774ART_GTEST_transaction_test_DEX_DEPS :=
Andreas Gampee1459ae2016-06-29 09:36:30 -0700775ART_GTEST_dex2oat_environment_tests_DEX_DEPS :=
Mathieu Chartier1ca68902017-04-18 11:26:22 -0700776ART_GTEST_heap_verification_test_DEX_DEPS :=
David Brazdilca3c8c32016-09-06 14:04:48 +0100777ART_GTEST_verifier_deps_test_DEX_DEPS :=
Ian Rogers1a2f84e2014-07-07 16:05:18 -0700778$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_TARGET_GTEST_$(dir)_DEX :=))
779$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_HOST_GTEST_$(dir)_DEX :=))
Richard Uhler66d874d2015-01-15 09:37:19 -0800780ART_TEST_HOST_GTEST_MainStripped_DEX :=
781ART_TEST_TARGET_GTEST_MainStripped_DEX :=
Nicolas Geoffrayf3075272018-01-08 12:41:19 +0000782ART_TEST_HOST_GTEST_MainUncompressed_DEX :=
783ART_TEST_TARGET_GTEST_MainUncompressed_DEX :=
Mathieu Chartier700a9852018-02-06 18:27:38 -0800784ART_TEST_HOST_GTEST_EmptyUncompressed_DEX :=
785ART_TEST_TARGET_GTEST_EmptyUncompressed_DEX :=
David Brazdilca3c8c32016-09-06 14:04:48 +0100786ART_TEST_GTEST_VerifierDeps_SRC :=
787ART_TEST_HOST_GTEST_VerifierDeps_DEX :=
David Brazdilf906f122016-09-16 16:33:31 +0100788ART_TEST_TARGET_GTEST_VerifierDeps_DEX :=
Vladimir Markod79b37b2018-11-02 13:06:22 +0000789ART_TEST_GTEST_VerifySoftFailDuringClinit_SRC :=
790ART_TEST_HOST_GTEST_VerifySoftFailDuringClinit_DEX :=
791ART_TEST_TARGET_GTEST_VerifySoftFailDuringClinit_DEX :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700792GTEST_DEX_DIRECTORIES :=
Brian Carlstrom532714a2014-06-25 02:15:31 -0700793LOCAL_PATH :=