Carl Shapiro | 008e412 | 2011-06-23 17:27:46 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2011 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 17 | # The path for which all the dex files are relative, not actually the current directory. |
| 18 | LOCAL_PATH := art/test |
| 19 | |
| 20 | include art/build/Android.common_test.mk |
| 21 | include art/build/Android.common_path.mk |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 22 | include art/build/Android.common_build.mk |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 23 | |
| 24 | # Subdirectories in art/test which contain dex files used as inputs for gtests. |
| 25 | GTEST_DEX_DIRECTORIES := \ |
| 26 | AbstractMethod \ |
| 27 | AllFields \ |
Artem Udovichenko | b3f2b5c | 2017-01-31 11:49:33 +0300 | [diff] [blame] | 28 | DefaultMethods \ |
Nicolas Geoffray | 01b70e8 | 2016-11-17 10:58:36 +0000 | [diff] [blame] | 29 | DexToDexDecompiler \ |
Mathieu Chartier | 1e4841e | 2016-12-15 14:21:04 -0800 | [diff] [blame] | 30 | ErroneousA \ |
| 31 | ErroneousB \ |
Vladimir Marko | 72ab684 | 2017-01-20 19:32:50 +0000 | [diff] [blame] | 32 | ErroneousInit \ |
Calin Juravle | cdd4912 | 2017-07-05 20:09:53 -0700 | [diff] [blame] | 33 | ForClassLoaderA \ |
| 34 | ForClassLoaderB \ |
| 35 | ForClassLoaderC \ |
| 36 | ForClassLoaderD \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 37 | ExceptionHandle \ |
| 38 | GetMethodSignature \ |
Mathieu Chartier | 496577f | 2016-09-20 15:33:31 -0700 | [diff] [blame] | 39 | ImageLayoutA \ |
| 40 | ImageLayoutB \ |
Andreas Gampe | a1ff30f | 2016-09-27 12:19:45 -0700 | [diff] [blame] | 41 | IMTA \ |
| 42 | IMTB \ |
Sebastien Hertz | 0462c4c | 2015-04-01 16:34:17 +0200 | [diff] [blame] | 43 | Instrumentation \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 44 | Interfaces \ |
Artem Udovichenko | d9786b0 | 2015-10-14 16:36:55 +0300 | [diff] [blame] | 45 | Lookup \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 46 | Main \ |
Mathieu Chartier | d00e02b | 2017-05-24 12:04:13 -0700 | [diff] [blame] | 47 | ManyMethods \ |
Narayan Kamath | 25352fc | 2016-08-03 12:46:58 +0100 | [diff] [blame] | 48 | MethodTypes \ |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 49 | MultiDex \ |
Richard Uhler | 67ff7d1 | 2015-05-14 13:21:13 -0700 | [diff] [blame] | 50 | MultiDexModifiedSecondary \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 51 | MyClass \ |
| 52 | MyClassNatives \ |
| 53 | Nested \ |
| 54 | NonStaticLeafMethods \ |
Mathieu Chartier | 279ac5c | 2016-09-08 17:34:25 -0700 | [diff] [blame] | 55 | Packages \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 56 | ProtoCompare \ |
| 57 | ProtoCompare2 \ |
Calin Juravle | 877fd96 | 2016-01-05 14:29:29 +0000 | [diff] [blame] | 58 | ProfileTestMultiDex \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 59 | StaticLeafMethods \ |
| 60 | Statics \ |
| 61 | StaticsFromCode \ |
| 62 | Transaction \ |
| 63 | XandY |
| 64 | |
| 65 | # Create build rules for each dex file recording the dependency. |
| 66 | $(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval $(call build-art-test-dex,art-gtest,$(dir), \ |
Ian Rogers | 1a2f84e | 2014-07-07 16:05:18 -0700 | [diff] [blame] | 67 | $(ART_TARGET_NATIVETEST_OUT),art/build/Android.gtest.mk,ART_TEST_TARGET_GTEST_$(dir)_DEX, \ |
| 68 | ART_TEST_HOST_GTEST_$(dir)_DEX))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 69 | |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 70 | # Create rules for MainStripped, a copy of Main with the classes.dex stripped |
| 71 | # for the oat file assistant tests. |
| 72 | ART_TEST_HOST_GTEST_MainStripped_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_HOST_GTEST_Main_DEX)) |
| 73 | ART_TEST_TARGET_GTEST_MainStripped_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX)) |
| 74 | |
| 75 | $(ART_TEST_HOST_GTEST_MainStripped_DEX): $(ART_TEST_HOST_GTEST_Main_DEX) |
| 76 | cp $< $@ |
| 77 | $(call dexpreopt-remove-classes.dex,$@) |
| 78 | |
| 79 | $(ART_TEST_TARGET_GTEST_MainStripped_DEX): $(ART_TEST_TARGET_GTEST_Main_DEX) |
| 80 | cp $< $@ |
| 81 | $(call dexpreopt-remove-classes.dex,$@) |
| 82 | |
David Brazdil | ca3c8c3 | 2016-09-06 14:04:48 +0100 | [diff] [blame] | 83 | ART_TEST_GTEST_VerifierDeps_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifierDeps/*.smali)) |
Nicolas Geoffray | 7cc3ae5 | 2017-03-07 14:33:37 +0000 | [diff] [blame] | 84 | ART_TEST_GTEST_VerifierDepsMulti_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifierDepsMulti/*.smali)) |
David Brazdil | ca3c8c3 | 2016-09-06 14:04:48 +0100 | [diff] [blame] | 85 | ART_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 Brazdil | f906f12 | 2016-09-16 16:33:31 +0100 | [diff] [blame] | 86 | ART_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 Geoffray | 7cc3ae5 | 2017-03-07 14:33:37 +0000 | [diff] [blame] | 87 | ART_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)) |
| 88 | ART_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 Brazdil | ca3c8c3 | 2016-09-06 14:04:48 +0100 | [diff] [blame] | 89 | |
| 90 | $(ART_TEST_HOST_GTEST_VerifierDeps_DEX): $(ART_TEST_GTEST_VerifierDeps_SRC) $(HOST_OUT_EXECUTABLES)/smali |
Ben Gruver | 14fc9db | 2017-04-28 15:30:49 -0700 | [diff] [blame] | 91 | $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^) |
David Brazdil | ca3c8c3 | 2016-09-06 14:04:48 +0100 | [diff] [blame] | 92 | |
David Brazdil | f906f12 | 2016-09-16 16:33:31 +0100 | [diff] [blame] | 93 | $(ART_TEST_TARGET_GTEST_VerifierDeps_DEX): $(ART_TEST_GTEST_VerifierDeps_SRC) $(HOST_OUT_EXECUTABLES)/smali |
Ben Gruver | 14fc9db | 2017-04-28 15:30:49 -0700 | [diff] [blame] | 94 | $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^) |
David Brazdil | f906f12 | 2016-09-16 16:33:31 +0100 | [diff] [blame] | 95 | |
Nicolas Geoffray | 7cc3ae5 | 2017-03-07 14:33:37 +0000 | [diff] [blame] | 96 | $(ART_TEST_HOST_GTEST_VerifierDepsMulti_DEX): $(ART_TEST_GTEST_VerifierDepsMulti_SRC) $(HOST_OUT_EXECUTABLES)/smali |
Ben Gruver | 14fc9db | 2017-04-28 15:30:49 -0700 | [diff] [blame] | 97 | $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^) |
Nicolas Geoffray | 7cc3ae5 | 2017-03-07 14:33:37 +0000 | [diff] [blame] | 98 | |
| 99 | $(ART_TEST_TARGET_GTEST_VerifierDepsMulti_DEX): $(ART_TEST_GTEST_VerifierDepsMulti_SRC) $(HOST_OUT_EXECUTABLES)/smali |
Ben Gruver | 14fc9db | 2017-04-28 15:30:49 -0700 | [diff] [blame] | 100 | $(HOST_OUT_EXECUTABLES)/smali assemble --output $@ $(filter %.smali,$^) |
Nicolas Geoffray | 7cc3ae5 | 2017-03-07 14:33:37 +0000 | [diff] [blame] | 101 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 102 | # Dex file dependencies for each gtest. |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 103 | ART_GTEST_dex2oat_environment_tests_DEX_DEPS := Main MainStripped MultiDex MultiDexModifiedSecondary Nested |
| 104 | |
Mathieu Chartier | 9df8931 | 2016-11-23 13:28:16 -0800 | [diff] [blame] | 105 | ART_GTEST_atomic_method_ref_map_test_DEX_DEPS := Interfaces |
Calin Juravle | cdd4912 | 2017-07-05 20:09:53 -0700 | [diff] [blame] | 106 | ART_GTEST_class_linker_test_DEX_DEPS := AllFields ErroneousA ErroneousB ErroneousInit ForClassLoaderA ForClassLoaderB ForClassLoaderC ForClassLoaderD Interfaces MethodTypes MultiDex MyClass Nested Statics StaticsFromCode |
Calin Juravle | 57d0acc | 2017-07-11 17:41:30 -0700 | [diff] [blame^] | 107 | ART_GTEST_class_loader_context_test_DEX_DEPS := Main MultiDex MyClass ForClassLoaderA ForClassLoaderB ForClassLoaderC ForClassLoaderD |
Mathieu Chartier | db70ce5 | 2016-12-12 11:06:59 -0800 | [diff] [blame] | 108 | ART_GTEST_class_table_test_DEX_DEPS := XandY |
Calin Juravle | 877fd96 | 2016-01-05 14:29:29 +0000 | [diff] [blame] | 109 | ART_GTEST_compiler_driver_test_DEX_DEPS := AbstractMethod StaticLeafMethods ProfileTestMultiDex |
Narayan Kamath | 25352fc | 2016-08-03 12:46:58 +0100 | [diff] [blame] | 110 | ART_GTEST_dex_cache_test_DEX_DEPS := Main Packages MethodTypes |
Richard Uhler | 69bcf2c | 2017-01-24 10:25:21 +0000 | [diff] [blame] | 111 | ART_GTEST_dex_file_test_DEX_DEPS := GetMethodSignature Main Nested MultiDex |
Mathieu Chartier | d00e02b | 2017-05-24 12:04:13 -0700 | [diff] [blame] | 112 | ART_GTEST_dexlayout_test_DEX_DEPS := ManyMethods |
Vladimir Marko | 1535770 | 2017-02-09 10:37:31 +0000 | [diff] [blame] | 113 | ART_GTEST_dex2oat_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) Statics VerifierDeps |
Mathieu Chartier | f70fe3d | 2017-06-21 15:24:02 -0700 | [diff] [blame] | 114 | ART_GTEST_dex2oat_image_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) Statics VerifierDeps |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 115 | ART_GTEST_exception_test_DEX_DEPS := ExceptionHandle |
Artem Udovichenko | b3f2b5c | 2017-01-31 11:49:33 +0300 | [diff] [blame] | 116 | ART_GTEST_image_test_DEX_DEPS := ImageLayoutA ImageLayoutB DefaultMethods |
Andreas Gampe | a1ff30f | 2016-09-27 12:19:45 -0700 | [diff] [blame] | 117 | ART_GTEST_imtable_test_DEX_DEPS := IMTA IMTB |
Sebastien Hertz | 0462c4c | 2015-04-01 16:34:17 +0200 | [diff] [blame] | 118 | ART_GTEST_instrumentation_test_DEX_DEPS := Instrumentation |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 119 | ART_GTEST_jni_compiler_test_DEX_DEPS := MyClassNatives |
| 120 | ART_GTEST_jni_internal_test_DEX_DEPS := AllFields StaticLeafMethods |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 121 | ART_GTEST_oat_file_assistant_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) |
Calin Juravle | 36eb313 | 2017-01-13 16:32:38 -0800 | [diff] [blame] | 122 | ART_GTEST_dexoptanalyzer_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) |
Richard Uhler | 84f50ae | 2017-02-06 15:12:45 +0000 | [diff] [blame] | 123 | ART_GTEST_image_space_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) |
Andreas Gampe | 7848da4 | 2015-04-09 11:15:04 -0700 | [diff] [blame] | 124 | ART_GTEST_oat_file_test_DEX_DEPS := Main MultiDex |
Mathieu Chartier | 07ddb6f | 2015-11-05 11:16:34 -0800 | [diff] [blame] | 125 | ART_GTEST_oat_test_DEX_DEPS := Main |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 126 | ART_GTEST_object_test_DEX_DEPS := ProtoCompare ProtoCompare2 StaticsFromCode XandY |
| 127 | ART_GTEST_proxy_test_DEX_DEPS := Interfaces |
| 128 | ART_GTEST_reflection_test_DEX_DEPS := Main NonStaticLeafMethods StaticLeafMethods |
Calin Juravle | 877fd96 | 2016-01-05 14:29:29 +0000 | [diff] [blame] | 129 | ART_GTEST_profile_assistant_test_DEX_DEPS := ProfileTestMultiDex |
Mathieu Chartier | db40eac | 2017-06-09 18:34:11 -0700 | [diff] [blame] | 130 | ART_GTEST_profile_compilation_info_test_DEX_DEPS := ManyMethods ProfileTestMultiDex |
Andreas Gampe | 0f01b58 | 2017-01-18 15:22:37 -0800 | [diff] [blame] | 131 | ART_GTEST_runtime_callbacks_test_DEX_DEPS := XandY |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 132 | ART_GTEST_stub_test_DEX_DEPS := AllFields |
| 133 | ART_GTEST_transaction_test_DEX_DEPS := Transaction |
Artem Udovichenko | d9786b0 | 2015-10-14 16:36:55 +0300 | [diff] [blame] | 134 | ART_GTEST_type_lookup_table_test_DEX_DEPS := Lookup |
Andreas Gampe | ae78c26 | 2017-02-01 20:40:44 -0800 | [diff] [blame] | 135 | ART_GTEST_unstarted_runtime_test_DEX_DEPS := Nested |
Mathieu Chartier | 1ca6890 | 2017-04-18 11:26:22 -0700 | [diff] [blame] | 136 | ART_GTEST_heap_verification_test_DEX_DEPS := ProtoCompare ProtoCompare2 StaticsFromCode XandY |
Nicolas Geoffray | 7cc3ae5 | 2017-03-07 14:33:37 +0000 | [diff] [blame] | 137 | ART_GTEST_verifier_deps_test_DEX_DEPS := VerifierDeps VerifierDepsMulti MultiDex |
Nicolas Geoffray | 01b70e8 | 2016-11-17 10:58:36 +0000 | [diff] [blame] | 138 | ART_GTEST_dex_to_dex_decompiler_test_DEX_DEPS := VerifierDeps DexToDexDecompiler |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 139 | |
| 140 | # The elf writer test has dependencies on core.oat. |
Richard Uhler | 67e1dc5 | 2017-02-06 16:50:17 +0000 | [diff] [blame] | 141 | ART_GTEST_elf_writer_test_HOST_DEPS := $(HOST_CORE_IMAGE_DEFAULT_64) $(HOST_CORE_IMAGE_DEFAULT_32) |
| 142 | ART_GTEST_elf_writer_test_TARGET_DEPS := $(TARGET_CORE_IMAGE_DEFAULT_64) $(TARGET_CORE_IMAGE_DEFAULT_32) |
Brian Carlstrom | 53463ea | 2014-11-09 14:11:51 -0800 | [diff] [blame] | 143 | |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 144 | ART_GTEST_dex2oat_environment_tests_HOST_DEPS := \ |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 145 | $(HOST_CORE_IMAGE_optimizing_64) \ |
| 146 | $(HOST_CORE_IMAGE_optimizing_32) \ |
| 147 | $(HOST_CORE_IMAGE_interpreter_64) \ |
| 148 | $(HOST_CORE_IMAGE_interpreter_32) \ |
Richard Uhler | f51ac42 | 2016-07-08 09:22:33 -0700 | [diff] [blame] | 149 | $(HOST_OUT_EXECUTABLES)/patchoatd |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 150 | ART_GTEST_dex2oat_environment_tests_TARGET_DEPS := \ |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 151 | $(TARGET_CORE_IMAGE_optimizing_64) \ |
| 152 | $(TARGET_CORE_IMAGE_optimizing_32) \ |
| 153 | $(TARGET_CORE_IMAGE_interpreter_64) \ |
| 154 | $(TARGET_CORE_IMAGE_interpreter_32) \ |
Richard Uhler | f51ac42 | 2016-07-08 09:22:33 -0700 | [diff] [blame] | 155 | $(TARGET_OUT_EXECUTABLES)/patchoatd |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 156 | |
| 157 | ART_GTEST_oat_file_assistant_test_HOST_DEPS := \ |
Richard Uhler | f51ac42 | 2016-07-08 09:22:33 -0700 | [diff] [blame] | 158 | $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 159 | ART_GTEST_oat_file_assistant_test_TARGET_DEPS := \ |
Richard Uhler | f51ac42 | 2016-07-08 09:22:33 -0700 | [diff] [blame] | 160 | $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 161 | |
Calin Juravle | 36eb313 | 2017-01-13 16:32:38 -0800 | [diff] [blame] | 162 | ART_GTEST_dexoptanalyzer_test_HOST_DEPS := \ |
| 163 | $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) \ |
| 164 | $(HOST_OUT_EXECUTABLES)/dexoptanalyzerd |
| 165 | ART_GTEST_dexoptanalyzer_test_TARGET_DEPS := \ |
| 166 | $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) \ |
| 167 | dexoptanalyzerd |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 168 | |
Richard Uhler | 84f50ae | 2017-02-06 15:12:45 +0000 | [diff] [blame] | 169 | ART_GTEST_image_space_test_HOST_DEPS := \ |
| 170 | $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) |
| 171 | ART_GTEST_image_space_test_TARGET_DEPS := \ |
| 172 | $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) |
| 173 | |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 174 | ART_GTEST_dex2oat_test_HOST_DEPS := \ |
| 175 | $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) |
| 176 | ART_GTEST_dex2oat_test_TARGET_DEPS := \ |
| 177 | $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 178 | |
Mathieu Chartier | f70fe3d | 2017-06-21 15:24:02 -0700 | [diff] [blame] | 179 | ART_GTEST_dex2oat_image_test_HOST_DEPS := \ |
| 180 | $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) |
| 181 | ART_GTEST_dex2oat_image_test_TARGET_DEPS := \ |
| 182 | $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) |
| 183 | |
Brian Carlstrom | 53463ea | 2014-11-09 14:11:51 -0800 | [diff] [blame] | 184 | # TODO: document why this is needed. |
Richard Uhler | 67e1dc5 | 2017-02-06 16:50:17 +0000 | [diff] [blame] | 185 | ART_GTEST_proxy_test_HOST_DEPS := $(HOST_CORE_IMAGE_DEFAULT_64) $(HOST_CORE_IMAGE_DEFAULT_32) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 186 | |
David Sehr | 55232f1 | 2017-04-19 14:06:49 -0700 | [diff] [blame] | 187 | # The dexdiag test requires the dexdiag utility. |
| 188 | ART_GTEST_dexdiag_test_HOST_DEPS := \ |
| 189 | $(HOST_OUT_EXECUTABLES)/dexdiag |
| 190 | ART_GTEST_dexdiag_test_TARGET_DEPS := \ |
| 191 | dexdiag |
| 192 | |
Aart Bik | cfbe53c | 2015-07-06 14:27:27 -0700 | [diff] [blame] | 193 | # The dexdump test requires an image and the dexdump utility. |
Aart Bik | 22c26f5 | 2015-07-08 21:20:13 +0000 | [diff] [blame] | 194 | # TODO: rename into dexdump when migration completes |
Aart Bik | cfbe53c | 2015-07-06 14:27:27 -0700 | [diff] [blame] | 195 | ART_GTEST_dexdump_test_HOST_DEPS := \ |
Richard Uhler | 67e1dc5 | 2017-02-06 16:50:17 +0000 | [diff] [blame] | 196 | $(HOST_CORE_IMAGE_DEFAULT_64) \ |
| 197 | $(HOST_CORE_IMAGE_DEFAULT_32) \ |
Aart Bik | 22c26f5 | 2015-07-08 21:20:13 +0000 | [diff] [blame] | 198 | $(HOST_OUT_EXECUTABLES)/dexdump2 |
Aart Bik | cfbe53c | 2015-07-06 14:27:27 -0700 | [diff] [blame] | 199 | ART_GTEST_dexdump_test_TARGET_DEPS := \ |
Richard Uhler | 67e1dc5 | 2017-02-06 16:50:17 +0000 | [diff] [blame] | 200 | $(TARGET_CORE_IMAGE_DEFAULT_64) \ |
| 201 | $(TARGET_CORE_IMAGE_DEFAULT_32) \ |
Aart Bik | 22c26f5 | 2015-07-08 21:20:13 +0000 | [diff] [blame] | 202 | dexdump2 |
Aart Bik | cfbe53c | 2015-07-06 14:27:27 -0700 | [diff] [blame] | 203 | |
Jeff Hao | c3acfc5 | 2016-08-29 14:18:26 -0700 | [diff] [blame] | 204 | # The dexlayout test requires an image and the dexlayout utility. |
| 205 | # TODO: rename into dexdump when migration completes |
| 206 | ART_GTEST_dexlayout_test_HOST_DEPS := \ |
Richard Uhler | 67e1dc5 | 2017-02-06 16:50:17 +0000 | [diff] [blame] | 207 | $(HOST_CORE_IMAGE_DEFAULT_64) \ |
| 208 | $(HOST_CORE_IMAGE_DEFAULT_32) \ |
Jeff Hao | c3acfc5 | 2016-08-29 14:18:26 -0700 | [diff] [blame] | 209 | $(HOST_OUT_EXECUTABLES)/dexlayout \ |
| 210 | $(HOST_OUT_EXECUTABLES)/dexdump2 |
| 211 | ART_GTEST_dexlayout_test_TARGET_DEPS := \ |
Richard Uhler | 67e1dc5 | 2017-02-06 16:50:17 +0000 | [diff] [blame] | 212 | $(TARGET_CORE_IMAGE_DEFAULT_64) \ |
| 213 | $(TARGET_CORE_IMAGE_DEFAULT_32) \ |
Jeff Hao | c3acfc5 | 2016-08-29 14:18:26 -0700 | [diff] [blame] | 214 | dexlayout \ |
| 215 | dexdump2 |
| 216 | |
Aart Bik | 3e40f4a | 2015-07-07 17:09:41 -0700 | [diff] [blame] | 217 | # The dexlist test requires an image and the dexlist utility. |
Aart Bik | 3e40f4a | 2015-07-07 17:09:41 -0700 | [diff] [blame] | 218 | ART_GTEST_dexlist_test_HOST_DEPS := \ |
Richard Uhler | 67e1dc5 | 2017-02-06 16:50:17 +0000 | [diff] [blame] | 219 | $(HOST_CORE_IMAGE_DEFAULT_64) \ |
| 220 | $(HOST_CORE_IMAGE_DEFAULT_32) \ |
Aart Bik | b1b45be | 2015-08-28 11:09:29 -0700 | [diff] [blame] | 221 | $(HOST_OUT_EXECUTABLES)/dexlist |
Aart Bik | 3e40f4a | 2015-07-07 17:09:41 -0700 | [diff] [blame] | 222 | ART_GTEST_dexlist_test_TARGET_DEPS := \ |
Richard Uhler | 67e1dc5 | 2017-02-06 16:50:17 +0000 | [diff] [blame] | 223 | $(TARGET_CORE_IMAGE_DEFAULT_64) \ |
| 224 | $(TARGET_CORE_IMAGE_DEFAULT_32) \ |
Aart Bik | b1b45be | 2015-08-28 11:09:29 -0700 | [diff] [blame] | 225 | dexlist |
Aart Bik | 3e40f4a | 2015-07-07 17:09:41 -0700 | [diff] [blame] | 226 | |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 227 | # The imgdiag test has dependencies on core.oat since it needs to load it during the test. |
Andreas Gampe | c93b8b5 | 2014-12-19 23:12:25 -0800 | [diff] [blame] | 228 | # For the host, also add the installed tool (in the base size, that should suffice). For the |
| 229 | # target, just the module is fine, the sync will happen late enough. |
| 230 | ART_GTEST_imgdiag_test_HOST_DEPS := \ |
Richard Uhler | 67e1dc5 | 2017-02-06 16:50:17 +0000 | [diff] [blame] | 231 | $(HOST_CORE_IMAGE_DEFAULT_64) \ |
| 232 | $(HOST_CORE_IMAGE_DEFAULT_32) \ |
Andreas Gampe | c93b8b5 | 2014-12-19 23:12:25 -0800 | [diff] [blame] | 233 | $(HOST_OUT_EXECUTABLES)/imgdiagd |
| 234 | ART_GTEST_imgdiag_test_TARGET_DEPS := \ |
Richard Uhler | 67e1dc5 | 2017-02-06 16:50:17 +0000 | [diff] [blame] | 235 | $(TARGET_CORE_IMAGE_DEFAULT_64) \ |
| 236 | $(TARGET_CORE_IMAGE_DEFAULT_32) \ |
Andreas Gampe | c93b8b5 | 2014-12-19 23:12:25 -0800 | [diff] [blame] | 237 | imgdiagd |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 238 | |
Mathieu Chartier | ea216b3 | 2015-05-26 19:48:16 -0700 | [diff] [blame] | 239 | # Oatdump test requires an image and oatfile to dump. |
| 240 | ART_GTEST_oatdump_test_HOST_DEPS := \ |
Richard Uhler | 67e1dc5 | 2017-02-06 16:50:17 +0000 | [diff] [blame] | 241 | $(HOST_CORE_IMAGE_DEFAULT_64) \ |
| 242 | $(HOST_CORE_IMAGE_DEFAULT_32) \ |
Colin Cross | b20be21 | 2016-09-19 13:02:47 -0700 | [diff] [blame] | 243 | $(HOST_OUT_EXECUTABLES)/oatdumpd \ |
| 244 | $(HOST_OUT_EXECUTABLES)/oatdumpds |
Mathieu Chartier | ea216b3 | 2015-05-26 19:48:16 -0700 | [diff] [blame] | 245 | ART_GTEST_oatdump_test_TARGET_DEPS := \ |
Richard Uhler | 67e1dc5 | 2017-02-06 16:50:17 +0000 | [diff] [blame] | 246 | $(TARGET_CORE_IMAGE_DEFAULT_64) \ |
| 247 | $(TARGET_CORE_IMAGE_DEFAULT_32) \ |
Mathieu Chartier | ea216b3 | 2015-05-26 19:48:16 -0700 | [diff] [blame] | 248 | oatdump |
Vladimir Marko | 1352f13 | 2017-04-28 15:28:29 +0100 | [diff] [blame] | 249 | ART_GTEST_oatdump_image_test_HOST_DEPS := $(ART_GTEST_oatdump_test_HOST_DEPS) |
| 250 | ART_GTEST_oatdump_image_test_TARGET_DEPS := $(ART_GTEST_oatdump_test_TARGET_DEPS) |
Mathieu Chartier | ea216b3 | 2015-05-26 19:48:16 -0700 | [diff] [blame] | 251 | |
Calin Juravle | 2e2db78 | 2016-02-23 12:00:03 +0000 | [diff] [blame] | 252 | # Profile assistant tests requires profman utility. |
| 253 | ART_GTEST_profile_assistant_test_HOST_DEPS := \ |
| 254 | $(HOST_OUT_EXECUTABLES)/profmand |
| 255 | ART_GTEST_profile_assistant_test_TARGET_DEPS := \ |
| 256 | profman |
| 257 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 258 | # The path for which all the source files are relative, not actually the current directory. |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 259 | LOCAL_PATH := art |
| 260 | |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 261 | ART_TEST_MODULES := \ |
| 262 | art_cmdline_tests \ |
| 263 | art_compiler_tests \ |
| 264 | art_compiler_host_tests \ |
| 265 | art_dex2oat_tests \ |
David Sehr | 55232f1 | 2017-04-19 14:06:49 -0700 | [diff] [blame] | 266 | art_dexdiag_tests \ |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 267 | art_dexdump_tests \ |
| 268 | art_dexlayout_tests \ |
| 269 | art_dexlist_tests \ |
Calin Juravle | 36eb313 | 2017-01-13 16:32:38 -0800 | [diff] [blame] | 270 | art_dexoptanalyzer_tests \ |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 271 | art_imgdiag_tests \ |
| 272 | art_oatdump_tests \ |
| 273 | art_profman_tests \ |
| 274 | art_runtime_tests \ |
| 275 | art_runtime_compiler_tests \ |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 276 | |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 277 | ART_TARGET_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\ |
| 278 | $(ART_TEST_LIST_device_$(TARGET_ARCH)_$(m))) |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 279 | |
Nicolas Geoffray | 6bbea4c | 2016-09-16 16:41:43 +0100 | [diff] [blame] | 280 | ifdef TARGET_2ND_ARCH |
| 281 | 2ND_ART_TARGET_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\ |
| 282 | $(ART_TEST_LIST_device_$(2ND_TARGET_ARCH)_$(m))) |
| 283 | endif |
| 284 | |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 285 | ART_HOST_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\ |
Colin Cross | 124f881 | 2016-09-15 20:57:47 -0700 | [diff] [blame] | 286 | $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_$(m))) |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 287 | |
Nicolas Geoffray | 6bbea4c | 2016-09-16 16:41:43 +0100 | [diff] [blame] | 288 | ifneq ($(HOST_PREFER_32_BIT),true) |
| 289 | 2ND_ART_HOST_GTEST_FILES += $(foreach m,$(ART_TEST_MODULES),\ |
| 290 | $(ART_TEST_LIST_host_$(2ND_ART_HOST_ARCH)_$(m))) |
| 291 | endif |
| 292 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 293 | # Variables holding collections of gtest pre-requisits used to run a number of gtests. |
| 294 | ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 295 | ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 296 | ART_TEST_HOST_GTEST_RULES := |
| 297 | ART_TEST_HOST_VALGRIND_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 298 | ART_TEST_HOST_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 299 | ART_TEST_HOST_VALGRIND_GTEST_RULES := |
| 300 | ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 301 | ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 302 | ART_TEST_TARGET_GTEST_RULES := |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 303 | ART_TEST_TARGET_VALGRIND_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 304 | ART_TEST_TARGET_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 305 | ART_TEST_TARGET_VALGRIND_GTEST_RULES := |
Nicolas Geoffray | 58035ae | 2015-05-27 19:10:27 +0100 | [diff] [blame] | 306 | ART_TEST_HOST_GTEST_DEPENDENCIES := |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 307 | |
Nicolas Geoffray | 96a37c8 | 2014-10-29 23:50:40 +0000 | [diff] [blame] | 308 | ART_GTEST_TARGET_ANDROID_ROOT := '/system' |
| 309 | ifneq ($(ART_TEST_ANDROID_ROOT),) |
| 310 | ART_GTEST_TARGET_ANDROID_ROOT := $(ART_TEST_ANDROID_ROOT) |
| 311 | endif |
| 312 | |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 313 | ART_VALGRIND_TARGET_DEPENDENCIES := \ |
| 314 | $(TARGET_OUT_EXECUTABLES)/valgrind \ |
| 315 | $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/memcheck-$(TARGET_ARCH)-linux \ |
| 316 | $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_core-$(TARGET_ARCH)-linux.so \ |
| 317 | $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_memcheck-$(TARGET_ARCH)-linux.so \ |
| 318 | $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/default.supp |
| 319 | |
| 320 | ifdef TARGET_2ND_ARCH |
| 321 | ART_VALGRIND_TARGET_DEPENDENCIES += \ |
| 322 | $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/memcheck-$(TARGET_2ND_ARCH)-linux \ |
| 323 | $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_core-$(TARGET_2ND_ARCH)-linux.so \ |
| 324 | $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_memcheck-$(TARGET_2ND_ARCH)-linux.so |
| 325 | endif |
| 326 | |
| 327 | include $(CLEAR_VARS) |
| 328 | LOCAL_MODULE := valgrind-target-suppressions.txt |
| 329 | LOCAL_MODULE_CLASS := ETC |
| 330 | LOCAL_MODULE_TAGS := optional |
| 331 | LOCAL_SRC_FILES := test/valgrind-target-suppressions.txt |
| 332 | LOCAL_MODULE_PATH := $(ART_TARGET_TEST_OUT) |
| 333 | include $(BUILD_PREBUILT) |
| 334 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 335 | # Define a make rule for a target device gtest. |
| 336 | # $(1): gtest name - the name of the test we're building such as leb128_test. |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 337 | # $(2): path relative to $OUT to the test binary |
| 338 | # $(3): 2ND_ or undefined - used to differentiate between the primary and secondary architecture. |
| 339 | # $(4): LD_LIBRARY_PATH or undefined - used in case libartd.so is not in /system/lib/ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 340 | define define-art-gtest-rule-target |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 341 | gtest_rule := test-art-target-gtest-$(1)$$($(3)ART_PHONY_TEST_TARGET_SUFFIX) |
| 342 | gtest_exe := $(OUT_DIR)/$(2) |
| 343 | gtest_target_exe := $$(patsubst $(PRODUCT_OUT)/%,/%,$$(gtest_exe)) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 344 | |
Brian Carlstrom | 532714a | 2014-06-25 02:15:31 -0700 | [diff] [blame] | 345 | # Add the test dependencies to test-art-target-sync, which will be a prerequisite for the test |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 346 | # to ensure files are pushed to the device. |
| 347 | TEST_ART_TARGET_SYNC_DEPS += \ |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 348 | $$(ART_GTEST_$(1)_TARGET_DEPS) \ |
Ian Rogers | 1a2f84e | 2014-07-07 16:05:18 -0700 | [diff] [blame] | 349 | $(foreach file,$(ART_GTEST_$(1)_DEX_DEPS),$(ART_TEST_TARGET_GTEST_$(file)_DEX)) \ |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 350 | $$(gtest_exe) \ |
| 351 | $$($(3)TARGET_OUT_SHARED_LIBRARIES)/libjavacore.so \ |
| 352 | $$($(3)TARGET_OUT_SHARED_LIBRARIES)/libopenjdkd.so \ |
Andreas Gampe | c7d4a58 | 2015-09-30 11:52:02 -0700 | [diff] [blame] | 353 | $$(TARGET_OUT_JAVA_LIBRARIES)/core-libart-testdex.jar \ |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 354 | $$(TARGET_OUT_JAVA_LIBRARIES)/core-oj-testdex.jar \ |
| 355 | $$(ART_TARGET_TEST_OUT)/valgrind-target-suppressions.txt |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 356 | |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 357 | $$(gtest_rule) valgrind-$$(gtest_rule): PRIVATE_TARGET_EXE := $$(gtest_target_exe) |
| 358 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 359 | .PHONY: $$(gtest_rule) |
| 360 | $$(gtest_rule): test-art-target-sync |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 361 | $(hide) adb shell touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID |
| 362 | $(hide) adb shell rm $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID |
| 363 | $(hide) adb shell chmod 755 $$(PRIVATE_TARGET_EXE) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 364 | $(hide) $$(call ART_TEST_SKIP,$$@) && \ |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 365 | (adb shell "$(GCOV_ENV) LD_LIBRARY_PATH=$(4) ANDROID_ROOT=$(ART_GTEST_TARGET_ANDROID_ROOT) \ |
| 366 | $$(PRIVATE_TARGET_EXE) && touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID" \ |
| 367 | && (adb pull $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID /tmp/ \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 368 | && $$(call ART_TEST_PASSED,$$@)) \ |
| 369 | || $$(call ART_TEST_FAILED,$$@)) |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 370 | $(hide) rm -f /tmp/$$@-$$$$PPID |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 371 | |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 372 | ART_TEST_TARGET_GTEST$($(3)ART_PHONY_TEST_TARGET_SUFFIX)_RULES += $$(gtest_rule) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 373 | ART_TEST_TARGET_GTEST_RULES += $$(gtest_rule) |
| 374 | ART_TEST_TARGET_GTEST_$(1)_RULES += $$(gtest_rule) |
| 375 | |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 376 | .PHONY: valgrind-$$(gtest_rule) |
| 377 | valgrind-$$(gtest_rule): $(ART_VALGRIND_TARGET_DEPENDENCIES) test-art-target-sync |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 378 | $(hide) adb shell touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID |
| 379 | $(hide) adb shell rm $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID |
| 380 | $(hide) adb shell chmod 755 $$(PRIVATE_TARGET_EXE) |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 381 | $(hide) $$(call ART_TEST_SKIP,$$@) && \ |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 382 | (adb shell "$(GCOV_ENV) LD_LIBRARY_PATH=$(4) ANDROID_ROOT=$(ART_GTEST_TARGET_ANDROID_ROOT) \ |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 383 | valgrind --leak-check=full --error-exitcode=1 --workaround-gcc296-bugs=yes \ |
| 384 | --suppressions=$(ART_TARGET_TEST_DIR)/valgrind-target-suppressions.txt \ |
Anton Kirilov | 3a2e78e | 2017-01-06 13:33:42 +0000 | [diff] [blame] | 385 | --num-callers=50 --show-mismatched-frees=no \ |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 386 | $$(PRIVATE_TARGET_EXE) && touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID" \ |
| 387 | && (adb pull $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID /tmp/ \ |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 388 | && $$(call ART_TEST_PASSED,$$@)) \ |
| 389 | || $$(call ART_TEST_FAILED,$$@)) |
| 390 | $(hide) rm -f /tmp/$$@-$$$$PPID |
| 391 | |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 392 | ART_TEST_TARGET_VALGRIND_GTEST$$($(3)ART_PHONY_TEST_TARGET_SUFFIX)_RULES += valgrind-$$(gtest_rule) |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 393 | ART_TEST_TARGET_VALGRIND_GTEST_RULES += valgrind-$$(gtest_rule) |
| 394 | ART_TEST_TARGET_VALGRIND_GTEST_$(1)_RULES += valgrind-$$(gtest_rule) |
| 395 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 396 | # Clear locally defined variables. |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 397 | valgrind_gtest_rule := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 398 | gtest_rule := |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 399 | gtest_exe := |
| 400 | gtest_target_exe := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 401 | endef # define-art-gtest-rule-target |
| 402 | |
Andreas Gampe | 3c0bb31 | 2015-02-19 10:02:19 -0800 | [diff] [blame] | 403 | ART_VALGRIND_DEPENDENCIES := \ |
| 404 | $(HOST_OUT_EXECUTABLES)/valgrind \ |
| 405 | $(HOST_OUT)/lib64/valgrind/memcheck-amd64-linux \ |
| 406 | $(HOST_OUT)/lib64/valgrind/memcheck-x86-linux \ |
| 407 | $(HOST_OUT)/lib64/valgrind/default.supp \ |
| 408 | $(HOST_OUT)/lib64/valgrind/vgpreload_core-amd64-linux.so \ |
| 409 | $(HOST_OUT)/lib64/valgrind/vgpreload_core-x86-linux.so \ |
| 410 | $(HOST_OUT)/lib64/valgrind/vgpreload_memcheck-amd64-linux.so \ |
| 411 | $(HOST_OUT)/lib64/valgrind/vgpreload_memcheck-x86-linux.so |
| 412 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 413 | # Define make rules for a host gtests. |
| 414 | # $(1): gtest name - the name of the test we're building such as leb128_test. |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 415 | # $(2): path relative to $OUT to the test binary |
| 416 | # $(3): 2ND_ or undefined - used to differentiate between the primary and secondary architecture. |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 417 | define define-art-gtest-rule-host |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 418 | gtest_rule := test-art-host-gtest-$(1)$$($(3)ART_PHONY_TEST_HOST_SUFFIX) |
| 419 | gtest_exe := $(OUT_DIR)/$(2) |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 420 | # Dependencies for all host gtests. |
| 421 | gtest_deps := $$(HOST_CORE_DEX_LOCATIONS) \ |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 422 | $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$$(ART_HOST_SHLIB_EXTENSION) \ |
| 423 | $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$$(ART_HOST_SHLIB_EXTENSION) \ |
Nicolas Geoffray | 58035ae | 2015-05-27 19:10:27 +0100 | [diff] [blame] | 424 | $$(gtest_exe) \ |
| 425 | $$(ART_GTEST_$(1)_HOST_DEPS) \ |
| 426 | $(foreach file,$(ART_GTEST_$(1)_DEX_DEPS),$(ART_TEST_HOST_GTEST_$(file)_DEX)) |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 427 | |
Nicolas Geoffray | 58035ae | 2015-05-27 19:10:27 +0100 | [diff] [blame] | 428 | ART_TEST_HOST_GTEST_DEPENDENCIES += $$(gtest_deps) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 429 | |
Andreas Gampe | 0385805 | 2017-05-01 08:17:24 -0700 | [diff] [blame] | 430 | # Note: envsetup currently exports ASAN_OPTIONS=detect_leaks=0 to suppress leak detection, as some |
| 431 | # build tools (e.g., ninja) intentionally leak. We want leak checks when we run our tests, so |
| 432 | # override ASAN_OPTIONS. b/37751350 |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 433 | .PHONY: $$(gtest_rule) |
Nicolas Geoffray | 0f7c06d | 2015-05-28 10:21:03 +0100 | [diff] [blame] | 434 | $$(gtest_rule): $$(gtest_exe) $$(gtest_deps) |
Andreas Gampe | 0385805 | 2017-05-01 08:17:24 -0700 | [diff] [blame] | 435 | $(hide) ($$(call ART_TEST_SKIP,$$@) && ASAN_OPTIONS=detect_leaks=1 $$< && \ |
| 436 | $$(call ART_TEST_PASSED,$$@)) || $$(call ART_TEST_FAILED,$$@) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 437 | |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 438 | ART_TEST_HOST_GTEST$$($(3)ART_PHONY_TEST_HOST_SUFFIX)_RULES += $$(gtest_rule) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 439 | ART_TEST_HOST_GTEST_RULES += $$(gtest_rule) |
| 440 | ART_TEST_HOST_GTEST_$(1)_RULES += $$(gtest_rule) |
| 441 | |
Andreas Gampe | 3c0bb31 | 2015-02-19 10:02:19 -0800 | [diff] [blame] | 442 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 443 | .PHONY: valgrind-$$(gtest_rule) |
Andreas Gampe | 3db3600 | 2015-05-28 20:17:09 -0700 | [diff] [blame] | 444 | valgrind-$$(gtest_rule): $$(gtest_exe) $$(gtest_deps) $(ART_VALGRIND_DEPENDENCIES) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 445 | $(hide) $$(call ART_TEST_SKIP,$$@) && \ |
Andreas Gampe | 8df91ac | 2015-02-20 13:15:15 -0800 | [diff] [blame] | 446 | VALGRIND_LIB=$(HOST_OUT)/lib64/valgrind \ |
Hiroshi Yamauchi | dc15e89 | 2016-03-10 13:49:14 -0800 | [diff] [blame] | 447 | $(HOST_OUT_EXECUTABLES)/valgrind --leak-check=full --error-exitcode=1 \ |
Andreas Gampe | bf13e80 | 2016-09-02 19:43:09 -0700 | [diff] [blame] | 448 | --suppressions=art/test/valgrind-suppressions.txt --num-callers=50 \ |
| 449 | $$< && \ |
Andreas Gampe | 3c0bb31 | 2015-02-19 10:02:19 -0800 | [diff] [blame] | 450 | $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 451 | |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 452 | ART_TEST_HOST_VALGRIND_GTEST$$($(3)ART_PHONY_TEST_HOST_SUFFIX)_RULES += valgrind-$$(gtest_rule) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 453 | ART_TEST_HOST_VALGRIND_GTEST_RULES += valgrind-$$(gtest_rule) |
| 454 | ART_TEST_HOST_VALGRIND_GTEST_$(1)_RULES += valgrind-$$(gtest_rule) |
| 455 | |
| 456 | # Clear locally defined variables. |
| 457 | valgrind_gtest_rule := |
| 458 | gtest_rule := |
| 459 | gtest_exe := |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 460 | gtest_deps := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 461 | endef # define-art-gtest-rule-host |
| 462 | |
| 463 | # Define the rules to build and run host and target gtests. |
Nicolas Geoffray | 6bbea4c | 2016-09-16 16:41:43 +0100 | [diff] [blame] | 464 | # $(1): file name |
| 465 | # $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture. |
| 466 | define define-art-gtest-target |
| 467 | art_gtest_filename := $(1) |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 468 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 469 | include $$(CLEAR_VARS) |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 470 | art_gtest_name := $$(notdir $$(basename $$(art_gtest_filename))) |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 471 | |
Nicolas Geoffray | 6bbea4c | 2016-09-16 16:41:43 +0100 | [diff] [blame] | 472 | library_path := |
| 473 | 2ND_library_path := |
| 474 | ifneq ($$(ART_TEST_ANDROID_ROOT),) |
| 475 | ifdef TARGET_2ND_ARCH |
| 476 | 2ND_library_path := $$(ART_TEST_ANDROID_ROOT)/lib |
| 477 | library_path := $$(ART_TEST_ANDROID_ROOT)/lib64 |
| 478 | else |
| 479 | ifneq ($(filter %64,$(TARGET_ARCH)),) |
Nicolas Geoffray | 9eb4074 | 2014-10-29 22:38:53 +0000 | [diff] [blame] | 480 | library_path := $$(ART_TEST_ANDROID_ROOT)/lib64 |
| 481 | else |
Nicolas Geoffray | 6bbea4c | 2016-09-16 16:41:43 +0100 | [diff] [blame] | 482 | library_path := $$(ART_TEST_ANDROID_ROOT)/lib |
Nicolas Geoffray | 9eb4074 | 2014-10-29 22:38:53 +0000 | [diff] [blame] | 483 | endif |
| 484 | endif |
Nicolas Geoffray | 6bbea4c | 2016-09-16 16:41:43 +0100 | [diff] [blame] | 485 | endif |
Andreas Gampe | 5ca4eaa | 2014-05-29 02:09:33 -0700 | [diff] [blame] | 486 | |
Nicolas Geoffray | 6bbea4c | 2016-09-16 16:41:43 +0100 | [diff] [blame] | 487 | ifndef ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 488 | ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES := |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 489 | ART_TEST_TARGET_VALGRIND_GTEST_$$(art_gtest_name)_RULES := |
Nicolas Geoffray | 6bbea4c | 2016-09-16 16:41:43 +0100 | [diff] [blame] | 490 | endif |
| 491 | $$(eval $$(call define-art-gtest-rule-target,$$(art_gtest_name),$$(art_gtest_filename),$(2),$$($(2)library_path))) |
| 492 | |
| 493 | # Clear locally defined variables. |
| 494 | art_gtest_filename := |
| 495 | art_gtest_name := |
| 496 | library_path := |
| 497 | 2ND_library_path := |
| 498 | endef # define-art-gtest-target |
| 499 | |
| 500 | # $(1): file name |
| 501 | # $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture. |
| 502 | define define-art-gtest-host |
| 503 | art_gtest_filename := $(1) |
| 504 | |
| 505 | include $$(CLEAR_VARS) |
| 506 | art_gtest_name := $$(notdir $$(basename $$(art_gtest_filename))) |
| 507 | ifndef ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES |
| 508 | ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES := |
| 509 | ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES := |
| 510 | endif |
| 511 | $$(eval $$(call define-art-gtest-rule-host,$$(art_gtest_name),$$(art_gtest_filename),$(2))) |
| 512 | |
| 513 | # Clear locally defined variables. |
| 514 | art_gtest_filename := |
| 515 | art_gtest_name := |
| 516 | endef # define-art-gtest-host |
| 517 | |
| 518 | # Define the rules to build and run gtests for both archs on target. |
| 519 | # $(1): test name |
| 520 | define define-art-gtest-target-both |
| 521 | art_gtest_name := $(1) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 522 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 523 | # A rule to run the different architecture versions of the gtest. |
| 524 | .PHONY: test-art-target-gtest-$$(art_gtest_name) |
| 525 | test-art-target-gtest-$$(art_gtest_name): $$(ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES) |
| 526 | $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
| 527 | |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 528 | .PHONY: valgrind-test-art-target-gtest-$$(art_gtest_name) |
| 529 | valgrind-test-art-target-gtest-$$(art_gtest_name): $$(ART_TEST_TARGET_VALGRIND_GTEST_$$(art_gtest_name)_RULES) |
| 530 | $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
| 531 | |
Nicolas Geoffray | 6bbea4c | 2016-09-16 16:41:43 +0100 | [diff] [blame] | 532 | # Clear now unused variables. |
| 533 | ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES := |
| 534 | ART_TEST_TARGET_VALGRIND_GTEST_$$(art_gtest_name)_RULES := |
| 535 | art_gtest_name := |
| 536 | endef # define-art-gtest-target-both |
Ian Rogers | d912e5c | 2013-11-13 12:40:11 -0800 | [diff] [blame] | 537 | |
Nicolas Geoffray | 6bbea4c | 2016-09-16 16:41:43 +0100 | [diff] [blame] | 538 | # Define the rules to build and run gtests for both archs on host. |
| 539 | # $(1): test name |
| 540 | define define-art-gtest-host-both |
| 541 | art_gtest_name := $(1) |
| 542 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 543 | .PHONY: test-art-host-gtest-$$(art_gtest_name) |
| 544 | test-art-host-gtest-$$(art_gtest_name): $$(ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES) |
| 545 | $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
Ian Rogers | d912e5c | 2013-11-13 12:40:11 -0800 | [diff] [blame] | 546 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 547 | .PHONY: valgrind-test-art-host-gtest-$$(art_gtest_name) |
| 548 | valgrind-test-art-host-gtest-$$(art_gtest_name): $$(ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES) |
| 549 | $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
| 550 | |
Nicolas Geoffray | 6bbea4c | 2016-09-16 16:41:43 +0100 | [diff] [blame] | 551 | # Clear now unused variables. |
| 552 | ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES := |
| 553 | ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 554 | art_gtest_name := |
Nicolas Geoffray | 6bbea4c | 2016-09-16 16:41:43 +0100 | [diff] [blame] | 555 | endef # define-art-gtest-host-both |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 556 | |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 557 | ifeq ($(ART_BUILD_TARGET),true) |
Nicolas Geoffray | 6bbea4c | 2016-09-16 16:41:43 +0100 | [diff] [blame] | 558 | $(foreach file,$(ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest-target,$(file),))) |
| 559 | ifdef TARGET_2ND_ARCH |
| 560 | $(foreach file,$(2ND_ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest-target,$(file),2ND_))) |
| 561 | endif |
| 562 | # Rules to run the different architecture versions of the gtest. |
| 563 | $(foreach file,$(ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest-target-both,$$(notdir $$(basename $$(file)))))) |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 564 | endif |
Ian Rogers | c5f1773 | 2014-06-05 20:48:42 -0700 | [diff] [blame] | 565 | ifeq ($(ART_BUILD_HOST),true) |
Nicolas Geoffray | 6bbea4c | 2016-09-16 16:41:43 +0100 | [diff] [blame] | 566 | $(foreach file,$(ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host,$(file),))) |
| 567 | ifneq ($(HOST_PREFER_32_BIT),true) |
| 568 | $(foreach file,$(2ND_ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host,$(file),2ND_))) |
| 569 | endif |
| 570 | # Rules to run the different architecture versions of the gtest. |
| 571 | $(foreach file,$(ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest-host-both,$$(notdir $$(basename $$(file)))))) |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 572 | endif |
Tsu Chiang Chuang | ec245a4 | 2014-05-15 21:16:21 -0700 | [diff] [blame] | 573 | |
| 574 | # Used outside the art project to get a list of the current tests |
| 575 | RUNTIME_TARGET_GTEST_MAKE_TARGETS := |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 576 | $(foreach file, $(ART_TARGET_GTEST_FILES), $(eval RUNTIME_TARGET_GTEST_MAKE_TARGETS += $$(notdir $$(basename $$(file))))) |
Tsu Chiang Chuang | ec245a4 | 2014-05-15 21:16:21 -0700 | [diff] [blame] | 577 | COMPILER_TARGET_GTEST_MAKE_TARGETS := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 578 | |
| 579 | # Define all the combinations of host/target, valgrind and suffix such as: |
| 580 | # test-art-host-gtest or valgrind-test-art-host-gtest64 |
| 581 | # $(1): host or target |
| 582 | # $(2): HOST or TARGET |
| 583 | # $(3): valgrind- or undefined |
| 584 | # $(4): undefined, 32 or 64 |
| 585 | define define-test-art-gtest-combination |
| 586 | ifeq ($(1),host) |
| 587 | ifneq ($(2),HOST) |
| 588 | $$(error argument mismatch $(1) and ($2)) |
| 589 | endif |
| 590 | else |
| 591 | ifneq ($(1),target) |
| 592 | $$(error found $(1) expected host or target) |
| 593 | endif |
| 594 | ifneq ($(2),TARGET) |
| 595 | $$(error argument mismatch $(1) and ($2)) |
| 596 | endif |
| 597 | endif |
| 598 | |
| 599 | rule_name := $(3)test-art-$(1)-gtest$(4) |
Andreas Gampe | 928f72b | 2014-09-09 19:53:48 -0700 | [diff] [blame] | 600 | ifeq ($(3),valgrind-) |
Andreas Gampe | 928f72b | 2014-09-09 19:53:48 -0700 | [diff] [blame] | 601 | dependencies := $$(ART_TEST_$(2)_VALGRIND_GTEST$(4)_RULES) |
| 602 | else |
| 603 | dependencies := $$(ART_TEST_$(2)_GTEST$(4)_RULES) |
| 604 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 605 | |
| 606 | .PHONY: $$(rule_name) |
| 607 | $$(rule_name): $$(dependencies) |
| 608 | $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
| 609 | |
| 610 | # Clear locally defined variables. |
| 611 | rule_name := |
| 612 | dependencies := |
| 613 | endef # define-test-art-gtest-combination |
| 614 | |
| 615 | $(eval $(call define-test-art-gtest-combination,target,TARGET,,)) |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 616 | $(eval $(call define-test-art-gtest-combination,target,TARGET,valgrind-,)) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 617 | $(eval $(call define-test-art-gtest-combination,target,TARGET,,$(ART_PHONY_TEST_TARGET_SUFFIX))) |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 618 | $(eval $(call define-test-art-gtest-combination,target,TARGET,valgrind-,$(ART_PHONY_TEST_TARGET_SUFFIX))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 619 | ifdef TARGET_2ND_ARCH |
| 620 | $(eval $(call define-test-art-gtest-combination,target,TARGET,,$(2ND_ART_PHONY_TEST_TARGET_SUFFIX))) |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 621 | $(eval $(call define-test-art-gtest-combination,target,TARGET,valgrind-,$(2ND_ART_PHONY_TEST_TARGET_SUFFIX))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 622 | endif |
| 623 | $(eval $(call define-test-art-gtest-combination,host,HOST,,)) |
| 624 | $(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,)) |
| 625 | $(eval $(call define-test-art-gtest-combination,host,HOST,,$(ART_PHONY_TEST_HOST_SUFFIX))) |
| 626 | $(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,$(ART_PHONY_TEST_HOST_SUFFIX))) |
| 627 | ifneq ($(HOST_PREFER_32_BIT),true) |
| 628 | $(eval $(call define-test-art-gtest-combination,host,HOST,,$(2ND_ART_PHONY_TEST_HOST_SUFFIX))) |
| 629 | $(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,$(2ND_ART_PHONY_TEST_HOST_SUFFIX))) |
| 630 | endif |
| 631 | |
| 632 | # Clear locally defined variables. |
| 633 | define-art-gtest-rule-target := |
| 634 | define-art-gtest-rule-host := |
| 635 | define-art-gtest := |
| 636 | define-test-art-gtest-combination := |
| 637 | RUNTIME_GTEST_COMMON_SRC_FILES := |
| 638 | COMPILER_GTEST_COMMON_SRC_FILES := |
| 639 | RUNTIME_GTEST_TARGET_SRC_FILES := |
| 640 | RUNTIME_GTEST_HOST_SRC_FILES := |
| 641 | COMPILER_GTEST_TARGET_SRC_FILES := |
| 642 | COMPILER_GTEST_HOST_SRC_FILES := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 643 | ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 644 | ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 645 | ART_TEST_HOST_GTEST_RULES := |
| 646 | ART_TEST_HOST_VALGRIND_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 647 | ART_TEST_HOST_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 648 | ART_TEST_HOST_VALGRIND_GTEST_RULES := |
| 649 | ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 650 | ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 651 | ART_TEST_TARGET_GTEST_RULES := |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 652 | ART_TEST_TARGET_VALGRIND_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 653 | ART_TEST_TARGET_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 654 | ART_TEST_TARGET_VALGRIND_GTEST_RULES := |
Nicolas Geoffray | 96a37c8 | 2014-10-29 23:50:40 +0000 | [diff] [blame] | 655 | ART_GTEST_TARGET_ANDROID_ROOT := |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 656 | ART_GTEST_class_linker_test_DEX_DEPS := |
Mathieu Chartier | db70ce5 | 2016-12-12 11:06:59 -0800 | [diff] [blame] | 657 | ART_GTEST_class_table_test_DEX_DEPS := |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 658 | ART_GTEST_compiler_driver_test_DEX_DEPS := |
| 659 | ART_GTEST_dex_file_test_DEX_DEPS := |
| 660 | ART_GTEST_exception_test_DEX_DEPS := |
| 661 | ART_GTEST_elf_writer_test_HOST_DEPS := |
| 662 | ART_GTEST_elf_writer_test_TARGET_DEPS := |
Andreas Gampe | a1ff30f | 2016-09-27 12:19:45 -0700 | [diff] [blame] | 663 | ART_GTEST_imtable_test_DEX_DEPS := |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 664 | ART_GTEST_jni_compiler_test_DEX_DEPS := |
| 665 | ART_GTEST_jni_internal_test_DEX_DEPS := |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 666 | ART_GTEST_oat_file_assistant_test_DEX_DEPS := |
| 667 | ART_GTEST_oat_file_assistant_test_HOST_DEPS := |
| 668 | ART_GTEST_oat_file_assistant_test_TARGET_DEPS := |
Calin Juravle | 36eb313 | 2017-01-13 16:32:38 -0800 | [diff] [blame] | 669 | ART_GTEST_dexoptanalyzer_test_DEX_DEPS := |
| 670 | ART_GTEST_dexoptanalyzer_test_HOST_DEPS := |
| 671 | ART_GTEST_dexoptanalyzer_test_TARGET_DEPS := |
Richard Uhler | 84f50ae | 2017-02-06 15:12:45 +0000 | [diff] [blame] | 672 | ART_GTEST_image_space_test_DEX_DEPS := |
| 673 | ART_GTEST_image_space_test_HOST_DEPS := |
| 674 | ART_GTEST_image_space_test_TARGET_DEPS := |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 675 | ART_GTEST_dex2oat_test_DEX_DEPS := |
| 676 | ART_GTEST_dex2oat_test_HOST_DEPS := |
| 677 | ART_GTEST_dex2oat_test_TARGET_DEPS := |
Mathieu Chartier | f70fe3d | 2017-06-21 15:24:02 -0700 | [diff] [blame] | 678 | ART_GTEST_dex2oat_image_test_DEX_DEPS := |
| 679 | ART_GTEST_dex2oat_image_test_HOST_DEPS := |
| 680 | ART_GTEST_dex2oat_image_test_TARGET_DEPS := |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 681 | ART_GTEST_object_test_DEX_DEPS := |
| 682 | ART_GTEST_proxy_test_DEX_DEPS := |
| 683 | ART_GTEST_reflection_test_DEX_DEPS := |
| 684 | ART_GTEST_stub_test_DEX_DEPS := |
| 685 | ART_GTEST_transaction_test_DEX_DEPS := |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 686 | ART_GTEST_dex2oat_environment_tests_DEX_DEPS := |
Mathieu Chartier | 1ca6890 | 2017-04-18 11:26:22 -0700 | [diff] [blame] | 687 | ART_GTEST_heap_verification_test_DEX_DEPS := |
David Brazdil | ca3c8c3 | 2016-09-06 14:04:48 +0100 | [diff] [blame] | 688 | ART_GTEST_verifier_deps_test_DEX_DEPS := |
Andreas Gampe | 3c0bb31 | 2015-02-19 10:02:19 -0800 | [diff] [blame] | 689 | ART_VALGRIND_DEPENDENCIES := |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 690 | ART_VALGRIND_TARGET_DEPENDENCIES := |
Ian Rogers | 1a2f84e | 2014-07-07 16:05:18 -0700 | [diff] [blame] | 691 | $(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_TARGET_GTEST_$(dir)_DEX :=)) |
| 692 | $(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_HOST_GTEST_$(dir)_DEX :=)) |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 693 | ART_TEST_HOST_GTEST_MainStripped_DEX := |
| 694 | ART_TEST_TARGET_GTEST_MainStripped_DEX := |
David Brazdil | ca3c8c3 | 2016-09-06 14:04:48 +0100 | [diff] [blame] | 695 | ART_TEST_GTEST_VerifierDeps_SRC := |
| 696 | ART_TEST_HOST_GTEST_VerifierDeps_DEX := |
David Brazdil | f906f12 | 2016-09-16 16:33:31 +0100 | [diff] [blame] | 697 | ART_TEST_TARGET_GTEST_VerifierDeps_DEX := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 698 | GTEST_DEX_DIRECTORIES := |
Brian Carlstrom | 532714a | 2014-06-25 02:15:31 -0700 | [diff] [blame] | 699 | LOCAL_PATH := |