blob: be040a98da4f1c944f7887b404b0428a1a319fa6 [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 \
Mathieu Chartier496577f2016-09-20 15:33:31 -070041 ImageLayoutA \
42 ImageLayoutB \
Andreas Gampea1ff30f2016-09-27 12:19:45 -070043 IMTA \
44 IMTB \
Sebastien Hertz0462c4c2015-04-01 16:34:17 +020045 Instrumentation \
Ian Rogersafd9acc2014-06-17 08:21:54 -070046 Interfaces \
Artem Udovichenkod9786b02015-10-14 16:36:55 +030047 Lookup \
Ian Rogersafd9acc2014-06-17 08:21:54 -070048 Main \
Mathieu Chartierd00e02b2017-05-24 12:04:13 -070049 ManyMethods \
Narayan Kamath25352fc2016-08-03 12:46:58 +010050 MethodTypes \
Richard Uhler66d874d2015-01-15 09:37:19 -080051 MultiDex \
Richard Uhler67ff7d12015-05-14 13:21:13 -070052 MultiDexModifiedSecondary \
Ian Rogersafd9acc2014-06-17 08:21:54 -070053 MyClass \
54 MyClassNatives \
55 Nested \
56 NonStaticLeafMethods \
Mathieu Chartier279ac5c2016-09-08 17:34:25 -070057 Packages \
Ian Rogersafd9acc2014-06-17 08:21:54 -070058 ProtoCompare \
59 ProtoCompare2 \
Calin Juravle877fd962016-01-05 14:29:29 +000060 ProfileTestMultiDex \
Ian Rogersafd9acc2014-06-17 08:21:54 -070061 StaticLeafMethods \
62 Statics \
63 StaticsFromCode \
64 Transaction \
65 XandY
66
67# Create build rules for each dex file recording the dependency.
68$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval $(call build-art-test-dex,art-gtest,$(dir), \
Ian Rogers1a2f84e2014-07-07 16:05:18 -070069 $(ART_TARGET_NATIVETEST_OUT),art/build/Android.gtest.mk,ART_TEST_TARGET_GTEST_$(dir)_DEX, \
70 ART_TEST_HOST_GTEST_$(dir)_DEX)))
Ian Rogersafd9acc2014-06-17 08:21:54 -070071
Richard Uhler66d874d2015-01-15 09:37:19 -080072# Create rules for MainStripped, a copy of Main with the classes.dex stripped
73# for the oat file assistant tests.
74ART_TEST_HOST_GTEST_MainStripped_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
75ART_TEST_TARGET_GTEST_MainStripped_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
76
Nicolas Geoffrayf3075272018-01-08 12:41:19 +000077# Create rules for MainUncompressed, a copy of Main with the classes.dex uncompressed
78# for the dex2oat tests.
79ART_TEST_HOST_GTEST_MainUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))Uncompressed$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
80ART_TEST_TARGET_GTEST_MainUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))Uncompressed$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
81
Mathieu Chartier700a9852018-02-06 18:27:38 -080082# Create rules for UncompressedEmpty, a classes.dex that is empty and uncompressed
83# for the dex2oat tests.
84ART_TEST_HOST_GTEST_EmptyUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))EmptyUncompressed$(suffix $(ART_TEST_HOST_GTEST_Main_DEX))
85ART_TEST_TARGET_GTEST_EmptyUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))EmptyUncompressed$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX))
86
Andreas Gampefc604a72018-02-08 15:43:37 -080087# Create rules for MultiDexUncompressed, a copy of MultiDex with the classes.dex uncompressed
88# for the OatFile tests.
89ART_TEST_HOST_GTEST_MultiDexUncompressed_DEX := $(basename $(ART_TEST_HOST_GTEST_MultiDex_DEX))Uncompressed$(suffix $(ART_TEST_HOST_GTEST_MultiDex_DEX))
90ART_TEST_TARGET_GTEST_MultiDexUncompressed_DEX := $(basename $(ART_TEST_TARGET_GTEST_MultiDex_DEX))Uncompressed$(suffix $(ART_TEST_TARGET_GTEST_MultiDex_DEX))
91
Dan Willemsen17769622018-04-06 13:26:36 -070092ifdef ART_TEST_HOST_GTEST_Main_DEX
Richard Uhler66d874d2015-01-15 09:37:19 -080093$(ART_TEST_HOST_GTEST_MainStripped_DEX): $(ART_TEST_HOST_GTEST_Main_DEX)
94 cp $< $@
95 $(call dexpreopt-remove-classes.dex,$@)
Dan Willemsen17769622018-04-06 13:26:36 -070096endif
Richard Uhler66d874d2015-01-15 09:37:19 -080097
Dan Willemsen17769622018-04-06 13:26:36 -070098ifdef ART_TEST_TARGET_GTEST_Main_DEX
Richard Uhler66d874d2015-01-15 09:37:19 -080099$(ART_TEST_TARGET_GTEST_MainStripped_DEX): $(ART_TEST_TARGET_GTEST_Main_DEX)
100 cp $< $@
101 $(call dexpreopt-remove-classes.dex,$@)
Dan Willemsen17769622018-04-06 13:26:36 -0700102endif
Richard Uhler66d874d2015-01-15 09:37:19 -0800103
Dan Willemsen17769622018-04-06 13:26:36 -0700104ifdef ART_TEST_HOST_GTEST_Main_DEX
Nicolas Geoffrayf3075272018-01-08 12:41:19 +0000105$(ART_TEST_HOST_GTEST_MainUncompressed_DEX): $(ART_TEST_HOST_GTEST_Main_DEX) $(ZIPALIGN)
106 cp $< $@
107 $(call uncompress-dexs, $@)
108 $(call align-package, $@)
Dan Willemsen17769622018-04-06 13:26:36 -0700109endif
Nicolas Geoffrayf3075272018-01-08 12:41:19 +0000110
Dan Willemsen17769622018-04-06 13:26:36 -0700111ifdef ART_TEST_TARGET_GTEST_Main_DEX
Nicolas Geoffrayf3075272018-01-08 12:41:19 +0000112$(ART_TEST_TARGET_GTEST_MainUncompressed_DEX): $(ART_TEST_TARGET_GTEST_Main_DEX) $(ZIPALIGN)
113 cp $< $@
114 $(call uncompress-dexs, $@)
115 $(call align-package, $@)
Dan Willemsen17769622018-04-06 13:26:36 -0700116endif
Nicolas Geoffrayf3075272018-01-08 12:41:19 +0000117
Dan Willemsen17769622018-04-06 13:26:36 -0700118ifdef ART_TEST_HOST_GTEST_Main_DEX
Mathieu Chartier700a9852018-02-06 18:27:38 -0800119$(ART_TEST_HOST_GTEST_EmptyUncompressed_DEX): $(ZIPALIGN)
120 touch $(dir $@)classes.dex
121 zip -j -qD -X -0 $@ $(dir $@)classes.dex
122 rm $(dir $@)classes.dex
Dan Willemsen17769622018-04-06 13:26:36 -0700123endif
Mathieu Chartier700a9852018-02-06 18:27:38 -0800124
Dan Willemsen17769622018-04-06 13:26:36 -0700125ifdef ART_TEST_TARGET_GTEST_Main_DEX
Mathieu Chartier700a9852018-02-06 18:27:38 -0800126$(ART_TEST_TARGET_GTEST_EmptyUncompressed_DEX): $(ZIPALIGN)
127 touch $(dir $@)classes.dex
128 zip -j -qD -X -0 $@ $(dir $@)classes.dex
129 rm $(dir $@)classes.dex
Dan Willemsen17769622018-04-06 13:26:36 -0700130endif
Mathieu Chartier700a9852018-02-06 18:27:38 -0800131
Dan Willemsen17769622018-04-06 13:26:36 -0700132ifdef ART_TEST_HOST_GTEST_MultiDex_DEX
Andreas Gampefc604a72018-02-08 15:43:37 -0800133$(ART_TEST_HOST_GTEST_MultiDexUncompressed_DEX): $(ART_TEST_HOST_GTEST_MultiDex_DEX) $(ZIPALIGN)
134 cp $< $@
135 $(call uncompress-dexs, $@)
136 $(call align-package, $@)
Dan Willemsen17769622018-04-06 13:26:36 -0700137endif
Andreas Gampefc604a72018-02-08 15:43:37 -0800138
Dan Willemsen17769622018-04-06 13:26:36 -0700139ifdef ART_TEST_TARGET_GTEST_MultiDex_DEX
Andreas Gampefc604a72018-02-08 15:43:37 -0800140$(ART_TEST_TARGET_GTEST_MultiDexUncompressed_DEX): $(ART_TEST_TARGET_GTEST_MultiDex_DEX) $(ZIPALIGN)
141 cp $< $@
142 $(call uncompress-dexs, $@)
143 $(call align-package, $@)
Dan Willemsen17769622018-04-06 13:26:36 -0700144endif
Andreas Gampefc604a72018-02-08 15:43:37 -0800145
David Brazdilca3c8c32016-09-06 14:04:48 +0100146ART_TEST_GTEST_VerifierDeps_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifierDeps/*.smali))
Nicolas Geoffray7cc3ae52017-03-07 14:33:37 +0000147ART_TEST_GTEST_VerifierDepsMulti_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifierDepsMulti/*.smali))
David Brazdilca3c8c32016-09-06 14:04:48 +0100148ART_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 +0100149ART_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 +0000150ART_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))
151ART_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 +0100152
153$(ART_TEST_HOST_GTEST_VerifierDeps_DEX): $(ART_TEST_GTEST_VerifierDeps_SRC) $(HOST_OUT_EXECUTABLES)/smali
Ben Gruver14fc9db2017-04-28 15:30:49 -0700154 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
David Brazdilca3c8c32016-09-06 14:04:48 +0100155
David Brazdilf906f122016-09-16 16:33:31 +0100156$(ART_TEST_TARGET_GTEST_VerifierDeps_DEX): $(ART_TEST_GTEST_VerifierDeps_SRC) $(HOST_OUT_EXECUTABLES)/smali
Ben Gruver14fc9db2017-04-28 15:30:49 -0700157 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
David Brazdilf906f122016-09-16 16:33:31 +0100158
Nicolas Geoffray7cc3ae52017-03-07 14:33:37 +0000159$(ART_TEST_HOST_GTEST_VerifierDepsMulti_DEX): $(ART_TEST_GTEST_VerifierDepsMulti_SRC) $(HOST_OUT_EXECUTABLES)/smali
Ben Gruver14fc9db2017-04-28 15:30:49 -0700160 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
Nicolas Geoffray7cc3ae52017-03-07 14:33:37 +0000161
162$(ART_TEST_TARGET_GTEST_VerifierDepsMulti_DEX): $(ART_TEST_GTEST_VerifierDepsMulti_SRC) $(HOST_OUT_EXECUTABLES)/smali
Ben Gruver14fc9db2017-04-28 15:30:49 -0700163 $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^)
Nicolas Geoffray7cc3ae52017-03-07 14:33:37 +0000164
Ian Rogersafd9acc2014-06-17 08:21:54 -0700165# Dex file dependencies for each gtest.
David Sehr139512d2018-02-08 15:44:50 -0800166ART_GTEST_art_dex_file_loader_test_DEX_DEPS := GetMethodSignature Main Nested MultiDex
Andreas Gampecac31ad2017-11-06 20:01:17 -0800167ART_GTEST_dex2oat_environment_tests_DEX_DEPS := Main MainStripped MultiDex MultiDexModifiedSecondary MyClassNatives Nested VerifierDeps VerifierDepsMulti
Andreas Gampee1459ae2016-06-29 09:36:30 -0700168
Mathieu Chartier93764b82017-07-17 14:51:53 -0700169ART_GTEST_atomic_dex_ref_map_test_DEX_DEPS := Interfaces
Calin Juravlecdd49122017-07-05 20:09:53 -0700170ART_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 -0700171ART_GTEST_class_loader_context_test_DEX_DEPS := Main MultiDex MyClass ForClassLoaderA ForClassLoaderB ForClassLoaderC ForClassLoaderD
Mathieu Chartierdb70ce52016-12-12 11:06:59 -0800172ART_GTEST_class_table_test_DEX_DEPS := XandY
Calin Juravle877fd962016-01-05 14:29:29 +0000173ART_GTEST_compiler_driver_test_DEX_DEPS := AbstractMethod StaticLeafMethods ProfileTestMultiDex
Narayan Kamath25352fc2016-08-03 12:46:58 +0100174ART_GTEST_dex_cache_test_DEX_DEPS := Main Packages MethodTypes
Mathieu Chartier2e0478a2018-04-06 14:33:25 -0700175ART_GTEST_dexanalyze_test_DEX_DEPS := MultiDex
Mathieu Chartierd00e02b2017-05-24 12:04:13 -0700176ART_GTEST_dexlayout_test_DEX_DEPS := ManyMethods
Mathieu Chartier700a9852018-02-06 18:27:38 -0800177ART_GTEST_dex2oat_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) ManyMethods Statics VerifierDeps MainUncompressed EmptyUncompressed
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700178ART_GTEST_dex2oat_image_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) Statics VerifierDeps
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700179ART_GTEST_exception_test_DEX_DEPS := ExceptionHandle
David Brazdil2b9c35b2018-01-12 15:44:43 +0000180ART_GTEST_hiddenapi_test_DEX_DEPS := HiddenApi
Mathew Inwood7d74ef52018-03-16 14:18:33 +0000181ART_GTEST_hidden_api_test_DEX_DEPS := HiddenApiSignatures
Artem Udovichenkob3f2b5c2017-01-31 11:49:33 +0300182ART_GTEST_image_test_DEX_DEPS := ImageLayoutA ImageLayoutB DefaultMethods
Andreas Gampea1ff30f2016-09-27 12:19:45 -0700183ART_GTEST_imtable_test_DEX_DEPS := IMTA IMTB
Sebastien Hertz0462c4c2015-04-01 16:34:17 +0200184ART_GTEST_instrumentation_test_DEX_DEPS := Instrumentation
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700185ART_GTEST_jni_compiler_test_DEX_DEPS := MyClassNatives
186ART_GTEST_jni_internal_test_DEX_DEPS := AllFields StaticLeafMethods
Andreas Gampee1459ae2016-06-29 09:36:30 -0700187ART_GTEST_oat_file_assistant_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS)
Calin Juravle36eb3132017-01-13 16:32:38 -0800188ART_GTEST_dexoptanalyzer_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS)
Richard Uhler84f50ae2017-02-06 15:12:45 +0000189ART_GTEST_image_space_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS)
Andreas Gampefc604a72018-02-08 15:43:37 -0800190ART_GTEST_oat_file_test_DEX_DEPS := Main MultiDex MainUncompressed MultiDexUncompressed
Mathieu Chartier07ddb6f2015-11-05 11:16:34 -0800191ART_GTEST_oat_test_DEX_DEPS := Main
Roland Levillain1f130f12018-03-12 18:39:19 +0000192ART_GTEST_oat_writer_test_DEX_DEPS := Main
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700193ART_GTEST_object_test_DEX_DEPS := ProtoCompare ProtoCompare2 StaticsFromCode XandY
Alex Klyubind1d5c952017-12-15 12:57:33 -0800194ART_GTEST_patchoat_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS)
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700195ART_GTEST_proxy_test_DEX_DEPS := Interfaces
196ART_GTEST_reflection_test_DEX_DEPS := Main NonStaticLeafMethods StaticLeafMethods
Calin Juravle877fd962016-01-05 14:29:29 +0000197ART_GTEST_profile_assistant_test_DEX_DEPS := ProfileTestMultiDex
Mathieu Chartierdb40eac2017-06-09 18:34:11 -0700198ART_GTEST_profile_compilation_info_test_DEX_DEPS := ManyMethods ProfileTestMultiDex
Andreas Gampe0f01b582017-01-18 15:22:37 -0800199ART_GTEST_runtime_callbacks_test_DEX_DEPS := XandY
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700200ART_GTEST_stub_test_DEX_DEPS := AllFields
201ART_GTEST_transaction_test_DEX_DEPS := Transaction
Artem Udovichenkod9786b02015-10-14 16:36:55 +0300202ART_GTEST_type_lookup_table_test_DEX_DEPS := Lookup
Andreas Gampeae78c262017-02-01 20:40:44 -0800203ART_GTEST_unstarted_runtime_test_DEX_DEPS := Nested
Mathieu Chartier1ca68902017-04-18 11:26:22 -0700204ART_GTEST_heap_verification_test_DEX_DEPS := ProtoCompare ProtoCompare2 StaticsFromCode XandY
Nicolas Geoffray7cc3ae52017-03-07 14:33:37 +0000205ART_GTEST_verifier_deps_test_DEX_DEPS := VerifierDeps VerifierDepsMulti MultiDex
Nicolas Geoffray01b70e82016-11-17 10:58:36 +0000206ART_GTEST_dex_to_dex_decompiler_test_DEX_DEPS := VerifierDeps DexToDexDecompiler
Vladimir Marko421087b2018-02-27 11:00:17 +0000207ART_GTEST_oatdump_app_test_DEX_DEPS := ProfileTestMultiDex
Ian Rogersafd9acc2014-06-17 08:21:54 -0700208
209# The elf writer test has dependencies on core.oat.
Richard Uhler67e1dc52017-02-06 16:50:17 +0000210ART_GTEST_elf_writer_test_HOST_DEPS := $(HOST_CORE_IMAGE_DEFAULT_64) $(HOST_CORE_IMAGE_DEFAULT_32)
211ART_GTEST_elf_writer_test_TARGET_DEPS := $(TARGET_CORE_IMAGE_DEFAULT_64) $(TARGET_CORE_IMAGE_DEFAULT_32)
Brian Carlstrom53463ea2014-11-09 14:11:51 -0800212
Andreas Gampee1459ae2016-06-29 09:36:30 -0700213ART_GTEST_dex2oat_environment_tests_HOST_DEPS := \
Richard Uhlerbb00f812017-02-16 14:21:10 +0000214 $(HOST_CORE_IMAGE_optimizing_64) \
215 $(HOST_CORE_IMAGE_optimizing_32) \
216 $(HOST_CORE_IMAGE_interpreter_64) \
217 $(HOST_CORE_IMAGE_interpreter_32) \
Andreas Gampe47200462017-11-09 11:40:03 -0800218 patchoatd-host
Andreas Gampee1459ae2016-06-29 09:36:30 -0700219ART_GTEST_dex2oat_environment_tests_TARGET_DEPS := \
Richard Uhlerbb00f812017-02-16 14:21:10 +0000220 $(TARGET_CORE_IMAGE_optimizing_64) \
221 $(TARGET_CORE_IMAGE_optimizing_32) \
222 $(TARGET_CORE_IMAGE_interpreter_64) \
223 $(TARGET_CORE_IMAGE_interpreter_32) \
Andreas Gampe47200462017-11-09 11:40:03 -0800224 patchoatd-target
Andreas Gampee1459ae2016-06-29 09:36:30 -0700225
David Srbeckyec2cdf42017-12-08 16:21:25 +0000226ART_GTEST_oat_file_test_HOST_DEPS := \
227 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS)
228ART_GTEST_oat_file_test_TARGET_DEPS := \
229 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS)
230
Andreas Gampee1459ae2016-06-29 09:36:30 -0700231ART_GTEST_oat_file_assistant_test_HOST_DEPS := \
Richard Uhlerf51ac422016-07-08 09:22:33 -0700232 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS)
Andreas Gampee1459ae2016-06-29 09:36:30 -0700233ART_GTEST_oat_file_assistant_test_TARGET_DEPS := \
Richard Uhlerf51ac422016-07-08 09:22:33 -0700234 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS)
Andreas Gampee1459ae2016-06-29 09:36:30 -0700235
Calin Juravle36eb3132017-01-13 16:32:38 -0800236ART_GTEST_dexoptanalyzer_test_HOST_DEPS := \
237 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) \
Andreas Gampe47200462017-11-09 11:40:03 -0800238 dexoptanalyzerd-host
Calin Juravle36eb3132017-01-13 16:32:38 -0800239ART_GTEST_dexoptanalyzer_test_TARGET_DEPS := \
240 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
Andreas Gampe47200462017-11-09 11:40:03 -0800241 dexoptanalyzerd-target
Andreas Gampee1459ae2016-06-29 09:36:30 -0700242
Richard Uhler84f50ae2017-02-06 15:12:45 +0000243ART_GTEST_image_space_test_HOST_DEPS := \
244 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS)
245ART_GTEST_image_space_test_TARGET_DEPS := \
246 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS)
247
Andreas Gampee1459ae2016-06-29 09:36:30 -0700248ART_GTEST_dex2oat_test_HOST_DEPS := \
Andreas Gampe47200462017-11-09 11:40:03 -0800249 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) \
250 dex2oatd-host
Andreas Gampee1459ae2016-06-29 09:36:30 -0700251ART_GTEST_dex2oat_test_TARGET_DEPS := \
Andreas Gampe47200462017-11-09 11:40:03 -0800252 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
253 dex2oatd-target
Richard Uhler66d874d2015-01-15 09:37:19 -0800254
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700255ART_GTEST_dex2oat_image_test_HOST_DEPS := \
Andreas Gampe47200462017-11-09 11:40:03 -0800256 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) \
257 dex2oatd-host
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700258ART_GTEST_dex2oat_image_test_TARGET_DEPS := \
Andreas Gampe47200462017-11-09 11:40:03 -0800259 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \
260 dex2oatd-target
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700261
Brian Carlstrom53463ea2014-11-09 14:11:51 -0800262# TODO: document why this is needed.
Richard Uhler67e1dc52017-02-06 16:50:17 +0000263ART_GTEST_proxy_test_HOST_DEPS := $(HOST_CORE_IMAGE_DEFAULT_64) $(HOST_CORE_IMAGE_DEFAULT_32)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700264
David Sehr55232f12017-04-19 14:06:49 -0700265# The dexdiag test requires the dexdiag utility.
Andreas Gampe47200462017-11-09 11:40:03 -0800266ART_GTEST_dexdiag_test_HOST_DEPS := dexdiag-host
267ART_GTEST_dexdiag_test_TARGET_DEPS := dexdiag-target
David Sehr55232f12017-04-19 14:06:49 -0700268
Aart Bikcfbe53c2015-07-06 14:27:27 -0700269# The dexdump test requires an image and the dexdump utility.
Aart Bik22c26f52015-07-08 21:20:13 +0000270# TODO: rename into dexdump when migration completes
Aart Bikcfbe53c2015-07-06 14:27:27 -0700271ART_GTEST_dexdump_test_HOST_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000272 $(HOST_CORE_IMAGE_DEFAULT_64) \
273 $(HOST_CORE_IMAGE_DEFAULT_32) \
Andreas Gampe47200462017-11-09 11:40:03 -0800274 dexdump2-host
Aart Bikcfbe53c2015-07-06 14:27:27 -0700275ART_GTEST_dexdump_test_TARGET_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000276 $(TARGET_CORE_IMAGE_DEFAULT_64) \
277 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Andreas Gampe47200462017-11-09 11:40:03 -0800278 dexdump2-target
Aart Bikcfbe53c2015-07-06 14:27:27 -0700279
Jeff Haoc3acfc52016-08-29 14:18:26 -0700280# The dexlayout test requires an image and the dexlayout utility.
281# TODO: rename into dexdump when migration completes
282ART_GTEST_dexlayout_test_HOST_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000283 $(HOST_CORE_IMAGE_DEFAULT_64) \
284 $(HOST_CORE_IMAGE_DEFAULT_32) \
Andreas Gampe693bfbf2017-11-10 12:23:31 -0800285 dexlayoutd-host \
Andreas Gampe47200462017-11-09 11:40:03 -0800286 dexdump2-host
Jeff Haoc3acfc52016-08-29 14:18:26 -0700287ART_GTEST_dexlayout_test_TARGET_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000288 $(TARGET_CORE_IMAGE_DEFAULT_64) \
289 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Andreas Gampe693bfbf2017-11-10 12:23:31 -0800290 dexlayoutd-target \
Andreas Gampe47200462017-11-09 11:40:03 -0800291 dexdump2-target
Jeff Haoc3acfc52016-08-29 14:18:26 -0700292
Aart Bik3e40f4a2015-07-07 17:09:41 -0700293# The dexlist test requires an image and the dexlist utility.
Aart Bik3e40f4a2015-07-07 17:09:41 -0700294ART_GTEST_dexlist_test_HOST_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000295 $(HOST_CORE_IMAGE_DEFAULT_64) \
296 $(HOST_CORE_IMAGE_DEFAULT_32) \
Andreas Gampe47200462017-11-09 11:40:03 -0800297 dexlist-host
Aart Bik3e40f4a2015-07-07 17:09:41 -0700298ART_GTEST_dexlist_test_TARGET_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000299 $(TARGET_CORE_IMAGE_DEFAULT_64) \
300 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Andreas Gampe47200462017-11-09 11:40:03 -0800301 dexlist-target
Aart Bik3e40f4a2015-07-07 17:09:41 -0700302
Igor Murashkin37743352014-11-13 14:38:00 -0800303# The imgdiag test has dependencies on core.oat since it needs to load it during the test.
Andreas Gampec93b8b52014-12-19 23:12:25 -0800304# For the host, also add the installed tool (in the base size, that should suffice). For the
305# target, just the module is fine, the sync will happen late enough.
306ART_GTEST_imgdiag_test_HOST_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000307 $(HOST_CORE_IMAGE_DEFAULT_64) \
308 $(HOST_CORE_IMAGE_DEFAULT_32) \
Andreas Gampe47200462017-11-09 11:40:03 -0800309 imgdiagd-host
Andreas Gampec93b8b52014-12-19 23:12:25 -0800310ART_GTEST_imgdiag_test_TARGET_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000311 $(TARGET_CORE_IMAGE_DEFAULT_64) \
312 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Andreas Gampe47200462017-11-09 11:40:03 -0800313 imgdiagd-target
Igor Murashkin37743352014-11-13 14:38:00 -0800314
Mathieu Chartier2e0478a2018-04-06 14:33:25 -0700315# Dex analyze test requires dexanalyze.
316ART_GTEST_dexanalyze_test_HOST_DEPS := \
317 dexanalyze-host
318ART_GTEST_dexanalyze_test_TARGET_DEPS := \
319 dexanalyze-target
320
Mathieu Chartierea216b32015-05-26 19:48:16 -0700321# Oatdump test requires an image and oatfile to dump.
322ART_GTEST_oatdump_test_HOST_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000323 $(HOST_CORE_IMAGE_DEFAULT_64) \
324 $(HOST_CORE_IMAGE_DEFAULT_32) \
Andreas Gampe47200462017-11-09 11:40:03 -0800325 oatdumpd-host \
Mathieu Chartier567dc6f2018-04-05 16:37:14 -0700326 oatdumpds-host \
327 dexdump2-host
Mathieu Chartierea216b32015-05-26 19:48:16 -0700328ART_GTEST_oatdump_test_TARGET_DEPS := \
Richard Uhler67e1dc52017-02-06 16:50:17 +0000329 $(TARGET_CORE_IMAGE_DEFAULT_64) \
330 $(TARGET_CORE_IMAGE_DEFAULT_32) \
Mathieu Chartier567dc6f2018-04-05 16:37:14 -0700331 oatdumpd-target \
332 dexdump2-target
Vladimir Marko1352f132017-04-28 15:28:29 +0100333ART_GTEST_oatdump_image_test_HOST_DEPS := $(ART_GTEST_oatdump_test_HOST_DEPS)
334ART_GTEST_oatdump_image_test_TARGET_DEPS := $(ART_GTEST_oatdump_test_TARGET_DEPS)
Vladimir Marko421087b2018-02-27 11:00:17 +0000335ART_GTEST_oatdump_app_test_HOST_DEPS := $(ART_GTEST_oatdump_test_HOST_DEPS) \
336 dex2oatd-host \
337 dex2oatds-host
338ART_GTEST_oatdump_app_test_TARGET_DEPS := $(ART_GTEST_oatdump_test_TARGET_DEPS) \
339 dex2oatd-target
Mathieu Chartierea216b32015-05-26 19:48:16 -0700340
Alex Klyubind1d5c952017-12-15 12:57:33 -0800341ART_GTEST_patchoat_test_HOST_DEPS := \
342 $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS)
343ART_GTEST_patchoat_test_TARGET_DEPS := \
344 $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS)
345
Calin Juravle2e2db782016-02-23 12:00:03 +0000346# Profile assistant tests requires profman utility.
Andreas Gampe47200462017-11-09 11:40:03 -0800347ART_GTEST_profile_assistant_test_HOST_DEPS := profmand-host
Andreas Gampe693bfbf2017-11-10 12:23:31 -0800348ART_GTEST_profile_assistant_test_TARGET_DEPS := profmand-target
Calin Juravle2e2db782016-02-23 12:00:03 +0000349
David Brazdil2b9c35b2018-01-12 15:44:43 +0000350ART_GTEST_hiddenapi_test_HOST_DEPS := \
351 $(HOST_CORE_IMAGE_DEFAULT_64) \
352 $(HOST_CORE_IMAGE_DEFAULT_32) \
353 hiddenapid-host
354
Ian Rogersafd9acc2014-06-17 08:21:54 -0700355# The path for which all the source files are relative, not actually the current directory.
Brian Carlstrom7940e442013-07-12 13:46:57 -0700356LOCAL_PATH := art
357
Colin Cross6e95dd52016-09-12 15:37:10 -0700358ART_TEST_MODULES := \
359 art_cmdline_tests \
360 art_compiler_tests \
361 art_compiler_host_tests \
362 art_dex2oat_tests \
Mathieu Chartier2e0478a2018-04-06 14:33:25 -0700363 art_dexanalyze_tests \
David Sehr55232f12017-04-19 14:06:49 -0700364 art_dexdiag_tests \
Colin Cross6e95dd52016-09-12 15:37:10 -0700365 art_dexdump_tests \
366 art_dexlayout_tests \
367 art_dexlist_tests \
Calin Juravle36eb3132017-01-13 16:32:38 -0800368 art_dexoptanalyzer_tests \
David Brazdil2b9c35b2018-01-12 15:44:43 +0000369 art_hiddenapi_tests \
Colin Cross6e95dd52016-09-12 15:37:10 -0700370 art_imgdiag_tests \
David Sehr67bf42e2018-02-26 16:43:04 -0800371 art_libartbase_tests \
David Sehr334b9d72018-02-12 18:27:56 -0800372 art_libdexfile_tests \
David Sehrd5f8de82018-04-27 14:12:03 -0700373 art_libprofile_tests \
Colin Cross6e95dd52016-09-12 15:37:10 -0700374 art_oatdump_tests \
Alex Klyubind1d5c952017-12-15 12:57:33 -0800375 art_patchoat_tests \
Colin Cross6e95dd52016-09-12 15:37:10 -0700376 art_profman_tests \
377 art_runtime_tests \
378 art_runtime_compiler_tests \
Josh Gao1eac77e2018-02-26 15:54:41 -0800379 art_sigchain_tests \
Brian Carlstroma1ce1fe2014-02-24 23:23:58 -0800380
Colin Cross6e95dd52016-09-12 15:37:10 -0700381ART_TARGET_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\
382 $(ART_TEST_LIST_device_$(TARGET_ARCH)_$(m)))
Alex Light50fa9932015-08-10 15:30:07 -0700383
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100384ifdef TARGET_2ND_ARCH
3852ND_ART_TARGET_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\
386 $(ART_TEST_LIST_device_$(2ND_TARGET_ARCH)_$(m)))
387endif
388
Colin Cross6e95dd52016-09-12 15:37:10 -0700389ART_HOST_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\
Colin Cross124f8812016-09-15 20:57:47 -0700390 $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_$(m)))
Alex Light50fa9932015-08-10 15:30:07 -0700391
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100392ifneq ($(HOST_PREFER_32_BIT),true)
3932ND_ART_HOST_GTEST_FILES += $(foreach m,$(ART_TEST_MODULES),\
394 $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_$(m)))
395endif
396
Ian Rogersafd9acc2014-06-17 08:21:54 -0700397# Variables holding collections of gtest pre-requisits used to run a number of gtests.
398ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
399ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
400ART_TEST_HOST_GTEST_RULES :=
401ART_TEST_HOST_VALGRIND_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
402ART_TEST_HOST_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
403ART_TEST_HOST_VALGRIND_GTEST_RULES :=
404ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
405ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
406ART_TEST_TARGET_GTEST_RULES :=
Anton Kirilove5e76f42016-05-03 16:15:36 +0100407ART_TEST_TARGET_VALGRIND_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
408ART_TEST_TARGET_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
409ART_TEST_TARGET_VALGRIND_GTEST_RULES :=
Nicolas Geoffray58035ae2015-05-27 19:10:27 +0100410ART_TEST_HOST_GTEST_DEPENDENCIES :=
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700411
Nicolas Geoffray96a37c82014-10-29 23:50:40 +0000412ART_GTEST_TARGET_ANDROID_ROOT := '/system'
413ifneq ($(ART_TEST_ANDROID_ROOT),)
414 ART_GTEST_TARGET_ANDROID_ROOT := $(ART_TEST_ANDROID_ROOT)
415endif
416
Colin Crossb0155292018-02-12 16:50:49 -0800417ART_VALGRIND_TARGET_DEPENDENCIES :=
418
419# Has to match list in external/valgrind/Android.build_one.mk
420ART_VALGRIND_SUPPORTED_ARCH := arm arm64 x86_64
421
422# Valgrind is not supported for x86
423ifneq (,$(filter $(ART_VALGRIND_SUPPORTED_ARCH),$(TARGET_ARCH)))
Colin Cross6497ede2018-02-14 11:23:09 -0800424art_vg_arch := $(if $(filter x86_64,$(TARGET_ARCH)),amd64,$(TARGET_ARCH))
Colin Crossb0155292018-02-12 16:50:49 -0800425ART_VALGRIND_TARGET_DEPENDENCIES += \
Anton Kirilove5e76f42016-05-03 16:15:36 +0100426 $(TARGET_OUT_EXECUTABLES)/valgrind \
Colin Cross6497ede2018-02-14 11:23:09 -0800427 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/memcheck-$(art_vg_arch)-linux \
428 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_core-$(art_vg_arch)-linux.so \
429 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_memcheck-$(art_vg_arch)-linux.so \
Anton Kirilove5e76f42016-05-03 16:15:36 +0100430 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/default.supp
Colin Cross6497ede2018-02-14 11:23:09 -0800431art_vg_arch :=
Colin Crossb0155292018-02-12 16:50:49 -0800432endif
Anton Kirilove5e76f42016-05-03 16:15:36 +0100433
434ifdef TARGET_2ND_ARCH
Colin Crossb0155292018-02-12 16:50:49 -0800435ifneq (,$(filter $(ART_VALGRIND_SUPPORTED_ARCH),$(TARGET_2ND_ARCH)))
Anton Kirilove5e76f42016-05-03 16:15:36 +0100436ART_VALGRIND_TARGET_DEPENDENCIES += \
437 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/memcheck-$(TARGET_2ND_ARCH)-linux \
438 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_core-$(TARGET_2ND_ARCH)-linux.so \
439 $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_memcheck-$(TARGET_2ND_ARCH)-linux.so
440endif
Colin Crossb0155292018-02-12 16:50:49 -0800441endif
Anton Kirilove5e76f42016-05-03 16:15:36 +0100442
443include $(CLEAR_VARS)
444LOCAL_MODULE := valgrind-target-suppressions.txt
445LOCAL_MODULE_CLASS := ETC
446LOCAL_MODULE_TAGS := optional
447LOCAL_SRC_FILES := test/valgrind-target-suppressions.txt
448LOCAL_MODULE_PATH := $(ART_TARGET_TEST_OUT)
449include $(BUILD_PREBUILT)
450
Ian Rogersafd9acc2014-06-17 08:21:54 -0700451# Define a make rule for a target device gtest.
452# $(1): gtest name - the name of the test we're building such as leb128_test.
Colin Cross6e95dd52016-09-12 15:37:10 -0700453# $(2): path relative to $OUT to the test binary
454# $(3): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
455# $(4): LD_LIBRARY_PATH or undefined - used in case libartd.so is not in /system/lib/
Ian Rogersafd9acc2014-06-17 08:21:54 -0700456define define-art-gtest-rule-target
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.
463 TEST_ART_TARGET_SYNC_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 \
Andreas Gampec7d4a582015-09-30 11:52:02 -0700469 $$(TARGET_OUT_JAVA_LIBRARIES)/core-libart-testdex.jar \
Anton Kirilove5e76f42016-05-03 16:15:36 +0100470 $$(TARGET_OUT_JAVA_LIBRARIES)/core-oj-testdex.jar \
471 $$(ART_TARGET_TEST_OUT)/valgrind-target-suppressions.txt
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700472
Colin Cross6e95dd52016-09-12 15:37:10 -0700473$$(gtest_rule) valgrind-$$(gtest_rule): PRIVATE_TARGET_EXE := $$(gtest_target_exe)
474
Roland Levillain76cfe612017-10-30 13:14:28 +0000475ifeq ($(ART_TEST_CHROOT),)
476# Non-chroot configuration.
477maybe_art_test_chroot :=
478maybe_chroot_command :=
479else
480# Chroot configuration.
481maybe_art_test_chroot := $(ART_TEST_CHROOT)/
482maybe_chroot_command := chroot $(ART_TEST_CHROOT)
483endif
484
485# File witnessing the success of the gtest, the presence of which means the gtest's success.
486gtest_witness := $(maybe_art_test_chroot)$(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID
487
Ian Rogersafd9acc2014-06-17 08:21:54 -0700488.PHONY: $$(gtest_rule)
489$$(gtest_rule): test-art-target-sync
Roland Levillain76cfe612017-10-30 13:14:28 +0000490 $(hide) adb shell touch $(gtest_witness)
491 $(hide) adb shell rm $(gtest_witness)
492 $(hide) adb shell chmod 755 $(maybe_art_test_chroot)$$(PRIVATE_TARGET_EXE)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700493 $(hide) $$(call ART_TEST_SKIP,$$@) && \
Roland Levillain76cfe612017-10-30 13:14:28 +0000494 (adb shell "$(maybe_chroot_command) env $(GCOV_ENV) LD_LIBRARY_PATH=$(4) \
Roland Levillaina42e7042017-10-30 17:24:43 +0000495 ANDROID_ROOT=$(ART_GTEST_TARGET_ANDROID_ROOT) $$(PRIVATE_TARGET_EXE) \
Roland Levillain76cfe612017-10-30 13:14:28 +0000496 && touch $(gtest_witness)" \
497 && (adb pull $(gtest_witness) /tmp/ && $$(call ART_TEST_PASSED,$$@)) \
Roland Levillaina42e7042017-10-30 17:24:43 +0000498 || $$(call ART_TEST_FAILED,$$@))
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700499 $(hide) rm -f /tmp/$$@-$$$$PPID
Ian Rogersafd9acc2014-06-17 08:21:54 -0700500
Colin Cross6e95dd52016-09-12 15:37:10 -0700501 ART_TEST_TARGET_GTEST$($(3)ART_PHONY_TEST_TARGET_SUFFIX)_RULES += $$(gtest_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700502 ART_TEST_TARGET_GTEST_RULES += $$(gtest_rule)
503 ART_TEST_TARGET_GTEST_$(1)_RULES += $$(gtest_rule)
504
Anton Kirilove5e76f42016-05-03 16:15:36 +0100505.PHONY: valgrind-$$(gtest_rule)
506valgrind-$$(gtest_rule): $(ART_VALGRIND_TARGET_DEPENDENCIES) test-art-target-sync
Roland Levillain76cfe612017-10-30 13:14:28 +0000507 $(hide) adb shell touch $(gtest_witness)
508 $(hide) adb shell rm $(gtest_witness)
509 $(hide) adb shell chmod 755 $(maybe_art_test_chroot)$$(PRIVATE_TARGET_EXE)
Anton Kirilove5e76f42016-05-03 16:15:36 +0100510 $(hide) $$(call ART_TEST_SKIP,$$@) && \
Roland Levillain76cfe612017-10-30 13:14:28 +0000511 (adb shell "$(maybe_chroot_command) env $(GCOV_ENV) LD_LIBRARY_PATH=$(4) \
Roland Levillaina42e7042017-10-30 17:24:43 +0000512 ANDROID_ROOT=$(ART_GTEST_TARGET_ANDROID_ROOT) \
513 $$$$ANDROID_ROOT/bin/valgrind \
514 --leak-check=full --error-exitcode=1 --workaround-gcc296-bugs=yes \
515 --suppressions=$(ART_TARGET_TEST_DIR)/valgrind-target-suppressions.txt \
516 --num-callers=50 --show-mismatched-frees=no $$(PRIVATE_TARGET_EXE) \
Roland Levillain76cfe612017-10-30 13:14:28 +0000517 && touch $(gtest_witness)" \
518 && (adb pull $(gtest_witness) /tmp/ && $$(call ART_TEST_PASSED,$$@)) \
Roland Levillaina42e7042017-10-30 17:24:43 +0000519 || $$(call ART_TEST_FAILED,$$@))
Anton Kirilove5e76f42016-05-03 16:15:36 +0100520 $(hide) rm -f /tmp/$$@-$$$$PPID
521
Roland Levillaina42e7042017-10-30 17:24:43 +0000522 ART_TEST_TARGET_VALGRIND_GTEST$$($(3)ART_PHONY_TEST_TARGET_SUFFIX)_RULES += \
523 valgrind-$$(gtest_rule)
Anton Kirilove5e76f42016-05-03 16:15:36 +0100524 ART_TEST_TARGET_VALGRIND_GTEST_RULES += valgrind-$$(gtest_rule)
525 ART_TEST_TARGET_VALGRIND_GTEST_$(1)_RULES += valgrind-$$(gtest_rule)
526
Ian Rogersafd9acc2014-06-17 08:21:54 -0700527 # Clear locally defined variables.
Roland Levillain76cfe612017-10-30 13:14:28 +0000528 gtest_witness :=
529 maybe_chroot_command :=
530 maybe_art_test_chroot :=
Colin Cross6e95dd52016-09-12 15:37:10 -0700531 gtest_target_exe :=
Roland Levillain76cfe612017-10-30 13:14:28 +0000532 gtest_exe :=
533 gtest_rule :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700534endef # define-art-gtest-rule-target
535
Andreas Gampe3c0bb312015-02-19 10:02:19 -0800536ART_VALGRIND_DEPENDENCIES := \
537 $(HOST_OUT_EXECUTABLES)/valgrind \
538 $(HOST_OUT)/lib64/valgrind/memcheck-amd64-linux \
539 $(HOST_OUT)/lib64/valgrind/memcheck-x86-linux \
540 $(HOST_OUT)/lib64/valgrind/default.supp \
541 $(HOST_OUT)/lib64/valgrind/vgpreload_core-amd64-linux.so \
542 $(HOST_OUT)/lib64/valgrind/vgpreload_core-x86-linux.so \
543 $(HOST_OUT)/lib64/valgrind/vgpreload_memcheck-amd64-linux.so \
544 $(HOST_OUT)/lib64/valgrind/vgpreload_memcheck-x86-linux.so
545
Ian Rogersafd9acc2014-06-17 08:21:54 -0700546# Define make rules for a host gtests.
547# $(1): gtest name - the name of the test we're building such as leb128_test.
Colin Cross6e95dd52016-09-12 15:37:10 -0700548# $(2): path relative to $OUT to the test binary
549# $(3): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
Ian Rogersafd9acc2014-06-17 08:21:54 -0700550define define-art-gtest-rule-host
Colin Cross6e95dd52016-09-12 15:37:10 -0700551 gtest_rule := test-art-host-gtest-$(1)$$($(3)ART_PHONY_TEST_HOST_SUFFIX)
552 gtest_exe := $(OUT_DIR)/$(2)
Ian Rogers665de8a2014-06-24 21:34:09 -0700553 # Dependencies for all host gtests.
554 gtest_deps := $$(HOST_CORE_DEX_LOCATIONS) \
Colin Cross6e95dd52016-09-12 15:37:10 -0700555 $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$$(ART_HOST_SHLIB_EXTENSION) \
556 $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$$(ART_HOST_SHLIB_EXTENSION) \
Nicolas Geoffray58035ae2015-05-27 19:10:27 +0100557 $$(gtest_exe) \
558 $$(ART_GTEST_$(1)_HOST_DEPS) \
559 $(foreach file,$(ART_GTEST_$(1)_DEX_DEPS),$(ART_TEST_HOST_GTEST_$(file)_DEX))
Andreas Gampeca881de2018-02-27 21:26:32 -0800560 ifneq (,$(DIST_DIR))
561 gtest_xml_output := --gtest_output=xml:$(DIST_DIR)/gtest/$(1)$$($(3)ART_PHONY_TEST_HOST_SUFFIX).xml
562 else
563 gtest_xml_output :=
564 endif
Ian Rogers665de8a2014-06-24 21:34:09 -0700565
Nicolas Geoffray58035ae2015-05-27 19:10:27 +0100566 ART_TEST_HOST_GTEST_DEPENDENCIES += $$(gtest_deps)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700567
Andreas Gampe6acebf42018-01-22 22:15:43 -0800568.PHONY: $$(gtest_rule)
569ifeq (,$(SANITIZE_HOST))
Andreas Gampeca881de2018-02-27 21:26:32 -0800570$$(gtest_rule): PRIVATE_XML_OUTPUT := $$(gtest_xml_output)
Andreas Gampe6acebf42018-01-22 22:15:43 -0800571$$(gtest_rule): $$(gtest_exe) $$(gtest_deps)
Andreas Gampeca881de2018-02-27 21:26:32 -0800572 $(hide) ($$(call ART_TEST_SKIP,$$@) && $$< $$(PRIVATE_XML_OUTPUT) && \
Andreas Gampe6acebf42018-01-22 22:15:43 -0800573 $$(call ART_TEST_PASSED,$$@)) || $$(call ART_TEST_FAILED,$$@)
574else
Andreas Gampe03858052017-05-01 08:17:24 -0700575# Note: envsetup currently exports ASAN_OPTIONS=detect_leaks=0 to suppress leak detection, as some
576# build tools (e.g., ninja) intentionally leak. We want leak checks when we run our tests, so
577# override ASAN_OPTIONS. b/37751350
Andreas Gampe6acebf42018-01-22 22:15:43 -0800578# Note 2: Under sanitization, also capture the output, and run it through the stack tool on failure
579# (with the x86-64 ABI, as this allows symbolization of both x86 and x86-64). We don't do this in
580# general as it loses all the color output, and we have our own symbolization step when not running
581# under ASAN.
Andreas Gampeca881de2018-02-27 21:26:32 -0800582$$(gtest_rule): PRIVATE_XML_OUTPUT := $$(gtest_xml_output)
Nicolas Geoffray0f7c06d2015-05-28 10:21:03 +0100583$$(gtest_rule): $$(gtest_exe) $$(gtest_deps)
Andreas Gampe6acebf42018-01-22 22:15:43 -0800584 $(hide) ($$(call ART_TEST_SKIP,$$@) && set -o pipefail && \
Andreas Gampeca881de2018-02-27 21:26:32 -0800585 ASAN_OPTIONS=detect_leaks=1 $$< $$(PRIVATE_XML_OUTPUT) 2>&1 | tee $$<.tmp.out >&2 && \
Andreas Gampe6acebf42018-01-22 22:15:43 -0800586 { $$(call ART_TEST_PASSED,$$@) ; rm $$<.tmp.out ; }) || \
Andreas Gampec05fd3f2018-01-23 14:22:07 -0800587 ( grep -q AddressSanitizer $$<.tmp.out && export ANDROID_BUILD_TOP=`pwd` && \
Andreas Gampe6acebf42018-01-22 22:15:43 -0800588 { echo "ABI: 'x86_64'" | cat - $$<.tmp.out | development/scripts/stack | tail -n 3000 ; } ; \
589 rm $$<.tmp.out ; $$(call ART_TEST_FAILED,$$@))
590endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700591
Colin Cross6e95dd52016-09-12 15:37:10 -0700592 ART_TEST_HOST_GTEST$$($(3)ART_PHONY_TEST_HOST_SUFFIX)_RULES += $$(gtest_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700593 ART_TEST_HOST_GTEST_RULES += $$(gtest_rule)
594 ART_TEST_HOST_GTEST_$(1)_RULES += $$(gtest_rule)
595
Andreas Gampe3c0bb312015-02-19 10:02:19 -0800596
Ian Rogersafd9acc2014-06-17 08:21:54 -0700597.PHONY: valgrind-$$(gtest_rule)
Andreas Gampe3db36002015-05-28 20:17:09 -0700598valgrind-$$(gtest_rule): $$(gtest_exe) $$(gtest_deps) $(ART_VALGRIND_DEPENDENCIES)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700599 $(hide) $$(call ART_TEST_SKIP,$$@) && \
Andreas Gampe8df91ac2015-02-20 13:15:15 -0800600 VALGRIND_LIB=$(HOST_OUT)/lib64/valgrind \
Hiroshi Yamauchidc15e892016-03-10 13:49:14 -0800601 $(HOST_OUT_EXECUTABLES)/valgrind --leak-check=full --error-exitcode=1 \
Andreas Gampebf13e802016-09-02 19:43:09 -0700602 --suppressions=art/test/valgrind-suppressions.txt --num-callers=50 \
603 $$< && \
Andreas Gampe3c0bb312015-02-19 10:02:19 -0800604 $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700605
Colin Cross6e95dd52016-09-12 15:37:10 -0700606 ART_TEST_HOST_VALGRIND_GTEST$$($(3)ART_PHONY_TEST_HOST_SUFFIX)_RULES += valgrind-$$(gtest_rule)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700607 ART_TEST_HOST_VALGRIND_GTEST_RULES += valgrind-$$(gtest_rule)
608 ART_TEST_HOST_VALGRIND_GTEST_$(1)_RULES += valgrind-$$(gtest_rule)
609
610 # Clear locally defined variables.
Ian Rogers665de8a2014-06-24 21:34:09 -0700611 gtest_deps :=
Roland Levillain76cfe612017-10-30 13:14:28 +0000612 gtest_exe :=
613 gtest_rule :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700614endef # define-art-gtest-rule-host
615
616# Define the rules to build and run host and target gtests.
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100617# $(1): file name
618# $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
619define define-art-gtest-target
620 art_gtest_filename := $(1)
Brian Carlstrom0796af02011-10-12 14:31:45 -0700621
Ian Rogersafd9acc2014-06-17 08:21:54 -0700622 include $$(CLEAR_VARS)
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -0700623 art_gtest_name := $$(notdir $$(basename $$(art_gtest_filename)))
Colin Cross6e95dd52016-09-12 15:37:10 -0700624
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100625 library_path :=
626 2ND_library_path :=
627 ifneq ($$(ART_TEST_ANDROID_ROOT),)
628 ifdef TARGET_2ND_ARCH
629 2ND_library_path := $$(ART_TEST_ANDROID_ROOT)/lib
630 library_path := $$(ART_TEST_ANDROID_ROOT)/lib64
631 else
632 ifneq ($(filter %64,$(TARGET_ARCH)),)
Nicolas Geoffray9eb40742014-10-29 22:38:53 +0000633 library_path := $$(ART_TEST_ANDROID_ROOT)/lib64
634 else
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100635 library_path := $$(ART_TEST_ANDROID_ROOT)/lib
Nicolas Geoffray9eb40742014-10-29 22:38:53 +0000636 endif
637 endif
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100638 endif
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -0700639
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100640 ifndef ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES
Ian Rogersafd9acc2014-06-17 08:21:54 -0700641 ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES :=
Anton Kirilove5e76f42016-05-03 16:15:36 +0100642 ART_TEST_TARGET_VALGRIND_GTEST_$$(art_gtest_name)_RULES :=
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100643 endif
644 $$(eval $$(call define-art-gtest-rule-target,$$(art_gtest_name),$$(art_gtest_filename),$(2),$$($(2)library_path)))
645
646 # Clear locally defined variables.
647 art_gtest_filename :=
648 art_gtest_name :=
649 library_path :=
650 2ND_library_path :=
651endef # define-art-gtest-target
652
653# $(1): file name
654# $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture.
655define define-art-gtest-host
656 art_gtest_filename := $(1)
657
658 include $$(CLEAR_VARS)
659 art_gtest_name := $$(notdir $$(basename $$(art_gtest_filename)))
660 ifndef ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES
661 ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES :=
662 ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES :=
663 endif
664 $$(eval $$(call define-art-gtest-rule-host,$$(art_gtest_name),$$(art_gtest_filename),$(2)))
665
666 # Clear locally defined variables.
667 art_gtest_filename :=
668 art_gtest_name :=
669endef # define-art-gtest-host
670
671# Define the rules to build and run gtests for both archs on target.
672# $(1): test name
673define define-art-gtest-target-both
674 art_gtest_name := $(1)
Andreas Gampeafbaa1a2014-03-25 18:09:32 -0700675
Ian Rogersafd9acc2014-06-17 08:21:54 -0700676 # A rule to run the different architecture versions of the gtest.
677.PHONY: test-art-target-gtest-$$(art_gtest_name)
678test-art-target-gtest-$$(art_gtest_name): $$(ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES)
679 $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
680
Anton Kirilove5e76f42016-05-03 16:15:36 +0100681.PHONY: valgrind-test-art-target-gtest-$$(art_gtest_name)
682valgrind-test-art-target-gtest-$$(art_gtest_name): $$(ART_TEST_TARGET_VALGRIND_GTEST_$$(art_gtest_name)_RULES)
683 $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
684
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100685 # Clear now unused variables.
686 ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES :=
687 ART_TEST_TARGET_VALGRIND_GTEST_$$(art_gtest_name)_RULES :=
688 art_gtest_name :=
689endef # define-art-gtest-target-both
Ian Rogersd912e5c2013-11-13 12:40:11 -0800690
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100691# Define the rules to build and run gtests for both archs on host.
692# $(1): test name
693define define-art-gtest-host-both
694 art_gtest_name := $(1)
695
Ian Rogersafd9acc2014-06-17 08:21:54 -0700696.PHONY: test-art-host-gtest-$$(art_gtest_name)
697test-art-host-gtest-$$(art_gtest_name): $$(ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES)
698 $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
Ian Rogersd912e5c2013-11-13 12:40:11 -0800699
Ian Rogersafd9acc2014-06-17 08:21:54 -0700700.PHONY: valgrind-test-art-host-gtest-$$(art_gtest_name)
701valgrind-test-art-host-gtest-$$(art_gtest_name): $$(ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES)
702 $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
703
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100704 # Clear now unused variables.
705 ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES :=
706 ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700707 art_gtest_name :=
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100708endef # define-art-gtest-host-both
Alex Light50fa9932015-08-10 15:30:07 -0700709
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700710ifeq ($(ART_BUILD_TARGET),true)
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100711 $(foreach file,$(ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest-target,$(file),)))
Dan Willemsen5d2dbf82018-04-11 12:31:11 -0700712 ifdef 2ND_ART_PHONY_TEST_TARGET_SUFFIX
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100713 $(foreach file,$(2ND_ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest-target,$(file),2ND_)))
714 endif
715 # Rules to run the different architecture versions of the gtest.
716 $(foreach file,$(ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest-target-both,$$(notdir $$(basename $$(file))))))
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700717endif
Ian Rogersc5f17732014-06-05 20:48:42 -0700718ifeq ($(ART_BUILD_HOST),true)
Nicolas Geoffray6bbea4c2016-09-16 16:41:43 +0100719 $(foreach file,$(ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host,$(file),)))
720 ifneq ($(HOST_PREFER_32_BIT),true)
721 $(foreach file,$(2ND_ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host,$(file),2ND_)))
722 endif
723 # Rules to run the different architecture versions of the gtest.
724 $(foreach file,$(ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host-both,$$(notdir $$(basename $$(file))))))
Brian Carlstrom07d579f2011-07-27 13:31:51 -0700725endif
Tsu Chiang Chuangec245a42014-05-15 21:16:21 -0700726
727# Used outside the art project to get a list of the current tests
728RUNTIME_TARGET_GTEST_MAKE_TARGETS :=
Dan Willemsencf767de2018-04-10 16:40:10 -0700729$(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 -0700730COMPILER_TARGET_GTEST_MAKE_TARGETS :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700731
732# Define all the combinations of host/target, valgrind and suffix such as:
733# test-art-host-gtest or valgrind-test-art-host-gtest64
734# $(1): host or target
735# $(2): HOST or TARGET
736# $(3): valgrind- or undefined
737# $(4): undefined, 32 or 64
738define define-test-art-gtest-combination
739 ifeq ($(1),host)
740 ifneq ($(2),HOST)
741 $$(error argument mismatch $(1) and ($2))
742 endif
743 else
744 ifneq ($(1),target)
745 $$(error found $(1) expected host or target)
746 endif
747 ifneq ($(2),TARGET)
748 $$(error argument mismatch $(1) and ($2))
749 endif
750 endif
751
752 rule_name := $(3)test-art-$(1)-gtest$(4)
Andreas Gampe928f72b2014-09-09 19:53:48 -0700753 ifeq ($(3),valgrind-)
Andreas Gampe928f72b2014-09-09 19:53:48 -0700754 dependencies := $$(ART_TEST_$(2)_VALGRIND_GTEST$(4)_RULES)
755 else
756 dependencies := $$(ART_TEST_$(2)_GTEST$(4)_RULES)
757 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700758
759.PHONY: $$(rule_name)
Alan Leung50173eb2017-12-20 13:33:21 -0800760$$(rule_name): $$(dependencies) dx d8-compat-dx desugar
Ian Rogersafd9acc2014-06-17 08:21:54 -0700761 $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@)
762
763 # Clear locally defined variables.
764 rule_name :=
765 dependencies :=
766endef # define-test-art-gtest-combination
767
768$(eval $(call define-test-art-gtest-combination,target,TARGET,,))
Anton Kirilove5e76f42016-05-03 16:15:36 +0100769$(eval $(call define-test-art-gtest-combination,target,TARGET,valgrind-,))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700770$(eval $(call define-test-art-gtest-combination,target,TARGET,,$(ART_PHONY_TEST_TARGET_SUFFIX)))
Anton Kirilove5e76f42016-05-03 16:15:36 +0100771$(eval $(call define-test-art-gtest-combination,target,TARGET,valgrind-,$(ART_PHONY_TEST_TARGET_SUFFIX)))
Dan Willemsen5d2dbf82018-04-11 12:31:11 -0700772ifdef 2ND_ART_PHONY_TEST_TARGET_SUFFIX
Ian Rogersafd9acc2014-06-17 08:21:54 -0700773$(eval $(call define-test-art-gtest-combination,target,TARGET,,$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)))
Anton Kirilove5e76f42016-05-03 16:15:36 +0100774$(eval $(call define-test-art-gtest-combination,target,TARGET,valgrind-,$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)))
Ian Rogersafd9acc2014-06-17 08:21:54 -0700775endif
776$(eval $(call define-test-art-gtest-combination,host,HOST,,))
777$(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,))
778$(eval $(call define-test-art-gtest-combination,host,HOST,,$(ART_PHONY_TEST_HOST_SUFFIX)))
779$(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,$(ART_PHONY_TEST_HOST_SUFFIX)))
780ifneq ($(HOST_PREFER_32_BIT),true)
781$(eval $(call define-test-art-gtest-combination,host,HOST,,$(2ND_ART_PHONY_TEST_HOST_SUFFIX)))
782$(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,$(2ND_ART_PHONY_TEST_HOST_SUFFIX)))
783endif
784
785# Clear locally defined variables.
786define-art-gtest-rule-target :=
787define-art-gtest-rule-host :=
788define-art-gtest :=
789define-test-art-gtest-combination :=
790RUNTIME_GTEST_COMMON_SRC_FILES :=
791COMPILER_GTEST_COMMON_SRC_FILES :=
792RUNTIME_GTEST_TARGET_SRC_FILES :=
793RUNTIME_GTEST_HOST_SRC_FILES :=
794COMPILER_GTEST_TARGET_SRC_FILES :=
795COMPILER_GTEST_HOST_SRC_FILES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700796ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
797ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
798ART_TEST_HOST_GTEST_RULES :=
799ART_TEST_HOST_VALGRIND_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
800ART_TEST_HOST_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES :=
801ART_TEST_HOST_VALGRIND_GTEST_RULES :=
802ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
803ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
804ART_TEST_TARGET_GTEST_RULES :=
Anton Kirilove5e76f42016-05-03 16:15:36 +0100805ART_TEST_TARGET_VALGRIND_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
806ART_TEST_TARGET_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES :=
807ART_TEST_TARGET_VALGRIND_GTEST_RULES :=
Nicolas Geoffray96a37c82014-10-29 23:50:40 +0000808ART_GTEST_TARGET_ANDROID_ROOT :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700809ART_GTEST_class_linker_test_DEX_DEPS :=
Mathieu Chartierdb70ce52016-12-12 11:06:59 -0800810ART_GTEST_class_table_test_DEX_DEPS :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700811ART_GTEST_compiler_driver_test_DEX_DEPS :=
812ART_GTEST_dex_file_test_DEX_DEPS :=
813ART_GTEST_exception_test_DEX_DEPS :=
814ART_GTEST_elf_writer_test_HOST_DEPS :=
815ART_GTEST_elf_writer_test_TARGET_DEPS :=
Andreas Gampea1ff30f2016-09-27 12:19:45 -0700816ART_GTEST_imtable_test_DEX_DEPS :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700817ART_GTEST_jni_compiler_test_DEX_DEPS :=
818ART_GTEST_jni_internal_test_DEX_DEPS :=
Richard Uhler66d874d2015-01-15 09:37:19 -0800819ART_GTEST_oat_file_assistant_test_DEX_DEPS :=
820ART_GTEST_oat_file_assistant_test_HOST_DEPS :=
821ART_GTEST_oat_file_assistant_test_TARGET_DEPS :=
Mathieu Chartier0be7fa72018-04-12 10:13:29 -0700822ART_GTEST_dexanalyze_test_DEX_DEPS :=
Calin Juravle36eb3132017-01-13 16:32:38 -0800823ART_GTEST_dexoptanalyzer_test_DEX_DEPS :=
824ART_GTEST_dexoptanalyzer_test_HOST_DEPS :=
825ART_GTEST_dexoptanalyzer_test_TARGET_DEPS :=
Richard Uhler84f50ae2017-02-06 15:12:45 +0000826ART_GTEST_image_space_test_DEX_DEPS :=
827ART_GTEST_image_space_test_HOST_DEPS :=
828ART_GTEST_image_space_test_TARGET_DEPS :=
Andreas Gampee1459ae2016-06-29 09:36:30 -0700829ART_GTEST_dex2oat_test_DEX_DEPS :=
830ART_GTEST_dex2oat_test_HOST_DEPS :=
831ART_GTEST_dex2oat_test_TARGET_DEPS :=
Mathieu Chartierf70fe3d2017-06-21 15:24:02 -0700832ART_GTEST_dex2oat_image_test_DEX_DEPS :=
833ART_GTEST_dex2oat_image_test_HOST_DEPS :=
834ART_GTEST_dex2oat_image_test_TARGET_DEPS :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700835ART_GTEST_object_test_DEX_DEPS :=
Alex Klyubind1d5c952017-12-15 12:57:33 -0800836ART_GTEST_patchoat_test_DEX_DEPS :=
837ART_GTEST_patchoat_test_HOST_DEPS :=
838ART_GTEST_patchoat_test_TARGET_DEPS :=
Brian Carlstromeb85f2b2014-06-25 13:23:00 -0700839ART_GTEST_proxy_test_DEX_DEPS :=
840ART_GTEST_reflection_test_DEX_DEPS :=
841ART_GTEST_stub_test_DEX_DEPS :=
842ART_GTEST_transaction_test_DEX_DEPS :=
Andreas Gampee1459ae2016-06-29 09:36:30 -0700843ART_GTEST_dex2oat_environment_tests_DEX_DEPS :=
Mathieu Chartier1ca68902017-04-18 11:26:22 -0700844ART_GTEST_heap_verification_test_DEX_DEPS :=
David Brazdilca3c8c32016-09-06 14:04:48 +0100845ART_GTEST_verifier_deps_test_DEX_DEPS :=
Andreas Gampe3c0bb312015-02-19 10:02:19 -0800846ART_VALGRIND_DEPENDENCIES :=
Anton Kirilove5e76f42016-05-03 16:15:36 +0100847ART_VALGRIND_TARGET_DEPENDENCIES :=
Ian Rogers1a2f84e2014-07-07 16:05:18 -0700848$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_TARGET_GTEST_$(dir)_DEX :=))
849$(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_HOST_GTEST_$(dir)_DEX :=))
Richard Uhler66d874d2015-01-15 09:37:19 -0800850ART_TEST_HOST_GTEST_MainStripped_DEX :=
851ART_TEST_TARGET_GTEST_MainStripped_DEX :=
Nicolas Geoffrayf3075272018-01-08 12:41:19 +0000852ART_TEST_HOST_GTEST_MainUncompressed_DEX :=
853ART_TEST_TARGET_GTEST_MainUncompressed_DEX :=
Mathieu Chartier700a9852018-02-06 18:27:38 -0800854ART_TEST_HOST_GTEST_EmptyUncompressed_DEX :=
855ART_TEST_TARGET_GTEST_EmptyUncompressed_DEX :=
David Brazdilca3c8c32016-09-06 14:04:48 +0100856ART_TEST_GTEST_VerifierDeps_SRC :=
857ART_TEST_HOST_GTEST_VerifierDeps_DEX :=
David Brazdilf906f122016-09-16 16:33:31 +0100858ART_TEST_TARGET_GTEST_VerifierDeps_DEX :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700859GTEST_DEX_DIRECTORIES :=
Brian Carlstrom532714a2014-06-25 02:15:31 -0700860LOCAL_PATH :=