blob: 7c2d6ba824e6f4badad73646dfbac1cd746eb6e6 [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
David Srbecky883c1342020-05-11 23:30:29 +000017# Build rules are excluded from Mac, since we can not run ART tests there in the first place.
18ifneq ($(HOST_OS),darwin)
19
Ian Rogersafd9acc2014-06-17 08:21:54 -070020# The path for which all the dex files are relative, not actually the current directory.
21LOCAL_PATH := art/test
22
23include art/build/Android.common_test.mk
24include art/build/Android.common_path.mk
Alex Light50fa9932015-08-10 15:30:07 -070025include art/build/Android.common_build.mk
Ian Rogersafd9acc2014-06-17 08:21:54 -070026
27# Subdirectories in art/test which contain dex files used as inputs for gtests.
28GTEST_DEX_DIRECTORIES := \
29 AbstractMethod \
30 AllFields \
Artem Udovichenkob3f2b5c2017-01-31 11:49:33 +030031 DefaultMethods \
Nicolas Geoffray01b70e82016-11-17 10:58:36 +000032 DexToDexDecompiler \
Mathieu Chartier1e4841e2016-12-15 14:21:04 -080033 ErroneousA \
34 ErroneousB \
Vladimir Marko72ab6842017-01-20 19:32:50 +000035 ErroneousInit \
Vladimir Markofdd46842020-03-25 14:57:17 +000036 Extension1 \
37 Extension2 \
Calin Juravlecdd49122017-07-05 20:09:53 -070038 ForClassLoaderA \
39 ForClassLoaderB \
40 ForClassLoaderC \
41 ForClassLoaderD \
Ian Rogersafd9acc2014-06-17 08:21:54 -070042 ExceptionHandle \
43 GetMethodSignature \
David Brazdil2b9c35b2018-01-12 15:44:43 +000044 HiddenApi \
Mathew Inwood7d74ef52018-03-16 14:18:33 +000045 HiddenApiSignatures \
David Brazdil2da3cbb2019-01-30 16:17:50 +000046 HiddenApiStubs \
Mathieu Chartier496577f2016-09-20 15:33:31 -070047 ImageLayoutA \
48 ImageLayoutB \
Andreas Gampea1ff30f2016-09-27 12:19:45 -070049 IMTA \
50 IMTB \
Sebastien Hertz0462c4c2015-04-01 16:34:17 +020051 Instrumentation \
Ian Rogersafd9acc2014-06-17 08:21:54 -070052 Interfaces \
Artem Udovichenkod9786b02015-10-14 16:36:55 +030053 Lookup \
Ian Rogersafd9acc2014-06-17 08:21:54 -070054 Main \
Mathieu Chartierd00e02b2017-05-24 12:04:13 -070055 ManyMethods \
Narayan Kamath25352fc2016-08-03 12:46:58 +010056 MethodTypes \
Richard Uhler66d874d2015-01-15 09:37:19 -080057 MultiDex \
Richard Uhler67ff7d12015-05-14 13:21:13 -070058 MultiDexModifiedSecondary \
Ian Rogersafd9acc2014-06-17 08:21:54 -070059 MyClass \
60 MyClassNatives \
61 Nested \
62 NonStaticLeafMethods \
Mathieu Chartier279ac5c2016-09-08 17:34:25 -070063 Packages \
Ian Rogersafd9acc2014-06-17 08:21:54 -070064 ProtoCompare \
65 ProtoCompare2 \
Calin Juravle877fd962016-01-05 14:29:29 +000066 ProfileTestMultiDex \
Ian Rogersafd9acc2014-06-17 08:21:54 -070067 StaticLeafMethods \
68 Statics \
69 StaticsFromCode \
Mathieu Chartiercd0f38f2018-10-15 09:44:35 -070070 StringLiterals \
Ian Rogersafd9acc2014-06-17 08:21:54 -070071 Transaction \
72 XandY
73
74# Create build rules for each dex file recording the dependency.
75$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval $(call build-art-test-dex,art-gtest,$(dir), \
Ian Rogers1a2f84e2014-07-07 16:05:18 -070076 $(ART_TARGET_NATIVETEST_OUT),art/build/Android.gtest.mk,ART_TEST_TARGET_GTEST_$(dir)_DEX, \
77 ART_TEST_HOST_GTEST_$(dir)_DEX)))
Ian Rogersafd9acc2014-06-17 08:21:54 -070078
Richard Uhler66d874d2015-01-15 09:37:19 -080079# Create rules for MainStripped, a copy of Main with the classes.dex stripped
80# for the oat file assistant tests.
81ART_TEST_HOST_GTEST_MainStripped_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
82ART_TEST_TARGET_GTEST_MainStripped_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
83
David Srbecky8c8f1482020-02-05 20:17:10 +000084# Create rules for MainUncompressedAligned, a copy of Main with the classes.dex uncompressed
Nicolas Geoffrayf3075272018-01-08 12:41:19 +000085# for the dex2oat tests.
David Srbecky8c8f1482020-02-05 20:17:10 +000086ART_TEST_HOST_GTEST_MainUncompressedAligned_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))UncompressedAligned$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
87ART_TEST_TARGET_GTEST_MainUncompressedAligned_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))UncompressedAligned$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
Nicolas Geoffrayf3075272018-01-08 12:41:19 +000088
Mathieu Chartier700a9852018-02-06 18:27:38 -080089# Create rules for UncompressedEmpty, a classes.dex that is empty and uncompressed
90# for the dex2oat tests.
91ART_TEST_HOST_GTEST_EmptyUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))EmptyUncompressed$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
92ART_TEST_TARGET_GTEST_EmptyUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))EmptyUncompressed$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
93
Nicolas Geoffrayc36a8cc2019-04-29 13:37:42 +010094# Create rules for UncompressedEmptyAligned, a classes.dex that is empty, uncompressed,
95# and 4 byte aligned for the dex2oat tests.
96ART_TEST_HOST_GTEST_EmptyUncompressedAligned_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))EmptyUncompressedAligned$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
97ART_TEST_TARGET_GTEST_EmptyUncompressedAligned_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))EmptyUncompressedAligned$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
98
David Srbecky8c8f1482020-02-05 20:17:10 +000099# Create rules for MultiDexUncompressedAligned, a copy of MultiDex with the classes.dex uncompressed
Andreas Gampefc604a72018-02-08 15:43:37 -0800100# for the OatFile tests.
David Srbecky8c8f1482020-02-05 20:17:10 +0000101ART_TEST_HOST_GTEST_MultiDexUncompressedAligned_DEX := $(basename $(ART_TEST_HOST_GTEST_MultiDex_DEX))UncompressedAligned$(suffix $(ART_TEST_HOST_GTEST_MultiDex_DEX))
102ART_TEST_TARGET_GTEST_MultiDexUncompressedAligned_DEX := $(basename $(ART_TEST_TARGET_GTEST_MultiDex_DEX))UncompressedAligned$(suffix $(ART_TEST_TARGET_GTEST_MultiDex_DEX))
Andreas Gampefc604a72018-02-08 15:43:37 -0800103
Dan Willemsen17769622018-04-06 13:26:36 -0700104ifdef ART_TEST_HOST_GTEST_Main_DEX
Richard Uhler66d874d2015-01-15 09:37:19 -0800105$(ART_TEST_HOST_GTEST_MainStripped_DEX): $(ART_TEST_HOST_GTEST_Main_DEX)
106 cp $< $@
107 $(call dexpreopt-remove-classes.dex,$@)
Dan Willemsen17769622018-04-06 13:26:36 -0700108endif
Richard Uhler66d874d2015-01-15 09:37:19 -0800109
Dan Willemsen17769622018-04-06 13:26:36 -0700110ifdef ART_TEST_TARGET_GTEST_Main_DEX
Richard Uhler66d874d2015-01-15 09:37:19 -0800111$(ART_TEST_TARGET_GTEST_MainStripped_DEX): $(ART_TEST_TARGET_GTEST_Main_DEX)
112 cp $< $@
113 $(call dexpreopt-remove-classes.dex,$@)
Dan Willemsen17769622018-04-06 13:26:36 -0700114endif
Richard Uhler66d874d2015-01-15 09:37:19 -0800115
Dan Willemsen17769622018-04-06 13:26:36 -0700116ifdef ART_TEST_HOST_GTEST_Main_DEX
David Srbecky8c8f1482020-02-05 20:17:10 +0000117$(ART_TEST_HOST_GTEST_MainUncompressedAligned_DEX): $(ART_TEST_HOST_GTEST_Main_DEX) $(ZIPALIGN)
Nicolas Geoffrayf3075272018-01-08 12:41:19 +0000118 cp $< $@
119 $(call uncompress-dexs, $@)
120 $(call align-package, $@)
Dan Willemsen17769622018-04-06 13:26:36 -0700121endif
Nicolas Geoffrayf3075272018-01-08 12:41:19 +0000122
Dan Willemsen17769622018-04-06 13:26:36 -0700123ifdef ART_TEST_TARGET_GTEST_Main_DEX
David Srbecky8c8f1482020-02-05 20:17:10 +0000124$(ART_TEST_TARGET_GTEST_MainUncompressedAligned_DEX): $(ART_TEST_TARGET_GTEST_Main_DEX) $(ZIPALIGN)
Nicolas Geoffrayf3075272018-01-08 12:41:19 +0000125 cp $< $@
126 $(call uncompress-dexs, $@)
127 $(call align-package, $@)
Dan Willemsen17769622018-04-06 13:26:36 -0700128endif
Nicolas Geoffrayf3075272018-01-08 12:41:19 +0000129
Dan Willemsen17769622018-04-06 13:26:36 -0700130ifdef ART_TEST_HOST_GTEST_Main_DEX
Nicolas Geoffrayc36a8cc2019-04-29 13:37:42 +0100131$(ART_TEST_HOST_GTEST_EmptyUncompressed_DEX):
Nicolas Geoffray917cfdb2019-05-02 10:53:22 +0100132 touch $@_classes.dex
133 zip -j -qD -X -0 $@ $@_classes.dex
134 rm $@_classes.dex
Dan Willemsen17769622018-04-06 13:26:36 -0700135endif
Mathieu Chartier700a9852018-02-06 18:27:38 -0800136
Dan Willemsen17769622018-04-06 13:26:36 -0700137ifdef ART_TEST_TARGET_GTEST_Main_DEX
Nicolas Geoffrayc36a8cc2019-04-29 13:37:42 +0100138$(ART_TEST_TARGET_GTEST_EmptyUncompressed_DEX):
Nicolas Geoffray917cfdb2019-05-02 10:53:22 +0100139 touch $@_classes.dex
140 zip -j -qD -X -0 $@ $@_classes.dex
141 rm $@_classes.dex
Dan Willemsen17769622018-04-06 13:26:36 -0700142endif
Mathieu Chartier700a9852018-02-06 18:27:38 -0800143
Nicolas Geoffrayc36a8cc2019-04-29 13:37:42 +0100144ifdef ART_TEST_HOST_GTEST_Main_DEX
145$(ART_TEST_HOST_GTEST_EmptyUncompressedAligned_DEX): $(ZIPALIGN)
Nicolas Geoffray917cfdb2019-05-02 10:53:22 +0100146 touch $@_classes.dex
147 zip -j -0 $@_temp.zip $@_classes.dex
148 $(ZIPALIGN) -f 4 $@_temp.zip $@
149 rm $@_classes.dex
150 rm $@_temp.zip
Nicolas Geoffrayc36a8cc2019-04-29 13:37:42 +0100151endif
152
153ifdef ART_TEST_TARGET_GTEST_Main_DEX
154$(ART_TEST_TARGET_GTEST_EmptyUncompressedAligned_DEX): $(ZIPALIGN)
Nicolas Geoffray917cfdb2019-05-02 10:53:22 +0100155 touch $@_classes.dex
156 zip -j -0 $@_temp.zip $@_classes.dex
157 $(ZIPALIGN) -f 4 $@_temp.zip $@
158 rm $@_classes.dex
159 rm $@_temp.zip
Nicolas Geoffrayc36a8cc2019-04-29 13:37:42 +0100160endif
161
Dan Willemsen17769622018-04-06 13:26:36 -0700162ifdef ART_TEST_HOST_GTEST_MultiDex_DEX
David Srbecky8c8f1482020-02-05 20:17:10 +0000163$(ART_TEST_HOST_GTEST_MultiDexUncompressedAligned_DEX): $(ART_TEST_HOST_GTEST_MultiDex_DEX) $(ZIPALIGN)
Andreas Gampefc604a72018-02-08 15:43:37 -0800164 cp $< $@
165 $(call uncompress-dexs, $@)
166 $(call align-package, $@)
Dan Willemsen17769622018-04-06 13:26:36 -0700167endif
Andreas Gampefc604a72018-02-08 15:43:37 -0800168
Dan Willemsen17769622018-04-06 13:26:36 -0700169ifdef ART_TEST_TARGET_GTEST_MultiDex_DEX
David Srbecky8c8f1482020-02-05 20:17:10 +0000170$(ART_TEST_TARGET_GTEST_MultiDexUncompressedAligned_DEX): $(ART_TEST_TARGET_GTEST_MultiDex_DEX) $(ZIPALIGN)
Andreas Gampefc604a72018-02-08 15:43:37 -0800171 cp $< $@
172 $(call uncompress-dexs, $@)
173 $(call align-package, $@)
Dan Willemsen17769622018-04-06 13:26:36 -0700174endif
Andreas Gampefc604a72018-02-08 15:43:37 -0800175
David Brazdilca3c8c32016-09-06 14:04:48 +0100176ART_TEST_GTEST_VerifierDeps_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifierDeps/*.smali))
Nicolas Geoffray7cc3ae52017-03-07 14:33:37 +0000177ART_TEST_GTEST_VerifierDepsMulti_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifierDepsMulti/*.smali))
David Brazdilca3c8c32016-09-06 14:04:48 +0100178ART_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 +0100179ART_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 +0000180ART_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))
181ART_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 +0100182
183$(ART_TEST_HOST_GTEST_VerifierDeps_DEX): $(ART_TEST_GTEST_VerifierDeps_SRC) $(HOST_OUT_EXECUTABLES)/smali
Ben Gruver14fc9db2017-04-28 15:30:49 -0700184 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
David Brazdilca3c8c32016-09-06 14:04:48 +0100185
David Brazdilf906f122016-09-16 16:33:31 +0100186$(ART_TEST_TARGET_GTEST_VerifierDeps_DEX): $(ART_TEST_GTEST_VerifierDeps_SRC) $(HOST_OUT_EXECUTABLES)/smali
Ben Gruver14fc9db2017-04-28 15:30:49 -0700187 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
David Brazdilf906f122016-09-16 16:33:31 +0100188
Nicolas Geoffray7cc3ae52017-03-07 14:33:37 +0000189$(ART_TEST_HOST_GTEST_VerifierDepsMulti_DEX): $(ART_TEST_GTEST_VerifierDepsMulti_SRC) $(HOST_OUT_EXECUTABLES)/smali
Ben Gruver14fc9db2017-04-28 15:30:49 -0700190 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
Nicolas Geoffray7cc3ae52017-03-07 14:33:37 +0000191
192$(ART_TEST_TARGET_GTEST_VerifierDepsMulti_DEX): $(ART_TEST_GTEST_VerifierDepsMulti_SRC) $(HOST_OUT_EXECUTABLES)/smali
Ben Gruver14fc9db2017-04-28 15:30:49 -0700193 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
Nicolas Geoffray7cc3ae52017-03-07 14:33:37 +0000194
Vladimir Markod79b37b2018-11-02 13:06:22 +0000195ART_TEST_GTEST_VerifySoftFailDuringClinit_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifySoftFailDuringClinit/*.smali))
196ART_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))
197ART_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))
198
199$(ART_TEST_HOST_GTEST_VerifySoftFailDuringClinit_DEX): $(ART_TEST_GTEST_VerifySoftFailDuringClinit_SRC) $(HOST_OUT_EXECUTABLES)/smali
200 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
201
202$(ART_TEST_TARGET_GTEST_VerifySoftFailDuringClinit_DEX): $(ART_TEST_GTEST_VerifySoftFailDuringClinit_SRC) $(HOST_OUT_EXECUTABLES)/smali
203 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
204
David Sehrfe57c2b2020-03-27 14:58:54 +0000205# Linkage test artifacts.
206ART_TEST_GTEST_LinkageTest_SRC := $(abspath $(wildcard $(LOCAL_PATH)/LinkageTest/*.smali))
207ART_TEST_HOST_GTEST_LinkageTest_DEX := $(dir $(ART_TEST_HOST_GTEST_Main_DEX))$(subst Main,LinkageTest,$(basename $(notdir $(ART_TEST_HOST_GTEST_Main_DEX))))$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
208$(ART_TEST_HOST_GTEST_LinkageTest_DEX): $(ART_TEST_GTEST_LinkageTest_SRC) $(HOST_OUT_EXECUTABLES)/smali
209 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
210
Ian Rogersafd9acc2014-06-17 08:21:54 -0700211# Dex file dependencies for each gtest.
David Sehr139512d2018-02-08 15:44:50 -0800212ART_GTEST_art_dex_file_loader_test_DEX_DEPS := GetMethodSignature Main Nested MultiDex
David Sehrfe57c2b2020-03-27 14:58:54 +0000213ART_GTEST_dex2oat_environment_tests_DEX_DEPS := Main MainStripped MultiDex MultiDexModifiedSecondary MyClassNatives Nested VerifierDeps VerifierDepsMulti LinkageTest
Andreas Gampee1459ae2016-06-29 09:36:30 -0700214
Mathieu Chartier93764b82017-07-17 14:51:53 -0700215ART_GTEST_atomic_dex_ref_map_test_DEX_DEPS := Interfaces
Calin Juravlecdd49122017-07-05 20:09:53 -0700216ART_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 -0700217ART_GTEST_class_loader_context_test_DEX_DEPS := Main MultiDex MyClass ForClassLoaderA ForClassLoaderB ForClassLoaderC ForClassLoaderD
Mathieu Chartierdb70ce52016-12-12 11:06:59 -0800218ART_GTEST_class_table_test_DEX_DEPS := XandY
Calin Juravle877fd962016-01-05 14:29:29 +0000219ART_GTEST_compiler_driver_test_DEX_DEPS := AbstractMethod StaticLeafMethods ProfileTestMultiDex
Narayan Kamath25352fc2016-08-03 12:46:58 +0100220ART_GTEST_dex_cache_test_DEX_DEPS := Main Packages MethodTypes
Mathieu Chartier2e0478a2018-04-06 14:33:25 -0700221ART_GTEST_dexanalyze_test_DEX_DEPS := MultiDex
Mathieu Chartierd00e02b2017-05-24 12:04:13 -0700222ART_GTEST_dexlayout_test_DEX_DEPS := ManyMethods
David Srbecky8c8f1482020-02-05 20:17:10 +0000223ART_GTEST_dex2oat_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) ManyMethods Statics VerifierDeps MainUncompressedAligned EmptyUncompressed EmptyUncompressedAligned StringLiterals
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700224ART_GTEST_dex2oat_image_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) Statics VerifierDeps
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700225ART_GTEST_exception_test_DEX_DEPS := ExceptionHandle
David Brazdil2da3cbb2019-01-30 16:17:50 +0000226ART_GTEST_hiddenapi_test_DEX_DEPS := HiddenApi HiddenApiStubs
David Brazdila5c3a802019-03-08 14:59:41 +0000227ART_GTEST_hidden_api_test_DEX_DEPS := HiddenApiSignatures Main MultiDex
Vladimir Markod79b37b2018-11-02 13:06:22 +0000228ART_GTEST_image_test_DEX_DEPS := ImageLayoutA ImageLayoutB DefaultMethods VerifySoftFailDuringClinit
Andreas Gampea1ff30f2016-09-27 12:19:45 -0700229ART_GTEST_imtable_test_DEX_DEPS := IMTA IMTB
Sebastien Hertz0462c4c2015-04-01 16:34:17 +0200230ART_GTEST_instrumentation_test_DEX_DEPS := Instrumentation
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700231ART_GTEST_jni_compiler_test_DEX_DEPS := MyClassNatives
Nicolas Geoffray928567b2018-08-01 10:21:12 +0100232ART_GTEST_jni_internal_test_DEX_DEPS := AllFields StaticLeafMethods MyClassNatives
Andreas Gampee1459ae2016-06-29 09:36:30 -0700233ART_GTEST_oat_file_assistant_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS)
Calin Juravle36eb3132017-01-13 16:32:38 -0800234ART_GTEST_dexoptanalyzer_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS)
Vladimir Markofdd46842020-03-25 14:57:17 +0000235ART_GTEST_image_space_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) Extension1 Extension2
David Srbecky8c8f1482020-02-05 20:17:10 +0000236ART_GTEST_oat_file_test_DEX_DEPS := Main MultiDex MainUncompressedAligned MultiDexUncompressedAligned MainStripped Nested MultiDexModifiedSecondary
Mathieu Chartier07ddb6f2015-11-05 11:16:34 -0800237ART_GTEST_oat_test_DEX_DEPS := Main
Roland Levillain1f130f12018-03-12 18:39:19 +0000238ART_GTEST_oat_writer_test_DEX_DEPS := Main
Nicolas Geoffray975b7742019-03-21 17:37:38 +0000239# two_runtimes_test build off dex2oat_environment_test, which does sanity checks on the following dex files.
240ART_GTEST_two_runtimes_test_DEX_DEPS := Main MainStripped Nested MultiDex MultiDexModifiedSecondary
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700241ART_GTEST_object_test_DEX_DEPS := ProtoCompare ProtoCompare2 StaticsFromCode XandY
242ART_GTEST_proxy_test_DEX_DEPS := Interfaces
243ART_GTEST_reflection_test_DEX_DEPS := Main NonStaticLeafMethods StaticLeafMethods
Calin Juravle877fd962016-01-05 14:29:29 +0000244ART_GTEST_profile_assistant_test_DEX_DEPS := ProfileTestMultiDex
Mathieu Chartierdb40eac2017-06-09 18:34:11 -0700245ART_GTEST_profile_compilation_info_test_DEX_DEPS := ManyMethods ProfileTestMultiDex
Nicolas Geoffraycaf8f4c2019-10-08 18:47:48 +0100246ART_GTEST_profile_boot_info_test_DEX_DEPS := ManyMethods ProfileTestMultiDex MultiDex
Nicolas Geoffray44078f92018-10-01 12:57:55 +0100247ART_GTEST_profiling_info_test_DEX_DEPS := ProfileTestMultiDex
Andreas Gampe0f01b582017-01-18 15:22:37 -0800248ART_GTEST_runtime_callbacks_test_DEX_DEPS := XandY
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700249ART_GTEST_stub_test_DEX_DEPS := AllFields
250ART_GTEST_transaction_test_DEX_DEPS := Transaction
Artem Udovichenkod9786b02015-10-14 16:36:55 +0300251ART_GTEST_type_lookup_table_test_DEX_DEPS := Lookup
Andreas Gampeae78c262017-02-01 20:40:44 -0800252ART_GTEST_unstarted_runtime_test_DEX_DEPS := Nested
Mathieu Chartier1ca68902017-04-18 11:26:22 -0700253ART_GTEST_heap_verification_test_DEX_DEPS := ProtoCompare ProtoCompare2 StaticsFromCode XandY
Nicolas Geoffray7cc3ae52017-03-07 14:33:37 +0000254ART_GTEST_verifier_deps_test_DEX_DEPS := VerifierDeps VerifierDepsMulti MultiDex
Nicolas Geoffray01b70e82016-11-17 10:58:36 +0000255ART_GTEST_dex_to_dex_decompiler_test_DEX_DEPS := VerifierDeps DexToDexDecompiler
Vladimir Marko421087b2018-02-27 11:00:17 +0000256ART_GTEST_oatdump_app_test_DEX_DEPS := ProfileTestMultiDex
Nicolas Geoffray3ad2c2b2019-01-26 00:19:38 +0000257ART_GTEST_oatdump_test_DEX_DEPS := ProfileTestMultiDex
Andreas Gampeb5204f42019-06-25 12:39:15 -0700258ART_GTEST_reg_type_test_DEX_DEPS := Interfaces
Ian Rogersafd9acc2014-06-17 08:21:54 -0700259
David Srbecky928d28e2020-04-01 17:50:51 +0100260# Deprecated core.art dependencies.
261HOST_CORE_IMAGE_DEFAULT_32 :=
262HOST_CORE_IMAGE_DEFAULT_64 :=
263TARGET_CORE_IMAGE_DEFAULT_32 :=
264TARGET_CORE_IMAGE_DEFAULT_64 :=
265
Ian Rogersafd9acc2014-06-17 08:21:54 -0700266# The elf writer test has dependencies on core.oat.
Richard Uhler67e1dc52017-02-06 16:50:17 +0000267ART_GTEST_elf_writer_test_HOST_DEPS := $(HOST_CORE_IMAGE_DEFAULT_64) $(HOST_CORE_IMAGE_DEFAULT_32)
268ART_GTEST_elf_writer_test_TARGET_DEPS := $(TARGET_CORE_IMAGE_DEFAULT_64) $(TARGET_CORE_IMAGE_DEFAULT_32)
Brian Carlstrom53463ea2014-11-09 14:11:51 -0800269
Nicolas Geoffray975b7742019-03-21 17:37:38 +0000270# The two_runtimes_test test has dependencies on core.oat.
271ART_GTEST_two_runtimes_test_HOST_DEPS := $(HOST_CORE_IMAGE_DEFAULT_64) $(HOST_CORE_IMAGE_DEFAULT_32)
272ART_GTEST_two_runtimes_test_TARGET_DEPS := $(TARGET_CORE_IMAGE_DEFAULT_64) $(TARGET_CORE_IMAGE_DEFAULT_32)
273
Vladimir Marko672c0802019-07-26 13:03:13 +0100274# The transaction test has dependencies on core.oat.
275ART_GTEST_transaction_test_HOST_DEPS := $(HOST_CORE_IMAGE_DEFAULT_64) $(HOST_CORE_IMAGE_DEFAULT_32)
276ART_GTEST_transaction_test_TARGET_DEPS := $(TARGET_CORE_IMAGE_DEFAULT_64) $(TARGET_CORE_IMAGE_DEFAULT_32)
277
Andreas Gampee1459ae2016-06-29 09:36:30 -0700278ART_GTEST_dex2oat_environment_tests_HOST_DEPS := \
Richard Uhlerbb00f812017-02-16 14:21:10 +0000279 $(HOST_CORE_IMAGE_optimizing_64) \
280 $(HOST_CORE_IMAGE_optimizing_32) \
281 $(HOST_CORE_IMAGE_interpreter_64) \
Vladimir Markoa497a392018-09-26 10:52:50 +0100282 $(HOST_CORE_IMAGE_interpreter_32)
Andreas Gampee1459ae2016-06-29 09:36:30 -0700283ART_GTEST_dex2oat_environment_tests_TARGET_DEPS := \
Richard Uhlerbb00f812017-02-16 14:21:10 +0000284 $(TARGET_CORE_IMAGE_optimizing_64) \
285 $(TARGET_CORE_IMAGE_optimizing_32) \
286 $(TARGET_CORE_IMAGE_interpreter_64) \
Vladimir Markoa497a392018-09-26 10:52:50 +0100287 $(TARGET_CORE_IMAGE_interpreter_32)
Andreas Gampee1459ae2016-06-29 09:36:30 -0700288
David Srbeckyec2cdf42017-12-08 16:21:25 +0000289ART_GTEST_oat_file_test_HOST_DEPS := \
David Brazdil3e8aae02019-03-26 18:48:02 +0000290 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) \
291 $(HOST_OUT_EXECUTABLES)/dex2oatd
David Srbeckyec2cdf42017-12-08 16:21:25 +0000292ART_GTEST_oat_file_test_TARGET_DEPS := \
David Brazdil3e8aae02019-03-26 18:48:02 +0000293 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
Nicolas Geoffrayec64f202020-04-20 15:05:54 +0100294 dex2oatd.com.android.art.testing
David Srbeckyec2cdf42017-12-08 16:21:25 +0000295
Andreas Gampee1459ae2016-06-29 09:36:30 -0700296ART_GTEST_oat_file_assistant_test_HOST_DEPS := \
Richard Uhlerf51ac422016-07-08 09:22:33 -0700297 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS)
Andreas Gampee1459ae2016-06-29 09:36:30 -0700298ART_GTEST_oat_file_assistant_test_TARGET_DEPS := \
Richard Uhlerf51ac422016-07-08 09:22:33 -0700299 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS)
Andreas Gampee1459ae2016-06-29 09:36:30 -0700300
Calin Juravle36eb3132017-01-13 16:32:38 -0800301ART_GTEST_dexoptanalyzer_test_HOST_DEPS := \
302 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700303 $(HOST_OUT_EXECUTABLES)/dexoptanalyzerd
Calin Juravle36eb3132017-01-13 16:32:38 -0800304ART_GTEST_dexoptanalyzer_test_TARGET_DEPS := \
305 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
Martin Stjernholm84e5bb92019-09-05 19:56:46 +0100306 $(TESTING_ART_APEX) # For dexoptanalyzerd.
Andreas Gampee1459ae2016-06-29 09:36:30 -0700307
Richard Uhler84f50ae2017-02-06 15:12:45 +0000308ART_GTEST_image_space_test_HOST_DEPS := \
309 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS)
310ART_GTEST_image_space_test_TARGET_DEPS := \
311 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS)
312
Andreas Gampee1459ae2016-06-29 09:36:30 -0700313ART_GTEST_dex2oat_test_HOST_DEPS := \
Andreas Gampe47200462017-11-09 11:40:03 -0800314 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700315 $(HOST_OUT_EXECUTABLES)/dex2oatd
Andreas Gampee1459ae2016-06-29 09:36:30 -0700316ART_GTEST_dex2oat_test_TARGET_DEPS := \
Andreas Gampe47200462017-11-09 11:40:03 -0800317 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
Martin Stjernholm84e5bb92019-09-05 19:56:46 +0100318 $(TESTING_ART_APEX) # For dex2oatd.
Richard Uhler66d874d2015-01-15 09:37:19 -0800319
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700320ART_GTEST_dex2oat_image_test_HOST_DEPS := \
Andreas Gampe47200462017-11-09 11:40:03 -0800321 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700322 $(HOST_OUT_EXECUTABLES)/dex2oatd
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700323ART_GTEST_dex2oat_image_test_TARGET_DEPS := \
Andreas Gampe47200462017-11-09 11:40:03 -0800324 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
Martin Stjernholm84e5bb92019-09-05 19:56:46 +0100325 $(TESTING_ART_APEX) # For dex2oatd.
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700326
Vladimir Markod1f73512020-04-02 10:50:35 +0100327ART_GTEST_module_exclusion_test_HOST_DEPS := \
328 $(ART_GTEST_dex2oat_image_test_HOST_DEPS)
329ART_GTEST_module_exclusion_test_TARGET_DEPS := \
330 $(ART_GTEST_dex2oat_image_test_TARGET_DEPS)
331
Brian Carlstrom53463ea2014-11-09 14:11:51 -0800332# TODO: document why this is needed.
Richard Uhler67e1dc52017-02-06 16:50:17 +0000333ART_GTEST_proxy_test_HOST_DEPS := $(HOST_CORE_IMAGE_DEFAULT_64) $(HOST_CORE_IMAGE_DEFAULT_32)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700334
David Sehr55232f12017-04-19 14:06:49 -0700335# The dexdiag test requires the dexdiag utility.
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700336ART_GTEST_dexdiag_test_HOST_DEPS := $(HOST_OUT_EXECUTABLES)/dexdiag
Martin Stjernholm84e5bb92019-09-05 19:56:46 +0100337ART_GTEST_dexdiag_test_TARGET_DEPS := $(TESTING_ART_APEX) # For dexdiag.
David Sehr55232f12017-04-19 14:06:49 -0700338
Aart Bikcfbe53c2015-07-06 14:27:27 -0700339# The dexdump test requires an image and the dexdump utility.
Aart Bik22c26f52015-07-08 21:20:13 +0000340# TODO: rename into dexdump when migration completes
Aart Bikcfbe53c2015-07-06 14:27:27 -0700341ART_GTEST_dexdump_test_HOST_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000342 $(HOST_CORE_IMAGE_DEFAULT_64) \
343 $(HOST_CORE_IMAGE_DEFAULT_32) \
David Sehr4f215d12019-04-03 09:28:21 -0700344 $(HOST_OUT_EXECUTABLES)/dexdump
Aart Bikcfbe53c2015-07-06 14:27:27 -0700345ART_GTEST_dexdump_test_TARGET_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000346 $(TARGET_CORE_IMAGE_DEFAULT_64) \
347 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Nicolas Geoffrayec64f202020-04-20 15:05:54 +0100348 dexdump.com.android.art.testing
Aart Bikcfbe53c2015-07-06 14:27:27 -0700349
Mathieu Chartier0226c1d2018-05-17 00:19:12 -0700350# The dexanalyze test requires an image and the dexanalyze utility.
351ART_GTEST_dexanalyze_test_HOST_DEPS := \
352 $(HOST_CORE_IMAGE_DEFAULT_64) \
353 $(HOST_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700354 $(HOST_OUT_EXECUTABLES)/dexanalyze
Mathieu Chartier0226c1d2018-05-17 00:19:12 -0700355ART_GTEST_dexanalyze_test_TARGET_DEPS := \
356 $(TARGET_CORE_IMAGE_DEFAULT_64) \
357 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Nicolas Geoffrayec64f202020-04-20 15:05:54 +0100358 dexanalyze.com.android.art.testing
Mathieu Chartier0226c1d2018-05-17 00:19:12 -0700359
Jeff Haoc3acfc52016-08-29 14:18:26 -0700360# The dexlayout test requires an image and the dexlayout utility.
361# TODO: rename into dexdump when migration completes
362ART_GTEST_dexlayout_test_HOST_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000363 $(HOST_CORE_IMAGE_DEFAULT_64) \
364 $(HOST_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700365 $(HOST_OUT_EXECUTABLES)/dexlayoutd \
David Sehr4f215d12019-04-03 09:28:21 -0700366 $(HOST_OUT_EXECUTABLES)/dexdump
Jeff Haoc3acfc52016-08-29 14:18:26 -0700367ART_GTEST_dexlayout_test_TARGET_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000368 $(TARGET_CORE_IMAGE_DEFAULT_64) \
369 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Nicolas Geoffrayec64f202020-04-20 15:05:54 +0100370 dexlayoutd.com.android.art.testing \
371 dexdump.com.android.art.testing
Jeff Haoc3acfc52016-08-29 14:18:26 -0700372
Aart Bik3e40f4a2015-07-07 17:09:41 -0700373# The dexlist test requires an image and the dexlist utility.
Aart Bik3e40f4a2015-07-07 17:09:41 -0700374ART_GTEST_dexlist_test_HOST_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000375 $(HOST_CORE_IMAGE_DEFAULT_64) \
376 $(HOST_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700377 $(HOST_OUT_EXECUTABLES)/dexlist
Aart Bik3e40f4a2015-07-07 17:09:41 -0700378ART_GTEST_dexlist_test_TARGET_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000379 $(TARGET_CORE_IMAGE_DEFAULT_64) \
380 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Martin Stjernholm84e5bb92019-09-05 19:56:46 +0100381 $(TESTING_ART_APEX) # For dexlist.
Aart Bik3e40f4a2015-07-07 17:09:41 -0700382
Igor Murashkin37743352014-11-13 14:38:00 -0800383# The imgdiag test has dependencies on core.oat since it needs to load it during the test.
Andreas Gampec93b8b52014-12-19 23:12:25 -0800384# For the host, also add the installed tool (in the base size, that should suffice). For the
385# target, just the module is fine, the sync will happen late enough.
386ART_GTEST_imgdiag_test_HOST_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000387 $(HOST_CORE_IMAGE_DEFAULT_64) \
388 $(HOST_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700389 $(HOST_OUT_EXECUTABLES)/imgdiagd
Andreas Gampec93b8b52014-12-19 23:12:25 -0800390ART_GTEST_imgdiag_test_TARGET_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000391 $(TARGET_CORE_IMAGE_DEFAULT_64) \
392 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Nicolas Geoffrayec64f202020-04-20 15:05:54 +0100393 imgdiagd.com.android.art.testing
Igor Murashkin37743352014-11-13 14:38:00 -0800394
Mathieu Chartier2e0478a2018-04-06 14:33:25 -0700395# Dex analyze test requires dexanalyze.
396ART_GTEST_dexanalyze_test_HOST_DEPS := \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700397 $(HOST_OUT_EXECUTABLES)/dexanalyze
Mathieu Chartier2e0478a2018-04-06 14:33:25 -0700398ART_GTEST_dexanalyze_test_TARGET_DEPS := \
Nicolas Geoffrayec64f202020-04-20 15:05:54 +0100399 dexanalyze.com.android.art.testing
Mathieu Chartier2e0478a2018-04-06 14:33:25 -0700400
Mathieu Chartierea216b32015-05-26 19:48:16 -0700401# Oatdump test requires an image and oatfile to dump.
402ART_GTEST_oatdump_test_HOST_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000403 $(HOST_CORE_IMAGE_DEFAULT_64) \
404 $(HOST_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700405 $(HOST_OUT_EXECUTABLES)/oatdumpd \
406 $(HOST_OUT_EXECUTABLES)/oatdumpds \
David Srbecky3b19de22019-04-12 16:07:51 +0100407 $(HOST_OUT_EXECUTABLES)/dexdump \
408 $(HOST_OUT_EXECUTABLES)/dex2oatd \
409 $(HOST_OUT_EXECUTABLES)/dex2oatds
Mathieu Chartierea216b32015-05-26 19:48:16 -0700410ART_GTEST_oatdump_test_TARGET_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000411 $(TARGET_CORE_IMAGE_DEFAULT_64) \
412 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Martin Stjernholm84e5bb92019-09-05 19:56:46 +0100413 $(TESTING_ART_APEX) # For oatdumpd, dexdump, dex2oatd.
Vladimir Marko1352f132017-04-28 15:28:29 +0100414ART_GTEST_oatdump_image_test_HOST_DEPS := $(ART_GTEST_oatdump_test_HOST_DEPS)
415ART_GTEST_oatdump_image_test_TARGET_DEPS := $(ART_GTEST_oatdump_test_TARGET_DEPS)
David Srbecky3b19de22019-04-12 16:07:51 +0100416ART_GTEST_oatdump_app_test_HOST_DEPS := $(ART_GTEST_oatdump_test_HOST_DEPS)
417ART_GTEST_oatdump_app_test_TARGET_DEPS := $(ART_GTEST_oatdump_test_TARGET_DEPS)
Mathieu Chartierea216b32015-05-26 19:48:16 -0700418
Calin Juravle2e2db782016-02-23 12:00:03 +0000419# Profile assistant tests requires profman utility.
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700420ART_GTEST_profile_assistant_test_HOST_DEPS := $(HOST_OUT_EXECUTABLES)/profmand
Martin Stjernholm84e5bb92019-09-05 19:56:46 +0100421ART_GTEST_profile_assistant_test_TARGET_DEPS := $(TESTING_ART_APEX) # For profmand.
Calin Juravle2e2db782016-02-23 12:00:03 +0000422
David Brazdil2b9c35b2018-01-12 15:44:43 +0000423ART_GTEST_hiddenapi_test_HOST_DEPS := \
424 $(HOST_CORE_IMAGE_DEFAULT_64) \
425 $(HOST_CORE_IMAGE_DEFAULT_32) \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700426 $(HOST_OUT_EXECUTABLES)/hiddenapid
David Brazdil2b9c35b2018-01-12 15:44:43 +0000427
Ian Rogersafd9acc2014-06-17 08:21:54 -0700428# The path for which all the source files are relative, not actually the current directory.
Brian Carlstrom7940e442013-07-12 13:46:57 -0700429LOCAL_PATH := art
430
Colin Cross6e95dd52016-09-12 15:37:10 -0700431ART_TEST_MODULES := \
432 art_cmdline_tests \
Colin Cross6e95dd52016-09-12 15:37:10 -0700433 art_compiler_host_tests \
Martin Stjernholm750bf042019-01-09 22:51:12 +0000434 art_compiler_tests \
Colin Cross6e95dd52016-09-12 15:37:10 -0700435 art_dex2oat_tests \
Mathieu Chartier2e0478a2018-04-06 14:33:25 -0700436 art_dexanalyze_tests \
David Sehr55232f12017-04-19 14:06:49 -0700437 art_dexdiag_tests \
Colin Cross6e95dd52016-09-12 15:37:10 -0700438 art_dexdump_tests \
439 art_dexlayout_tests \
440 art_dexlist_tests \
Calin Juravle36eb3132017-01-13 16:32:38 -0800441 art_dexoptanalyzer_tests \
David Brazdil2b9c35b2018-01-12 15:44:43 +0000442 art_hiddenapi_tests \
Colin Cross6e95dd52016-09-12 15:37:10 -0700443 art_imgdiag_tests \
David Sehr67bf42e2018-02-26 16:43:04 -0800444 art_libartbase_tests \
Orion Hodson119733d2019-01-30 15:14:41 +0000445 art_libartpalette_tests \
Martin Stjernholmfdb2f602019-01-09 14:47:00 +0000446 art_libdexfile_external_tests \
Martin Stjernholm70ae00d2019-02-15 22:41:14 +0000447 art_libdexfile_support_static_tests \
Martin Stjernholm750bf042019-01-09 22:51:12 +0000448 art_libdexfile_support_tests \
David Sehr334b9d72018-02-12 18:27:56 -0800449 art_libdexfile_tests \
David Sehrd5f8de82018-04-27 14:12:03 -0700450 art_libprofile_tests \
Colin Cross6e95dd52016-09-12 15:37:10 -0700451 art_oatdump_tests \
452 art_profman_tests \
Colin Cross6e95dd52016-09-12 15:37:10 -0700453 art_runtime_compiler_tests \
Martin Stjernholm750bf042019-01-09 22:51:12 +0000454 art_runtime_tests \
Josh Gao1eac77e2018-02-26 15:54:41 -0800455 art_sigchain_tests \
Brian Carlstroma1ce1fe2014-02-24 23:23:58 -0800456
Jiyong Parka5992522020-01-07 16:55:09 +0900457ART_TARGET_GTEST_NAMES := $(foreach tm,$(ART_TEST_MODULES),\
458 $(foreach path,$(ART_TEST_LIST_device_$(TARGET_ARCH)_$(tm)),\
459 $(notdir $(path))\
460 )\
461)
Nicolas Geoffray340fb0b2019-12-30 10:36:22 +0000462
Colin Cross6e95dd52016-09-12 15:37:10 -0700463ART_HOST_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\
Colin Cross124f8812016-09-15 20:57:47 -0700464 $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_$(m)))
Alex Light50fa9932015-08-10 15:30:07 -0700465
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100466ifneq ($(HOST_PREFER_32_BIT),true)
4672ND_ART_HOST_GTEST_FILES += $(foreach m,$(ART_TEST_MODULES),\
468 $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_$(m)))
469endif
470
Ian Rogersafd9acc2014-06-17 08:21:54 -0700471# Variables holding collections of gtest pre-requisits used to run a number of gtests.
472ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
473ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
474ART_TEST_HOST_GTEST_RULES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700475ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
476ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
477ART_TEST_TARGET_GTEST_RULES :=
Nicolas Geoffray58035ae2015-05-27 19:10:27 +0100478ART_TEST_HOST_GTEST_DEPENDENCIES :=
Nicolas Geoffray17b1dcb2018-10-12 15:09:42 +0100479ART_TEST_TARGET_GTEST_DEPENDENCIES :=
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700480
Nicolas Geoffray96a37c82014-10-29 23:50:40 +0000481ART_GTEST_TARGET_ANDROID_ROOT := '/system'
482ifneq ($(ART_TEST_ANDROID_ROOT),)
483 ART_GTEST_TARGET_ANDROID_ROOT := $(ART_TEST_ANDROID_ROOT)
484endif
485
Victor Chang64611242019-07-05 16:32:41 +0100486ART_GTEST_TARGET_ANDROID_I18N_ROOT := '/apex/com.android.i18n'
487ifneq ($(ART_TEST_ANDROID_I18N_ROOT),)
488 ART_GTEST_TARGET_ANDROID_I18N_ROOT := $(ART_TEST_ANDROID_I18N_ROOT)
489endif
490
Martin Stjernholme58624f2019-09-20 15:53:40 +0100491ART_GTEST_TARGET_ANDROID_ART_ROOT := '/apex/com.android.art'
492ifneq ($(ART_TEST_ANDROID_ART_ROOT),)
493 ART_GTEST_TARGET_ANDROID_ART_ROOT := $(ART_TEST_ANDROID_ART_ROOT)
Roland Levillain7c777f82019-01-10 18:00:37 +0000494endif
Neil Fuller26c43772018-11-23 17:56:43 +0000495
Neil Fuller26a5dd62019-03-13 15:16:35 +0000496ART_GTEST_TARGET_ANDROID_TZDATA_ROOT := '/apex/com.android.tzdata'
497ifneq ($(ART_TEST_ANDROID_TZDATA_ROOT),)
498 ART_GTEST_TARGET_ANDROID_TZDATA_ROOT := $(ART_TEST_ANDROID_TZDATA_ROOT)
499endif
500
Ian Rogersafd9acc2014-06-17 08:21:54 -0700501# Define make rules for a host gtests.
502# $(1): gtest name - the name of the test we're building such as leb128_test.
Colin Cross6e95dd52016-09-12 15:37:10 -0700503# $(2): path relative to $OUT to the test binary
504# $(3): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700505define define-art-gtest-rule-host
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700506 gtest_suffix := $(1)$$($(3)ART_PHONY_TEST_HOST_SUFFIX)
507 gtest_rule := test-art-host-gtest-$$(gtest_suffix)
508 gtest_output := $(call intermediates-dir-for,PACKAGING,art-host-gtest,HOST)/$$(gtest_suffix).xml
Dan Willemsen0ef94572018-10-21 19:00:56 +0000509 $$(call dist-for-goals,$$(gtest_rule),$$(gtest_output):gtest/$$(gtest_suffix))
Colin Cross83072062019-10-02 16:06:58 -0700510 gtest_exe := $(2)
Ian Rogers665de8a2014-06-24 21:34:09 -0700511 # Dependencies for all host gtests.
Nicolas Geoffrayd31cff12020-03-27 14:29:45 +0000512 gtest_deps := $$(ART_HOST_DEX_DEPENDENCIES) \
David Srbecky883c1342020-05-11 23:30:29 +0000513 $$(ART_TEST_HOST_GTEST_DEPENDENCIES) \
David Srbecky0c0f3022020-02-13 15:53:01 +0000514 $$(HOST_BOOT_IMAGE_JARS) \
Victor Chang65ae6692019-10-11 14:17:21 +0100515 $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libicu_jni$$(ART_HOST_SHLIB_EXTENSION) \
Colin Cross6e95dd52016-09-12 15:37:10 -0700516 $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$$(ART_HOST_SHLIB_EXTENSION) \
517 $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$$(ART_HOST_SHLIB_EXTENSION) \
Nicolas Geoffray58035ae2015-05-27 19:10:27 +0100518 $$(gtest_exe) \
519 $$(ART_GTEST_$(1)_HOST_DEPS) \
Andreas Gampe28fd62a2018-12-12 15:15:22 -0800520 $(foreach file,$(ART_GTEST_$(1)_DEX_DEPS),$(ART_TEST_HOST_GTEST_$(file)_DEX)) \
Andreas Gampe148c1602019-06-10 16:47:46 -0700521 $(HOST_OUT_EXECUTABLES)/signal_dumper
Ian Rogers665de8a2014-06-24 21:34:09 -0700522
David Srbecky403384e2020-03-27 12:24:36 +0000523 # Note: The "host arch" Make variables defined in build/make/core/envsetup.mk
524 # and art/build/Android.common.mk have different meanings:
525 #
526 # * In build/make/core/envsetup.mk:
527 # * HOST_ARCH := x86_64
528 # * HOST_2ND_ARCH := x86
529 #
530 # * In art/build/Android.common.mk:
531 # * When `HOST_PREFER_32_BIT` is `true`:
532 # * ART_HOST_ARCH := x86
533 # * 2ND_ART_HOST_ARCH :=
534 # * 2ND_HOST_ARCH :=
535 # * Otherwise:
536 # * ART_HOST_ARCH := x86_64
537 # * 2ND_ART_HOST_ARCH := x86
538 # * 2ND_HOST_ARCH := x86
539 ifeq ($(HOST_PREFER_32_BIT),true)
540 gtest_deps += $$(2ND_HOST_BOOT_IMAGE) # Depend on the 32-bit boot image.
541 else
542 gtest_deps += $$($(3)HOST_BOOT_IMAGE)
543 endif
544
Andreas Gampe6acebf42018-01-22 22:15:43 -0800545.PHONY: $$(gtest_rule)
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700546$$(gtest_rule): $$(gtest_output)
547
548# Re-run the tests, even if nothing changed. Until the build system has a dedicated "no cache"
549# option, claim to write a file that is never produced.
550$$(gtest_output): .KATI_IMPLICIT_OUTPUTS := $$(gtest_output)-nocache
David Srbecky883c1342020-05-11 23:30:29 +0000551# Limit concurrent runs. Each test itself is already highly parallel (and thus memory hungry).
552$$(gtest_output): .KATI_NINJA_POOL := highmem_pool
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700553$$(gtest_output): NAME := $$(gtest_rule)
Andreas Gampe6acebf42018-01-22 22:15:43 -0800554ifeq (,$(SANITIZE_HOST))
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700555$$(gtest_output): $$(gtest_exe) $$(gtest_deps)
Andreas Gampe28fd62a2018-12-12 15:15:22 -0800556 $(hide) ($$(call ART_TEST_SKIP,$$(NAME)) && \
Andreas Gampe0df2aba2019-06-10 16:53:55 -0700557 timeout --foreground -k 120s 2400s $(HOST_OUT_EXECUTABLES)/signal_dumper -s 15 \
Christopher Ferrisfc5e2ef2020-05-08 00:08:42 +0000558 $$< --gtest_output=xml:$$@ && \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700559 $$(call ART_TEST_PASSED,$$(NAME))) || $$(call ART_TEST_FAILED,$$(NAME))
Andreas Gampe6acebf42018-01-22 22:15:43 -0800560else
Andreas Gampe03858052017-05-01 08:17:24 -0700561# Note: envsetup currently exports ASAN_OPTIONS=detect_leaks=0 to suppress leak detection, as some
562# build tools (e.g., ninja) intentionally leak. We want leak checks when we run our tests, so
563# override ASAN_OPTIONS. b/37751350
Andreas Gampe6acebf42018-01-22 22:15:43 -0800564# Note 2: Under sanitization, also capture the output, and run it through the stack tool on failure
565# (with the x86-64 ABI, as this allows symbolization of both x86 and x86-64). We don't do this in
566# general as it loses all the color output, and we have our own symbolization step when not running
567# under ASAN.
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700568$$(gtest_output): $$(gtest_exe) $$(gtest_deps)
569 $(hide) ($$(call ART_TEST_SKIP,$$(NAME)) && set -o pipefail && \
Andreas Gampe0df2aba2019-06-10 16:53:55 -0700570 ASAN_OPTIONS=detect_leaks=1 timeout --foreground -k 120s 3600s \
571 $(HOST_OUT_EXECUTABLES)/signal_dumper -s 15 \
Andreas Gampe28fd62a2018-12-12 15:15:22 -0800572 $$< --gtest_output=xml:$$@ 2>&1 | tee $$<.tmp.out >&2 && \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700573 { $$(call ART_TEST_PASSED,$$(NAME)) ; rm $$<.tmp.out ; }) || \
Andreas Gampec05fd3f2018-01-23 14:22:07 -0800574 ( grep -q AddressSanitizer $$<.tmp.out && export ANDROID_BUILD_TOP=`pwd` && \
Andreas Gampe6acebf42018-01-22 22:15:43 -0800575 { echo "ABI: 'x86_64'" | cat - $$<.tmp.out | development/scripts/stack | tail -n 3000 ; } ; \
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700576 rm $$<.tmp.out ; $$(call ART_TEST_FAILED,$$(NAME)))
Andreas Gampe6acebf42018-01-22 22:15:43 -0800577endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700578
Colin Cross6e95dd52016-09-12 15:37:10 -0700579 ART_TEST_HOST_GTEST$$($(3)ART_PHONY_TEST_HOST_SUFFIX)_RULES += $$(gtest_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700580 ART_TEST_HOST_GTEST_RULES += $$(gtest_rule)
581 ART_TEST_HOST_GTEST_$(1)_RULES += $$(gtest_rule)
582
Andreas Gampe3c0bb312015-02-19 10:02:19 -0800583
Ian Rogersafd9acc2014-06-17 08:21:54 -0700584 # Clear locally defined variables.
Ian Rogers665de8a2014-06-24 21:34:09 -0700585 gtest_deps :=
Roland Levillain76cfe612017-10-30 13:14:28 +0000586 gtest_exe :=
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700587 gtest_output :=
Roland Levillain76cfe612017-10-30 13:14:28 +0000588 gtest_rule :=
Dan Willemsendb72e5e2018-10-02 14:09:21 -0700589 gtest_suffix :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700590endef # define-art-gtest-rule-host
591
David Srbecky883c1342020-05-11 23:30:29 +0000592# Global list of all dependencies. All tests depend on all tools.
593# Removal of test_per_src broke the naming convention for dependencies,
594# so the fine-grained dependencies no longer work for now.
595# TODO: Move all dependency tracking to the blueprint file.
596ART_GTEST_ALL_DEX_DEPS := \
597 EmptyUncompressed \
598 EmptyUncompressedAligned \
599 LinkageTest \
600 MainStripped \
601 MainUncompressedAligned \
602 MultiDexUncompressedAligned \
603 VerifierDeps \
604 VerifierDepsMulti \
605 VerifySoftFailDuringClinit \
606 $(foreach dir,$(GTEST_DEX_DIRECTORIES),$(dir))
607ART_TEST_HOST_GTEST_DEPENDENCIES += \
608 $(HOST_OUT_EXECUTABLES)/dex2oatd \
609 $(HOST_OUT_EXECUTABLES)/dex2oatds \
610 $(HOST_OUT_EXECUTABLES)/dexanalyze \
611 $(HOST_OUT_EXECUTABLES)/dexdiag \
612 $(HOST_OUT_EXECUTABLES)/dexdump \
613 $(HOST_OUT_EXECUTABLES)/dexlayoutd \
614 $(HOST_OUT_EXECUTABLES)/dexlist \
615 $(HOST_OUT_EXECUTABLES)/dexoptanalyzerd \
616 $(HOST_OUT_EXECUTABLES)/hiddenapid \
617 $(HOST_OUT_EXECUTABLES)/imgdiagd \
618 $(HOST_OUT_EXECUTABLES)/oatdumpd \
619 $(HOST_OUT_EXECUTABLES)/oatdumpds \
620 $(HOST_OUT_EXECUTABLES)/profmand \
621 $(foreach file,$(ART_GTEST_ALL_DEX_DEPS),$(ART_TEST_HOST_GTEST_$(file)_DEX))
622ART_TEST_TARGET_GTEST_DEPENDENCIES += \
623 $(TESTING_ART_APEX) \
624 $(foreach file,$(ART_GTEST_ALL_DEX_DEPS),$(ART_TEST_TARGET_GTEST_$(file)_DEX))
625
Jiyong Parkeac38a12020-01-03 17:56:33 +0900626# Add the additional dependencies for the specified test
Nicolas Geoffray340fb0b2019-12-30 10:36:22 +0000627# $(1): test name
Jiyong Parkeac38a12020-01-03 17:56:33 +0900628define add-art-gtest-dependencies
Nicolas Geoffray340fb0b2019-12-30 10:36:22 +0000629 # Note that, both the primary and the secondary arches of the libs are built by depending
630 # on the module name.
631 gtest_deps := \
632 $$(ART_GTEST_$(1)_TARGET_DEPS) \
633 $(foreach file,$(ART_GTEST_$(1)_DEX_DEPS),$(ART_TEST_TARGET_GTEST_$(file)_DEX)) \
Brian Carlstrom0796af02011-10-12 14:31:45 -0700634
Nicolas Geoffray340fb0b2019-12-30 10:36:22 +0000635 ART_TEST_TARGET_GTEST_DEPENDENCIES += $$(gtest_deps)
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100636
637 # Clear locally defined variables.
Nicolas Geoffray340fb0b2019-12-30 10:36:22 +0000638 gtest_deps :=
Jiyong Parkeac38a12020-01-03 17:56:33 +0900639endef # add-art-gtest-dependencies
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100640
641# $(1): file name
642# $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
643define define-art-gtest-host
644 art_gtest_filename := $(1)
645
646 include $$(CLEAR_VARS)
647 art_gtest_name := $$(notdir $$(basename $$(art_gtest_filename)))
648 ifndef ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES
649 ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES :=
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100650 endif
651 $$(eval $$(call define-art-gtest-rule-host,$$(art_gtest_name),$$(art_gtest_filename),$(2)))
652
653 # Clear locally defined variables.
654 art_gtest_filename :=
655 art_gtest_name :=
656endef # define-art-gtest-host
657
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100658# Define the rules to build and run gtests for both archs on host.
659# $(1): test name
660define define-art-gtest-host-both
661 art_gtest_name := $(1)
662
Ian Rogersafd9acc2014-06-17 08:21:54 -0700663.PHONY: test-art-host-gtest-$$(art_gtest_name)
664test-art-host-gtest-$$(art_gtest_name): $$(ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES)
665 $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
Ian Rogersd912e5c2013-11-13 12:40:11 -0800666
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100667 # Clear now unused variables.
668 ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700669 art_gtest_name :=
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100670endef # define-art-gtest-host-both
Alex Light50fa9932015-08-10 15:30:07 -0700671
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700672ifeq ($(ART_BUILD_TARGET),true)
Jiyong Parkeac38a12020-01-03 17:56:33 +0900673 $(foreach name,$(ART_TARGET_GTEST_NAMES), $(eval $(call add-art-gtest-dependencies,$(name),)))
674 ART_TEST_TARGET_GTEST_DEPENDENCIES += \
Victor Changd20e51d2020-05-05 16:01:19 +0100675 libicu_jni.com.android.i18n \
Nicolas Geoffrayec64f202020-04-20 15:05:54 +0100676 libjavacore.com.android.art.testing \
677 libopenjdkd.com.android.art.testing \
Nicolas Geoffray31e0dc22020-03-20 15:48:09 +0000678 com.android.art.testing \
679 com.android.conscrypt
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700680endif
Ian Rogersc5f17732014-06-05 20:48:42 -0700681ifeq ($(ART_BUILD_HOST),true)
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100682 $(foreach file,$(ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host,$(file),)))
683 ifneq ($(HOST_PREFER_32_BIT),true)
684 $(foreach file,$(2ND_ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host,$(file),2ND_)))
685 endif
686 # Rules to run the different architecture versions of the gtest.
687 $(foreach file,$(ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host-both,$$(notdir $$(basename $$(file))))))
Brian Carlstrom07d579f2011-07-27 13:31:51 -0700688endif
Tsu Chiang Chuangec245a42014-05-15 21:16:21 -0700689
690# Used outside the art project to get a list of the current tests
691RUNTIME_TARGET_GTEST_MAKE_TARGETS :=
Jiyong Parkeac38a12020-01-03 17:56:33 +0900692art_target_gtest_files := $(foreach m,$(ART_TEST_MODULES),$(ART_TEST_LIST_device_$(TARGET_ARCH)_$(m)))
Dan Willemsen7955f5e2020-01-28 12:18:49 -0800693# If testdir == testfile, assume this is not a test_per_src module
Jiyong Parkeac38a12020-01-03 17:56:33 +0900694$(foreach file,$(art_target_gtest_files),\
Dan Willemsen7955f5e2020-01-28 12:18:49 -0800695 $(eval testdir := $$(notdir $$(patsubst %/,%,$$(dir $$(file)))))\
696 $(eval testfile := $$(notdir $$(basename $$(file))))\
697 $(if $(call streq,$(testdir),$(testfile)),,\
698 $(eval testfile := $(testdir)_$(testfile)))\
699 $(eval RUNTIME_TARGET_GTEST_MAKE_TARGETS += $(testfile))\
Jiyong Parkeac38a12020-01-03 17:56:33 +0900700)
Dan Willemsen7955f5e2020-01-28 12:18:49 -0800701testdir :=
702testfile :=
Jiyong Parkeac38a12020-01-03 17:56:33 +0900703art_target_gtest_files :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700704
Roland Levillain05e34f42018-05-24 13:19:05 +0000705# Define all the combinations of host/target and suffix such as:
706# test-art-host-gtest or test-art-host-gtest64
Ian Rogersafd9acc2014-06-17 08:21:54 -0700707# $(1): host or target
708# $(2): HOST or TARGET
Roland Levillain05e34f42018-05-24 13:19:05 +0000709# $(3): undefined, 32 or 64
Ian Rogersafd9acc2014-06-17 08:21:54 -0700710define define-test-art-gtest-combination
711 ifeq ($(1),host)
712 ifneq ($(2),HOST)
713 $$(error argument mismatch $(1) and ($2))
714 endif
715 else
716 ifneq ($(1),target)
717 $$(error found $(1) expected host or target)
718 endif
719 ifneq ($(2),TARGET)
720 $$(error argument mismatch $(1) and ($2))
721 endif
722 endif
723
Roland Levillain05e34f42018-05-24 13:19:05 +0000724 rule_name := test-art-$(1)-gtest$(3)
725 dependencies := $$(ART_TEST_$(2)_GTEST$(3)_RULES)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700726
727.PHONY: $$(rule_name)
Søren Gjesse46845f62019-12-10 09:14:16 +0100728$$(rule_name): $$(dependencies) d8
Ian Rogersafd9acc2014-06-17 08:21:54 -0700729 $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
730
731 # Clear locally defined variables.
732 rule_name :=
733 dependencies :=
734endef # define-test-art-gtest-combination
735
Roland Levillain05e34f42018-05-24 13:19:05 +0000736$(eval $(call define-test-art-gtest-combination,target,TARGET,))
737$(eval $(call define-test-art-gtest-combination,target,TARGET,$(ART_PHONY_TEST_TARGET_SUFFIX)))
Dan Willemsen5d2dbf82018-04-11 12:31:11 -0700738ifdef 2ND_ART_PHONY_TEST_TARGET_SUFFIX
Roland Levillain05e34f42018-05-24 13:19:05 +0000739$(eval $(call define-test-art-gtest-combination,target,TARGET,$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700740endif
Roland Levillain05e34f42018-05-24 13:19:05 +0000741$(eval $(call define-test-art-gtest-combination,host,HOST,))
742$(eval $(call define-test-art-gtest-combination,host,HOST,$(ART_PHONY_TEST_HOST_SUFFIX)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700743ifneq ($(HOST_PREFER_32_BIT),true)
Roland Levillain05e34f42018-05-24 13:19:05 +0000744$(eval $(call define-test-art-gtest-combination,host,HOST,$(2ND_ART_PHONY_TEST_HOST_SUFFIX)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700745endif
746
747# Clear locally defined variables.
748define-art-gtest-rule-target :=
749define-art-gtest-rule-host :=
750define-art-gtest :=
751define-test-art-gtest-combination :=
752RUNTIME_GTEST_COMMON_SRC_FILES :=
753COMPILER_GTEST_COMMON_SRC_FILES :=
754RUNTIME_GTEST_TARGET_SRC_FILES :=
755RUNTIME_GTEST_HOST_SRC_FILES :=
756COMPILER_GTEST_TARGET_SRC_FILES :=
757COMPILER_GTEST_HOST_SRC_FILES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700758ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
759ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
760ART_TEST_HOST_GTEST_RULES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700761ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
762ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
763ART_TEST_TARGET_GTEST_RULES :=
Nicolas Geoffray96a37c82014-10-29 23:50:40 +0000764ART_GTEST_TARGET_ANDROID_ROOT :=
Victor Chang64611242019-07-05 16:32:41 +0100765ART_GTEST_TARGET_ANDROID_I18N_ROOT :=
Martin Stjernholme58624f2019-09-20 15:53:40 +0100766ART_GTEST_TARGET_ANDROID_ART_ROOT :=
Neil Fuller26a5dd62019-03-13 15:16:35 +0000767ART_GTEST_TARGET_ANDROID_TZDATA_ROOT :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700768ART_GTEST_class_linker_test_DEX_DEPS :=
Mathieu Chartierdb70ce52016-12-12 11:06:59 -0800769ART_GTEST_class_table_test_DEX_DEPS :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700770ART_GTEST_compiler_driver_test_DEX_DEPS :=
771ART_GTEST_dex_file_test_DEX_DEPS :=
772ART_GTEST_exception_test_DEX_DEPS :=
773ART_GTEST_elf_writer_test_HOST_DEPS :=
774ART_GTEST_elf_writer_test_TARGET_DEPS :=
Andreas Gampea1ff30f2016-09-27 12:19:45 -0700775ART_GTEST_imtable_test_DEX_DEPS :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700776ART_GTEST_jni_compiler_test_DEX_DEPS :=
777ART_GTEST_jni_internal_test_DEX_DEPS :=
Richard Uhler66d874d2015-01-15 09:37:19 -0800778ART_GTEST_oat_file_assistant_test_DEX_DEPS :=
779ART_GTEST_oat_file_assistant_test_HOST_DEPS :=
780ART_GTEST_oat_file_assistant_test_TARGET_DEPS :=
Mathieu Chartier0be7fa72018-04-12 10:13:29 -0700781ART_GTEST_dexanalyze_test_DEX_DEPS :=
Calin Juravle36eb3132017-01-13 16:32:38 -0800782ART_GTEST_dexoptanalyzer_test_DEX_DEPS :=
783ART_GTEST_dexoptanalyzer_test_HOST_DEPS :=
784ART_GTEST_dexoptanalyzer_test_TARGET_DEPS :=
Richard Uhler84f50ae2017-02-06 15:12:45 +0000785ART_GTEST_image_space_test_DEX_DEPS :=
786ART_GTEST_image_space_test_HOST_DEPS :=
787ART_GTEST_image_space_test_TARGET_DEPS :=
Andreas Gampee1459ae2016-06-29 09:36:30 -0700788ART_GTEST_dex2oat_test_DEX_DEPS :=
789ART_GTEST_dex2oat_test_HOST_DEPS :=
790ART_GTEST_dex2oat_test_TARGET_DEPS :=
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700791ART_GTEST_dex2oat_image_test_DEX_DEPS :=
792ART_GTEST_dex2oat_image_test_HOST_DEPS :=
793ART_GTEST_dex2oat_image_test_TARGET_DEPS :=
Vladimir Markod1f73512020-04-02 10:50:35 +0100794ART_GTEST_module_exclusion_test_HOST_DEPS :=
795ART_GTEST_module_exclusion_test_TARGET_DEPS :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700796ART_GTEST_object_test_DEX_DEPS :=
797ART_GTEST_proxy_test_DEX_DEPS :=
798ART_GTEST_reflection_test_DEX_DEPS :=
799ART_GTEST_stub_test_DEX_DEPS :=
800ART_GTEST_transaction_test_DEX_DEPS :=
Andreas Gampee1459ae2016-06-29 09:36:30 -0700801ART_GTEST_dex2oat_environment_tests_DEX_DEPS :=
Mathieu Chartier1ca68902017-04-18 11:26:22 -0700802ART_GTEST_heap_verification_test_DEX_DEPS :=
David Brazdilca3c8c32016-09-06 14:04:48 +0100803ART_GTEST_verifier_deps_test_DEX_DEPS :=
Ian Rogers1a2f84e2014-07-07 16:05:18 -0700804$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_TARGET_GTEST_$(dir)_DEX :=))
805$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_HOST_GTEST_$(dir)_DEX :=))
Richard Uhler66d874d2015-01-15 09:37:19 -0800806ART_TEST_HOST_GTEST_MainStripped_DEX :=
807ART_TEST_TARGET_GTEST_MainStripped_DEX :=
David Srbecky8c8f1482020-02-05 20:17:10 +0000808ART_TEST_HOST_GTEST_MainUncompressedAligned_DEX :=
809ART_TEST_TARGET_GTEST_MainUncompressedAligned_DEX :=
Mathieu Chartier700a9852018-02-06 18:27:38 -0800810ART_TEST_HOST_GTEST_EmptyUncompressed_DEX :=
811ART_TEST_TARGET_GTEST_EmptyUncompressed_DEX :=
David Brazdilca3c8c32016-09-06 14:04:48 +0100812ART_TEST_GTEST_VerifierDeps_SRC :=
813ART_TEST_HOST_GTEST_VerifierDeps_DEX :=
David Brazdilf906f122016-09-16 16:33:31 +0100814ART_TEST_TARGET_GTEST_VerifierDeps_DEX :=
Vladimir Markod79b37b2018-11-02 13:06:22 +0000815ART_TEST_GTEST_VerifySoftFailDuringClinit_SRC :=
816ART_TEST_HOST_GTEST_VerifySoftFailDuringClinit_DEX :=
817ART_TEST_TARGET_GTEST_VerifySoftFailDuringClinit_DEX :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700818GTEST_DEX_DIRECTORIES :=
Brian Carlstrom532714a2014-06-25 02:15:31 -0700819LOCAL_PATH :=
David Srbecky883c1342020-05-11 23:30:29 +0000820
821endif # ifneq ($(HOST_OS),darwin)