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 \ |
| 28 | ExceptionHandle \ |
| 29 | GetMethodSignature \ |
Sebastien Hertz | 0462c4c | 2015-04-01 16:34:17 +0200 | [diff] [blame] | 30 | Instrumentation \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 31 | Interfaces \ |
Artem Udovichenko | d9786b0 | 2015-10-14 16:36:55 +0300 | [diff] [blame] | 32 | Lookup \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 33 | Main \ |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 34 | MultiDex \ |
Richard Uhler | 67ff7d1 | 2015-05-14 13:21:13 -0700 | [diff] [blame] | 35 | MultiDexModifiedSecondary \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 36 | MyClass \ |
| 37 | MyClassNatives \ |
| 38 | Nested \ |
| 39 | NonStaticLeafMethods \ |
Mathieu Chartier | 279ac5c | 2016-09-08 17:34:25 -0700 | [diff] [blame] | 40 | Packages \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 41 | ProtoCompare \ |
| 42 | ProtoCompare2 \ |
Calin Juravle | 877fd96 | 2016-01-05 14:29:29 +0000 | [diff] [blame] | 43 | ProfileTestMultiDex \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 44 | StaticLeafMethods \ |
| 45 | Statics \ |
| 46 | StaticsFromCode \ |
| 47 | Transaction \ |
| 48 | XandY |
| 49 | |
| 50 | # Create build rules for each dex file recording the dependency. |
| 51 | $(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] | 52 | $(ART_TARGET_NATIVETEST_OUT),art/build/Android.gtest.mk,ART_TEST_TARGET_GTEST_$(dir)_DEX, \ |
| 53 | ART_TEST_HOST_GTEST_$(dir)_DEX))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 54 | |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 55 | # Create rules for MainStripped, a copy of Main with the classes.dex stripped |
| 56 | # for the oat file assistant tests. |
| 57 | ART_TEST_HOST_GTEST_MainStripped_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_HOST_GTEST_Main_DEX)) |
| 58 | ART_TEST_TARGET_GTEST_MainStripped_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX)) |
| 59 | |
| 60 | $(ART_TEST_HOST_GTEST_MainStripped_DEX): $(ART_TEST_HOST_GTEST_Main_DEX) |
| 61 | cp $< $@ |
| 62 | $(call dexpreopt-remove-classes.dex,$@) |
| 63 | |
| 64 | $(ART_TEST_TARGET_GTEST_MainStripped_DEX): $(ART_TEST_TARGET_GTEST_Main_DEX) |
| 65 | cp $< $@ |
| 66 | $(call dexpreopt-remove-classes.dex,$@) |
| 67 | |
David Brazdil | ca3c8c3 | 2016-09-06 14:04:48 +0100 | [diff] [blame^] | 68 | ART_TEST_GTEST_VerifierDeps_SRC := $(abspath $(wildcard $(LOCAL_PATH)/VerifierDeps/*.smali)) |
| 69 | 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)) |
| 70 | |
| 71 | $(ART_TEST_HOST_GTEST_VerifierDeps_DEX): $(ART_TEST_GTEST_VerifierDeps_SRC) $(HOST_OUT_EXECUTABLES)/smali |
| 72 | $(HOST_OUT_EXECUTABLES)/smali --output=$@ $(filter %.smali,$^) |
| 73 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 74 | # Dex file dependencies for each gtest. |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 75 | ART_GTEST_dex2oat_environment_tests_DEX_DEPS := Main MainStripped MultiDex MultiDexModifiedSecondary Nested |
| 76 | |
Andreas Gampe | 81c6f8d | 2015-03-25 17:19:53 -0700 | [diff] [blame] | 77 | ART_GTEST_class_linker_test_DEX_DEPS := Interfaces MultiDex MyClass Nested Statics StaticsFromCode |
Calin Juravle | 877fd96 | 2016-01-05 14:29:29 +0000 | [diff] [blame] | 78 | ART_GTEST_compiler_driver_test_DEX_DEPS := AbstractMethod StaticLeafMethods ProfileTestMultiDex |
Mathieu Chartier | 279ac5c | 2016-09-08 17:34:25 -0700 | [diff] [blame] | 79 | ART_GTEST_dex_cache_test_DEX_DEPS := Main Packages |
Andreas Gampe | da82344 | 2014-11-03 15:36:53 -0800 | [diff] [blame] | 80 | ART_GTEST_dex_file_test_DEX_DEPS := GetMethodSignature Main Nested |
Andreas Gampe | 7adeda8 | 2016-07-25 08:27:35 -0700 | [diff] [blame] | 81 | ART_GTEST_dex2oat_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) Statics |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 82 | ART_GTEST_exception_test_DEX_DEPS := ExceptionHandle |
Sebastien Hertz | 0462c4c | 2015-04-01 16:34:17 +0200 | [diff] [blame] | 83 | ART_GTEST_instrumentation_test_DEX_DEPS := Instrumentation |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 84 | ART_GTEST_jni_compiler_test_DEX_DEPS := MyClassNatives |
| 85 | ART_GTEST_jni_internal_test_DEX_DEPS := AllFields StaticLeafMethods |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 86 | ART_GTEST_oat_file_assistant_test_DEX_DEPS := $(ART_GTEST_dex2oat_environment_tests_DEX_DEPS) |
Andreas Gampe | 7848da4 | 2015-04-09 11:15:04 -0700 | [diff] [blame] | 87 | ART_GTEST_oat_file_test_DEX_DEPS := Main MultiDex |
Mathieu Chartier | 07ddb6f | 2015-11-05 11:16:34 -0800 | [diff] [blame] | 88 | ART_GTEST_oat_test_DEX_DEPS := Main |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 89 | ART_GTEST_object_test_DEX_DEPS := ProtoCompare ProtoCompare2 StaticsFromCode XandY |
| 90 | ART_GTEST_proxy_test_DEX_DEPS := Interfaces |
| 91 | ART_GTEST_reflection_test_DEX_DEPS := Main NonStaticLeafMethods StaticLeafMethods |
Calin Juravle | 877fd96 | 2016-01-05 14:29:29 +0000 | [diff] [blame] | 92 | ART_GTEST_profile_assistant_test_DEX_DEPS := ProfileTestMultiDex |
| 93 | ART_GTEST_profile_compilation_info_test_DEX_DEPS := ProfileTestMultiDex |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 94 | ART_GTEST_stub_test_DEX_DEPS := AllFields |
| 95 | ART_GTEST_transaction_test_DEX_DEPS := Transaction |
Artem Udovichenko | d9786b0 | 2015-10-14 16:36:55 +0300 | [diff] [blame] | 96 | ART_GTEST_type_lookup_table_test_DEX_DEPS := Lookup |
David Brazdil | ca3c8c3 | 2016-09-06 14:04:48 +0100 | [diff] [blame^] | 97 | ART_GTEST_verifier_deps_test_DEX_DEPS := VerifierDeps |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 98 | |
| 99 | # The elf writer test has dependencies on core.oat. |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 100 | ART_GTEST_elf_writer_test_HOST_DEPS := $(HOST_CORE_IMAGE_optimizing_no-pic_64) $(HOST_CORE_IMAGE_optimizing_no-pic_32) |
| 101 | ART_GTEST_elf_writer_test_TARGET_DEPS := $(TARGET_CORE_IMAGE_optimizing_no-pic_64) $(TARGET_CORE_IMAGE_optimizing_no-pic_32) |
Brian Carlstrom | 53463ea | 2014-11-09 14:11:51 -0800 | [diff] [blame] | 102 | |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 103 | ART_GTEST_dex2oat_environment_tests_HOST_DEPS := \ |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 104 | $(HOST_CORE_IMAGE_optimizing_pic_64) \ |
| 105 | $(HOST_CORE_IMAGE_optimizing_pic_32) \ |
Richard Uhler | f51ac42 | 2016-07-08 09:22:33 -0700 | [diff] [blame] | 106 | $(HOST_OUT_EXECUTABLES)/patchoatd |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 107 | ART_GTEST_dex2oat_environment_tests_TARGET_DEPS := \ |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 108 | $(TARGET_CORE_IMAGE_optimizing_pic_64) \ |
| 109 | $(TARGET_CORE_IMAGE_optimizing_pic_32) \ |
Richard Uhler | f51ac42 | 2016-07-08 09:22:33 -0700 | [diff] [blame] | 110 | $(TARGET_OUT_EXECUTABLES)/patchoatd |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 111 | |
| 112 | ART_GTEST_oat_file_assistant_test_HOST_DEPS := \ |
Richard Uhler | f51ac42 | 2016-07-08 09:22:33 -0700 | [diff] [blame] | 113 | $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 114 | ART_GTEST_oat_file_assistant_test_TARGET_DEPS := \ |
Richard Uhler | f51ac42 | 2016-07-08 09:22:33 -0700 | [diff] [blame] | 115 | $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 116 | |
| 117 | |
| 118 | ART_GTEST_dex2oat_test_HOST_DEPS := \ |
| 119 | $(ART_GTEST_dex2oat_environment_tests_HOST_DEPS) |
| 120 | ART_GTEST_dex2oat_test_TARGET_DEPS := \ |
| 121 | $(ART_GTEST_dex2oat_environment_tests_TARGET_DEPS) |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 122 | |
Brian Carlstrom | 53463ea | 2014-11-09 14:11:51 -0800 | [diff] [blame] | 123 | # TODO: document why this is needed. |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 124 | ART_GTEST_proxy_test_HOST_DEPS := $(HOST_CORE_IMAGE_optimizing_no-pic_64) $(HOST_CORE_IMAGE_optimizing_no-pic_32) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 125 | |
Aart Bik | cfbe53c | 2015-07-06 14:27:27 -0700 | [diff] [blame] | 126 | # The dexdump test requires an image and the dexdump utility. |
Aart Bik | 22c26f5 | 2015-07-08 21:20:13 +0000 | [diff] [blame] | 127 | # TODO: rename into dexdump when migration completes |
Aart Bik | cfbe53c | 2015-07-06 14:27:27 -0700 | [diff] [blame] | 128 | ART_GTEST_dexdump_test_HOST_DEPS := \ |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 129 | $(HOST_CORE_IMAGE_optimizing_no-pic_64) \ |
| 130 | $(HOST_CORE_IMAGE_optimizing_no-pic_32) \ |
Aart Bik | 22c26f5 | 2015-07-08 21:20:13 +0000 | [diff] [blame] | 131 | $(HOST_OUT_EXECUTABLES)/dexdump2 |
Aart Bik | cfbe53c | 2015-07-06 14:27:27 -0700 | [diff] [blame] | 132 | ART_GTEST_dexdump_test_TARGET_DEPS := \ |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 133 | $(TARGET_CORE_IMAGE_optimizing_no-pic_64) \ |
| 134 | $(TARGET_CORE_IMAGE_optimizing_no-pic_32) \ |
Aart Bik | 22c26f5 | 2015-07-08 21:20:13 +0000 | [diff] [blame] | 135 | dexdump2 |
Aart Bik | cfbe53c | 2015-07-06 14:27:27 -0700 | [diff] [blame] | 136 | |
Jeff Hao | c3acfc5 | 2016-08-29 14:18:26 -0700 | [diff] [blame] | 137 | # The dexlayout test requires an image and the dexlayout utility. |
| 138 | # TODO: rename into dexdump when migration completes |
| 139 | ART_GTEST_dexlayout_test_HOST_DEPS := \ |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 140 | $(HOST_CORE_IMAGE_optimizing_no-pic_64) \ |
| 141 | $(HOST_CORE_IMAGE_optimizing_no-pic_32) \ |
Jeff Hao | c3acfc5 | 2016-08-29 14:18:26 -0700 | [diff] [blame] | 142 | $(HOST_OUT_EXECUTABLES)/dexlayout \ |
| 143 | $(HOST_OUT_EXECUTABLES)/dexdump2 |
| 144 | ART_GTEST_dexlayout_test_TARGET_DEPS := \ |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 145 | $(TARGET_CORE_IMAGE_optimizing_no-pic_64) \ |
| 146 | $(TARGET_CORE_IMAGE_optimizing_no-pic_32) \ |
Jeff Hao | c3acfc5 | 2016-08-29 14:18:26 -0700 | [diff] [blame] | 147 | dexlayout \ |
| 148 | dexdump2 |
| 149 | |
Aart Bik | 3e40f4a | 2015-07-07 17:09:41 -0700 | [diff] [blame] | 150 | # The dexlist test requires an image and the dexlist utility. |
Aart Bik | 3e40f4a | 2015-07-07 17:09:41 -0700 | [diff] [blame] | 151 | ART_GTEST_dexlist_test_HOST_DEPS := \ |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 152 | $(HOST_CORE_IMAGE_optimizing_no-pic_64) \ |
| 153 | $(HOST_CORE_IMAGE_optimizing_no-pic_32) \ |
Aart Bik | b1b45be | 2015-08-28 11:09:29 -0700 | [diff] [blame] | 154 | $(HOST_OUT_EXECUTABLES)/dexlist |
Aart Bik | 3e40f4a | 2015-07-07 17:09:41 -0700 | [diff] [blame] | 155 | ART_GTEST_dexlist_test_TARGET_DEPS := \ |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 156 | $(TARGET_CORE_IMAGE_optimizing_no-pic_64) \ |
| 157 | $(TARGET_CORE_IMAGE_optimizing_no-pic_32) \ |
Aart Bik | b1b45be | 2015-08-28 11:09:29 -0700 | [diff] [blame] | 158 | dexlist |
Aart Bik | 3e40f4a | 2015-07-07 17:09:41 -0700 | [diff] [blame] | 159 | |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 160 | # 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] | 161 | # For the host, also add the installed tool (in the base size, that should suffice). For the |
| 162 | # target, just the module is fine, the sync will happen late enough. |
| 163 | ART_GTEST_imgdiag_test_HOST_DEPS := \ |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 164 | $(HOST_CORE_IMAGE_optimizing_no-pic_64) \ |
| 165 | $(HOST_CORE_IMAGE_optimizing_no-pic_32) \ |
Andreas Gampe | c93b8b5 | 2014-12-19 23:12:25 -0800 | [diff] [blame] | 166 | $(HOST_OUT_EXECUTABLES)/imgdiagd |
| 167 | ART_GTEST_imgdiag_test_TARGET_DEPS := \ |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 168 | $(TARGET_CORE_IMAGE_optimizing_no-pic_64) \ |
| 169 | $(TARGET_CORE_IMAGE_optimizing_no-pic_32) \ |
Andreas Gampe | c93b8b5 | 2014-12-19 23:12:25 -0800 | [diff] [blame] | 170 | imgdiagd |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 171 | |
Mathieu Chartier | ea216b3 | 2015-05-26 19:48:16 -0700 | [diff] [blame] | 172 | # Oatdump test requires an image and oatfile to dump. |
| 173 | ART_GTEST_oatdump_test_HOST_DEPS := \ |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 174 | $(HOST_CORE_IMAGE_optimizing_no-pic_64) \ |
| 175 | $(HOST_CORE_IMAGE_optimizing_no-pic_32) \ |
Mathieu Chartier | ea216b3 | 2015-05-26 19:48:16 -0700 | [diff] [blame] | 176 | $(HOST_OUT_EXECUTABLES)/oatdumpd |
| 177 | ART_GTEST_oatdump_test_TARGET_DEPS := \ |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 178 | $(TARGET_CORE_IMAGE_optimizing_no-pic_64) \ |
| 179 | $(TARGET_CORE_IMAGE_optimizing_no-pic_32) \ |
Mathieu Chartier | ea216b3 | 2015-05-26 19:48:16 -0700 | [diff] [blame] | 180 | oatdump |
| 181 | |
Calin Juravle | 2e2db78 | 2016-02-23 12:00:03 +0000 | [diff] [blame] | 182 | # Profile assistant tests requires profman utility. |
| 183 | ART_GTEST_profile_assistant_test_HOST_DEPS := \ |
| 184 | $(HOST_OUT_EXECUTABLES)/profmand |
| 185 | ART_GTEST_profile_assistant_test_TARGET_DEPS := \ |
| 186 | profman |
| 187 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 188 | # 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] | 189 | LOCAL_PATH := art |
| 190 | |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 191 | ART_TEST_MODULES := \ |
| 192 | art_cmdline_tests \ |
| 193 | art_compiler_tests \ |
| 194 | art_compiler_host_tests \ |
| 195 | art_dex2oat_tests \ |
| 196 | art_dexdump_tests \ |
| 197 | art_dexlayout_tests \ |
| 198 | art_dexlist_tests \ |
| 199 | art_imgdiag_tests \ |
| 200 | art_oatdump_tests \ |
| 201 | art_profman_tests \ |
| 202 | art_runtime_tests \ |
| 203 | art_runtime_compiler_tests \ |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 204 | |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 205 | ART_TARGET_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\ |
| 206 | $(ART_TEST_LIST_device_$(TARGET_ARCH)_$(m))) |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 207 | |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 208 | ART_HOST_GTEST_FILES := $(foreach m,$(ART_TEST_MODULES),\ |
Colin Cross | 124f881 | 2016-09-15 20:57:47 -0700 | [diff] [blame] | 209 | $(ART_TEST_LIST_host_$(ART_HOST_ARCH)_$(m))) |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 210 | |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 211 | ART_TEST_CFLAGS := |
buzbee | 2cfc639 | 2012-05-07 14:51:40 -0700 | [diff] [blame] | 212 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 213 | # Variables holding collections of gtest pre-requisits used to run a number of gtests. |
| 214 | ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 215 | ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 216 | ART_TEST_HOST_GTEST_RULES := |
| 217 | ART_TEST_HOST_VALGRIND_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 218 | ART_TEST_HOST_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 219 | ART_TEST_HOST_VALGRIND_GTEST_RULES := |
| 220 | ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 221 | ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 222 | ART_TEST_TARGET_GTEST_RULES := |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 223 | ART_TEST_TARGET_VALGRIND_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 224 | ART_TEST_TARGET_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 225 | ART_TEST_TARGET_VALGRIND_GTEST_RULES := |
Nicolas Geoffray | 58035ae | 2015-05-27 19:10:27 +0100 | [diff] [blame] | 226 | ART_TEST_HOST_GTEST_DEPENDENCIES := |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 227 | |
Nicolas Geoffray | 96a37c8 | 2014-10-29 23:50:40 +0000 | [diff] [blame] | 228 | ART_GTEST_TARGET_ANDROID_ROOT := '/system' |
| 229 | ifneq ($(ART_TEST_ANDROID_ROOT),) |
| 230 | ART_GTEST_TARGET_ANDROID_ROOT := $(ART_TEST_ANDROID_ROOT) |
| 231 | endif |
| 232 | |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 233 | ART_VALGRIND_TARGET_DEPENDENCIES := \ |
| 234 | $(TARGET_OUT_EXECUTABLES)/valgrind \ |
| 235 | $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/memcheck-$(TARGET_ARCH)-linux \ |
| 236 | $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_core-$(TARGET_ARCH)-linux.so \ |
| 237 | $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_memcheck-$(TARGET_ARCH)-linux.so \ |
| 238 | $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/default.supp |
| 239 | |
| 240 | ifdef TARGET_2ND_ARCH |
| 241 | ART_VALGRIND_TARGET_DEPENDENCIES += \ |
| 242 | $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/memcheck-$(TARGET_2ND_ARCH)-linux \ |
| 243 | $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_core-$(TARGET_2ND_ARCH)-linux.so \ |
| 244 | $(TARGET_OUT_SHARED_LIBRARIES)/valgrind/vgpreload_memcheck-$(TARGET_2ND_ARCH)-linux.so |
| 245 | endif |
| 246 | |
| 247 | include $(CLEAR_VARS) |
| 248 | LOCAL_MODULE := valgrind-target-suppressions.txt |
| 249 | LOCAL_MODULE_CLASS := ETC |
| 250 | LOCAL_MODULE_TAGS := optional |
| 251 | LOCAL_SRC_FILES := test/valgrind-target-suppressions.txt |
| 252 | LOCAL_MODULE_PATH := $(ART_TARGET_TEST_OUT) |
| 253 | include $(BUILD_PREBUILT) |
| 254 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 255 | # Define a make rule for a target device gtest. |
| 256 | # $(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] | 257 | # $(2): path relative to $OUT to the test binary |
| 258 | # $(3): 2ND_ or undefined - used to differentiate between the primary and secondary architecture. |
| 259 | # $(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] | 260 | define define-art-gtest-rule-target |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 261 | gtest_rule := test-art-target-gtest-$(1)$$($(3)ART_PHONY_TEST_TARGET_SUFFIX) |
| 262 | gtest_exe := $(OUT_DIR)/$(2) |
| 263 | gtest_target_exe := $$(patsubst $(PRODUCT_OUT)/%,/%,$$(gtest_exe)) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 264 | |
Brian Carlstrom | 532714a | 2014-06-25 02:15:31 -0700 | [diff] [blame] | 265 | # 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] | 266 | # to ensure files are pushed to the device. |
| 267 | TEST_ART_TARGET_SYNC_DEPS += \ |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 268 | $$(ART_GTEST_$(1)_TARGET_DEPS) \ |
Ian Rogers | 1a2f84e | 2014-07-07 16:05:18 -0700 | [diff] [blame] | 269 | $(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] | 270 | $$(gtest_exe) \ |
| 271 | $$($(3)TARGET_OUT_SHARED_LIBRARIES)/libjavacore.so \ |
| 272 | $$($(3)TARGET_OUT_SHARED_LIBRARIES)/libopenjdkd.so \ |
Andreas Gampe | c7d4a58 | 2015-09-30 11:52:02 -0700 | [diff] [blame] | 273 | $$(TARGET_OUT_JAVA_LIBRARIES)/core-libart-testdex.jar \ |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 274 | $$(TARGET_OUT_JAVA_LIBRARIES)/core-oj-testdex.jar \ |
| 275 | $$(ART_TARGET_TEST_OUT)/valgrind-target-suppressions.txt |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 276 | |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 277 | $$(gtest_rule) valgrind-$$(gtest_rule): PRIVATE_TARGET_EXE := $$(gtest_target_exe) |
| 278 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 279 | .PHONY: $$(gtest_rule) |
| 280 | $$(gtest_rule): test-art-target-sync |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 281 | $(hide) adb shell touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID |
| 282 | $(hide) adb shell rm $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID |
| 283 | $(hide) adb shell chmod 755 $$(PRIVATE_TARGET_EXE) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 284 | $(hide) $$(call ART_TEST_SKIP,$$@) && \ |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 285 | (adb shell "$(GCOV_ENV) LD_LIBRARY_PATH=$(4) ANDROID_ROOT=$(ART_GTEST_TARGET_ANDROID_ROOT) \ |
| 286 | $$(PRIVATE_TARGET_EXE) && touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID" \ |
| 287 | && (adb pull $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID /tmp/ \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 288 | && $$(call ART_TEST_PASSED,$$@)) \ |
| 289 | || $$(call ART_TEST_FAILED,$$@)) |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 290 | $(hide) rm -f /tmp/$$@-$$$$PPID |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 291 | |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 292 | 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] | 293 | ART_TEST_TARGET_GTEST_RULES += $$(gtest_rule) |
| 294 | ART_TEST_TARGET_GTEST_$(1)_RULES += $$(gtest_rule) |
| 295 | |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 296 | .PHONY: valgrind-$$(gtest_rule) |
| 297 | valgrind-$$(gtest_rule): $(ART_VALGRIND_TARGET_DEPENDENCIES) test-art-target-sync |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 298 | $(hide) adb shell touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID |
| 299 | $(hide) adb shell rm $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID |
| 300 | $(hide) adb shell chmod 755 $$(PRIVATE_TARGET_EXE) |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 301 | $(hide) $$(call ART_TEST_SKIP,$$@) && \ |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 302 | (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] | 303 | valgrind --leak-check=full --error-exitcode=1 --workaround-gcc296-bugs=yes \ |
| 304 | --suppressions=$(ART_TARGET_TEST_DIR)/valgrind-target-suppressions.txt \ |
Andreas Gampe | bf13e80 | 2016-09-02 19:43:09 -0700 | [diff] [blame] | 305 | --num-callers=50 \ |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 306 | $$(PRIVATE_TARGET_EXE) && touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID" \ |
| 307 | && (adb pull $(ART_TARGET_TEST_DIR)/$(TARGET_$(3)ARCH)/$$@-$$$$PPID /tmp/ \ |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 308 | && $$(call ART_TEST_PASSED,$$@)) \ |
| 309 | || $$(call ART_TEST_FAILED,$$@)) |
| 310 | $(hide) rm -f /tmp/$$@-$$$$PPID |
| 311 | |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 312 | 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] | 313 | ART_TEST_TARGET_VALGRIND_GTEST_RULES += valgrind-$$(gtest_rule) |
| 314 | ART_TEST_TARGET_VALGRIND_GTEST_$(1)_RULES += valgrind-$$(gtest_rule) |
| 315 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 316 | # Clear locally defined variables. |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 317 | valgrind_gtest_rule := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 318 | gtest_rule := |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 319 | gtest_exe := |
| 320 | gtest_target_exe := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 321 | endef # define-art-gtest-rule-target |
| 322 | |
Andreas Gampe | 3c0bb31 | 2015-02-19 10:02:19 -0800 | [diff] [blame] | 323 | ART_VALGRIND_DEPENDENCIES := \ |
| 324 | $(HOST_OUT_EXECUTABLES)/valgrind \ |
| 325 | $(HOST_OUT)/lib64/valgrind/memcheck-amd64-linux \ |
| 326 | $(HOST_OUT)/lib64/valgrind/memcheck-x86-linux \ |
| 327 | $(HOST_OUT)/lib64/valgrind/default.supp \ |
| 328 | $(HOST_OUT)/lib64/valgrind/vgpreload_core-amd64-linux.so \ |
| 329 | $(HOST_OUT)/lib64/valgrind/vgpreload_core-x86-linux.so \ |
| 330 | $(HOST_OUT)/lib64/valgrind/vgpreload_memcheck-amd64-linux.so \ |
| 331 | $(HOST_OUT)/lib64/valgrind/vgpreload_memcheck-x86-linux.so |
| 332 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 333 | # Define make rules for a host gtests. |
| 334 | # $(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] | 335 | # $(2): path relative to $OUT to the test binary |
| 336 | # $(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] | 337 | define define-art-gtest-rule-host |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 338 | gtest_rule := test-art-host-gtest-$(1)$$($(3)ART_PHONY_TEST_HOST_SUFFIX) |
| 339 | gtest_exe := $(OUT_DIR)/$(2) |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 340 | # Dependencies for all host gtests. |
| 341 | gtest_deps := $$(HOST_CORE_DEX_LOCATIONS) \ |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 342 | $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$$(ART_HOST_SHLIB_EXTENSION) \ |
| 343 | $$($(3)ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdkd$$(ART_HOST_SHLIB_EXTENSION) \ |
Nicolas Geoffray | 58035ae | 2015-05-27 19:10:27 +0100 | [diff] [blame] | 344 | $$(gtest_exe) \ |
| 345 | $$(ART_GTEST_$(1)_HOST_DEPS) \ |
| 346 | $(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] | 347 | |
Nicolas Geoffray | 58035ae | 2015-05-27 19:10:27 +0100 | [diff] [blame] | 348 | ART_TEST_HOST_GTEST_DEPENDENCIES += $$(gtest_deps) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 349 | |
| 350 | .PHONY: $$(gtest_rule) |
Nicolas Geoffray | 0f7c06d | 2015-05-28 10:21:03 +0100 | [diff] [blame] | 351 | $$(gtest_rule): $$(gtest_exe) $$(gtest_deps) |
Dmitriy Ivanov | 8508a43 | 2014-10-14 11:38:46 -0700 | [diff] [blame] | 352 | $(hide) ($$(call ART_TEST_SKIP,$$@) && $$< && $$(call ART_TEST_PASSED,$$@)) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 353 | || $$(call ART_TEST_FAILED,$$@) |
| 354 | |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 355 | 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] | 356 | ART_TEST_HOST_GTEST_RULES += $$(gtest_rule) |
| 357 | ART_TEST_HOST_GTEST_$(1)_RULES += $$(gtest_rule) |
| 358 | |
Andreas Gampe | 3c0bb31 | 2015-02-19 10:02:19 -0800 | [diff] [blame] | 359 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 360 | .PHONY: valgrind-$$(gtest_rule) |
Andreas Gampe | 3db3600 | 2015-05-28 20:17:09 -0700 | [diff] [blame] | 361 | valgrind-$$(gtest_rule): $$(gtest_exe) $$(gtest_deps) $(ART_VALGRIND_DEPENDENCIES) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 362 | $(hide) $$(call ART_TEST_SKIP,$$@) && \ |
Andreas Gampe | 8df91ac | 2015-02-20 13:15:15 -0800 | [diff] [blame] | 363 | VALGRIND_LIB=$(HOST_OUT)/lib64/valgrind \ |
Hiroshi Yamauchi | dc15e89 | 2016-03-10 13:49:14 -0800 | [diff] [blame] | 364 | $(HOST_OUT_EXECUTABLES)/valgrind --leak-check=full --error-exitcode=1 \ |
Andreas Gampe | bf13e80 | 2016-09-02 19:43:09 -0700 | [diff] [blame] | 365 | --suppressions=art/test/valgrind-suppressions.txt --num-callers=50 \ |
| 366 | $$< && \ |
Andreas Gampe | 3c0bb31 | 2015-02-19 10:02:19 -0800 | [diff] [blame] | 367 | $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 368 | |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 369 | 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] | 370 | ART_TEST_HOST_VALGRIND_GTEST_RULES += valgrind-$$(gtest_rule) |
| 371 | ART_TEST_HOST_VALGRIND_GTEST_$(1)_RULES += valgrind-$$(gtest_rule) |
| 372 | |
| 373 | # Clear locally defined variables. |
| 374 | valgrind_gtest_rule := |
| 375 | gtest_rule := |
| 376 | gtest_exe := |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 377 | gtest_deps := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 378 | endef # define-art-gtest-rule-host |
| 379 | |
| 380 | # Define the rules to build and run host and target gtests. |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 381 | # $(1): target or host |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 382 | # $(2): file name |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 383 | define define-art-gtest |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 384 | ifneq ($(1),target) |
| 385 | ifneq ($(1),host) |
| 386 | $$(error expected target or host for argument 1, received $(1)) |
| 387 | endif |
| 388 | endif |
| 389 | |
| 390 | art_target_or_host := $(1) |
| 391 | art_gtest_filename := $(2) |
| 392 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 393 | include $$(CLEAR_VARS) |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 394 | art_gtest_name := $$(notdir $$(basename $$(art_gtest_filename))) |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 395 | |
Brian Carlstrom | 871599a | 2012-09-06 13:27:49 -0700 | [diff] [blame] | 396 | ifeq ($$(art_target_or_host),target) |
Nicolas Geoffray | 9eb4074 | 2014-10-29 22:38:53 +0000 | [diff] [blame] | 397 | library_path := |
| 398 | 2nd_library_path := |
| 399 | ifneq ($$(ART_TEST_ANDROID_ROOT),) |
| 400 | ifdef TARGET_2ND_ARCH |
| 401 | 2nd_library_path := $$(ART_TEST_ANDROID_ROOT)/lib |
| 402 | library_path := $$(ART_TEST_ANDROID_ROOT)/lib64 |
| 403 | else |
Nicolas Geoffray | c1dea4a | 2014-11-10 08:33:52 +0000 | [diff] [blame] | 404 | ifneq ($(filter %64,$(TARGET_ARCH)),) |
| 405 | library_path := $$(ART_TEST_ANDROID_ROOT)/lib64 |
| 406 | else |
| 407 | library_path := $$(ART_TEST_ANDROID_ROOT)/lib |
| 408 | endif |
Nicolas Geoffray | 9eb4074 | 2014-10-29 22:38:53 +0000 | [diff] [blame] | 409 | endif |
| 410 | endif |
Andreas Gampe | 5ca4eaa | 2014-05-29 02:09:33 -0700 | [diff] [blame] | 411 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 412 | ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES := |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 413 | ART_TEST_TARGET_VALGRIND_GTEST_$$(art_gtest_name)_RULES := |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 414 | ifdef TARGET_2ND_ARCH |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 415 | $$(eval $$(call define-art-gtest-rule-target,$$(art_gtest_name),$$(art_gtest_filename),2ND_,$$(2nd_library_path))) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 416 | endif |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 417 | $$(eval $$(call define-art-gtest-rule-target,$$(art_gtest_name),$$(art_gtest_filename),,$$(library_path))) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 418 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 419 | # A rule to run the different architecture versions of the gtest. |
| 420 | .PHONY: test-art-target-gtest-$$(art_gtest_name) |
| 421 | test-art-target-gtest-$$(art_gtest_name): $$(ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES) |
| 422 | $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
| 423 | |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 424 | .PHONY: valgrind-test-art-target-gtest-$$(art_gtest_name) |
| 425 | valgrind-test-art-target-gtest-$$(art_gtest_name): $$(ART_TEST_TARGET_VALGRIND_GTEST_$$(art_gtest_name)_RULES) |
| 426 | $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
| 427 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 428 | # Clear locally defined variables. |
| 429 | ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES := |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 430 | ART_TEST_TARGET_VALGRIND_GTEST_$$(art_gtest_name)_RULES := |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 431 | else # host |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 432 | ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES := |
| 433 | ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES := |
| 434 | ifneq ($$(HOST_PREFER_32_BIT),true) |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 435 | $$(eval $$(call define-art-gtest-rule-host,$$(art_gtest_name),$$(art_gtest_filename),2ND_)) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 436 | endif |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 437 | $$(eval $$(call define-art-gtest-rule-host,$$(art_gtest_name),$$(art_gtest_filename),)) |
Ian Rogers | d912e5c | 2013-11-13 12:40:11 -0800 | [diff] [blame] | 438 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 439 | # Rules to run the different architecture versions of the gtest. |
| 440 | .PHONY: test-art-host-gtest-$$(art_gtest_name) |
| 441 | test-art-host-gtest-$$(art_gtest_name): $$(ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES) |
| 442 | $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
Ian Rogers | d912e5c | 2013-11-13 12:40:11 -0800 | [diff] [blame] | 443 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 444 | .PHONY: valgrind-test-art-host-gtest-$$(art_gtest_name) |
| 445 | valgrind-test-art-host-gtest-$$(art_gtest_name): $$(ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES) |
| 446 | $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
| 447 | |
| 448 | # Clear locally defined variables. |
| 449 | ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES := |
| 450 | ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES := |
| 451 | endif # host_or_target |
| 452 | |
| 453 | # Clear locally defined variables. |
| 454 | art_target_or_host := |
| 455 | art_gtest_filename := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 456 | art_gtest_name := |
Nicolas Geoffray | 96a37c8 | 2014-10-29 23:50:40 +0000 | [diff] [blame] | 457 | library_path := |
| 458 | 2nd_library_path := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 459 | endef # define-art-gtest |
Carl Shapiro | 008e412 | 2011-06-23 17:27:46 -0700 | [diff] [blame] | 460 | |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 461 | |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 462 | ifeq ($(ART_BUILD_TARGET),true) |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 463 | $(foreach file,$(ART_TARGET_GTEST_FILES), $(eval $(call define-art-gtest,target,$(file)))) |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 464 | endif |
Ian Rogers | c5f1773 | 2014-06-05 20:48:42 -0700 | [diff] [blame] | 465 | ifeq ($(ART_BUILD_HOST),true) |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 466 | $(foreach file,$(ART_HOST_GTEST_FILES), $(eval $(call define-art-gtest,host,$(file)))) |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 467 | endif |
Tsu Chiang Chuang | ec245a4 | 2014-05-15 21:16:21 -0700 | [diff] [blame] | 468 | |
| 469 | # Used outside the art project to get a list of the current tests |
| 470 | RUNTIME_TARGET_GTEST_MAKE_TARGETS := |
Colin Cross | 6e95dd5 | 2016-09-12 15:37:10 -0700 | [diff] [blame] | 471 | $(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] | 472 | COMPILER_TARGET_GTEST_MAKE_TARGETS := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 473 | |
| 474 | # Define all the combinations of host/target, valgrind and suffix such as: |
| 475 | # test-art-host-gtest or valgrind-test-art-host-gtest64 |
| 476 | # $(1): host or target |
| 477 | # $(2): HOST or TARGET |
| 478 | # $(3): valgrind- or undefined |
| 479 | # $(4): undefined, 32 or 64 |
| 480 | define define-test-art-gtest-combination |
| 481 | ifeq ($(1),host) |
| 482 | ifneq ($(2),HOST) |
| 483 | $$(error argument mismatch $(1) and ($2)) |
| 484 | endif |
| 485 | else |
| 486 | ifneq ($(1),target) |
| 487 | $$(error found $(1) expected host or target) |
| 488 | endif |
| 489 | ifneq ($(2),TARGET) |
| 490 | $$(error argument mismatch $(1) and ($2)) |
| 491 | endif |
| 492 | endif |
| 493 | |
| 494 | rule_name := $(3)test-art-$(1)-gtest$(4) |
Andreas Gampe | 928f72b | 2014-09-09 19:53:48 -0700 | [diff] [blame] | 495 | ifeq ($(3),valgrind-) |
Andreas Gampe | 928f72b | 2014-09-09 19:53:48 -0700 | [diff] [blame] | 496 | dependencies := $$(ART_TEST_$(2)_VALGRIND_GTEST$(4)_RULES) |
| 497 | else |
| 498 | dependencies := $$(ART_TEST_$(2)_GTEST$(4)_RULES) |
| 499 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 500 | |
| 501 | .PHONY: $$(rule_name) |
| 502 | $$(rule_name): $$(dependencies) |
| 503 | $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
| 504 | |
| 505 | # Clear locally defined variables. |
| 506 | rule_name := |
| 507 | dependencies := |
| 508 | endef # define-test-art-gtest-combination |
| 509 | |
| 510 | $(eval $(call define-test-art-gtest-combination,target,TARGET,,)) |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 511 | $(eval $(call define-test-art-gtest-combination,target,TARGET,valgrind-,)) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 512 | $(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] | 513 | $(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] | 514 | ifdef TARGET_2ND_ARCH |
| 515 | $(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] | 516 | $(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] | 517 | endif |
| 518 | $(eval $(call define-test-art-gtest-combination,host,HOST,,)) |
| 519 | $(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,)) |
| 520 | $(eval $(call define-test-art-gtest-combination,host,HOST,,$(ART_PHONY_TEST_HOST_SUFFIX))) |
| 521 | $(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,$(ART_PHONY_TEST_HOST_SUFFIX))) |
| 522 | ifneq ($(HOST_PREFER_32_BIT),true) |
| 523 | $(eval $(call define-test-art-gtest-combination,host,HOST,,$(2ND_ART_PHONY_TEST_HOST_SUFFIX))) |
| 524 | $(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,$(2ND_ART_PHONY_TEST_HOST_SUFFIX))) |
| 525 | endif |
| 526 | |
| 527 | # Clear locally defined variables. |
| 528 | define-art-gtest-rule-target := |
| 529 | define-art-gtest-rule-host := |
| 530 | define-art-gtest := |
| 531 | define-test-art-gtest-combination := |
| 532 | RUNTIME_GTEST_COMMON_SRC_FILES := |
| 533 | COMPILER_GTEST_COMMON_SRC_FILES := |
| 534 | RUNTIME_GTEST_TARGET_SRC_FILES := |
| 535 | RUNTIME_GTEST_HOST_SRC_FILES := |
| 536 | COMPILER_GTEST_TARGET_SRC_FILES := |
| 537 | COMPILER_GTEST_HOST_SRC_FILES := |
| 538 | ART_TEST_CFLAGS := |
| 539 | ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 540 | ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 541 | ART_TEST_HOST_GTEST_RULES := |
| 542 | ART_TEST_HOST_VALGRIND_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 543 | ART_TEST_HOST_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 544 | ART_TEST_HOST_VALGRIND_GTEST_RULES := |
| 545 | ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 546 | ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 547 | ART_TEST_TARGET_GTEST_RULES := |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 548 | ART_TEST_TARGET_VALGRIND_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 549 | ART_TEST_TARGET_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 550 | ART_TEST_TARGET_VALGRIND_GTEST_RULES := |
Nicolas Geoffray | 96a37c8 | 2014-10-29 23:50:40 +0000 | [diff] [blame] | 551 | ART_GTEST_TARGET_ANDROID_ROOT := |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 552 | ART_GTEST_class_linker_test_DEX_DEPS := |
| 553 | ART_GTEST_compiler_driver_test_DEX_DEPS := |
| 554 | ART_GTEST_dex_file_test_DEX_DEPS := |
| 555 | ART_GTEST_exception_test_DEX_DEPS := |
| 556 | ART_GTEST_elf_writer_test_HOST_DEPS := |
| 557 | ART_GTEST_elf_writer_test_TARGET_DEPS := |
| 558 | ART_GTEST_jni_compiler_test_DEX_DEPS := |
| 559 | ART_GTEST_jni_internal_test_DEX_DEPS := |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 560 | ART_GTEST_oat_file_assistant_test_DEX_DEPS := |
| 561 | ART_GTEST_oat_file_assistant_test_HOST_DEPS := |
| 562 | ART_GTEST_oat_file_assistant_test_TARGET_DEPS := |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 563 | ART_GTEST_dex2oat_test_DEX_DEPS := |
| 564 | ART_GTEST_dex2oat_test_HOST_DEPS := |
| 565 | ART_GTEST_dex2oat_test_TARGET_DEPS := |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 566 | ART_GTEST_object_test_DEX_DEPS := |
| 567 | ART_GTEST_proxy_test_DEX_DEPS := |
| 568 | ART_GTEST_reflection_test_DEX_DEPS := |
| 569 | ART_GTEST_stub_test_DEX_DEPS := |
| 570 | ART_GTEST_transaction_test_DEX_DEPS := |
Andreas Gampe | e1459ae | 2016-06-29 09:36:30 -0700 | [diff] [blame] | 571 | ART_GTEST_dex2oat_environment_tests_DEX_DEPS := |
David Brazdil | ca3c8c3 | 2016-09-06 14:04:48 +0100 | [diff] [blame^] | 572 | ART_GTEST_verifier_deps_test_DEX_DEPS := |
Andreas Gampe | 3c0bb31 | 2015-02-19 10:02:19 -0800 | [diff] [blame] | 573 | ART_VALGRIND_DEPENDENCIES := |
Anton Kirilov | e5e76f4 | 2016-05-03 16:15:36 +0100 | [diff] [blame] | 574 | ART_VALGRIND_TARGET_DEPENDENCIES := |
Ian Rogers | 1a2f84e | 2014-07-07 16:05:18 -0700 | [diff] [blame] | 575 | $(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_TARGET_GTEST_$(dir)_DEX :=)) |
| 576 | $(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_HOST_GTEST_$(dir)_DEX :=)) |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 577 | ART_TEST_HOST_GTEST_MainStripped_DEX := |
| 578 | ART_TEST_TARGET_GTEST_MainStripped_DEX := |
David Brazdil | ca3c8c3 | 2016-09-06 14:04:48 +0100 | [diff] [blame^] | 579 | ART_TEST_GTEST_VerifierDeps_SRC := |
| 580 | ART_TEST_HOST_GTEST_VerifierDeps_DEX := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 581 | GTEST_DEX_DIRECTORIES := |
Brian Carlstrom | 532714a | 2014-06-25 02:15:31 -0700 | [diff] [blame] | 582 | LOCAL_PATH := |