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 \ |
Igor Murashkin | 457e874 | 2015-10-22 17:37:50 -0700 | [diff] [blame] | 32 | LambdaInterfaces \ |
Artem Udovichenko | d9786b0 | 2015-10-14 16:36:55 +0300 | [diff] [blame] | 33 | Lookup \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 34 | Main \ |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 35 | MultiDex \ |
Richard Uhler | 67ff7d1 | 2015-05-14 13:21:13 -0700 | [diff] [blame] | 36 | MultiDexModifiedSecondary \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 37 | MyClass \ |
| 38 | MyClassNatives \ |
| 39 | Nested \ |
| 40 | NonStaticLeafMethods \ |
| 41 | ProtoCompare \ |
| 42 | ProtoCompare2 \ |
| 43 | StaticLeafMethods \ |
| 44 | Statics \ |
| 45 | StaticsFromCode \ |
| 46 | Transaction \ |
| 47 | XandY |
| 48 | |
| 49 | # Create build rules for each dex file recording the dependency. |
| 50 | $(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] | 51 | $(ART_TARGET_NATIVETEST_OUT),art/build/Android.gtest.mk,ART_TEST_TARGET_GTEST_$(dir)_DEX, \ |
| 52 | ART_TEST_HOST_GTEST_$(dir)_DEX))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 53 | |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 54 | # Create rules for MainStripped, a copy of Main with the classes.dex stripped |
| 55 | # for the oat file assistant tests. |
| 56 | ART_TEST_HOST_GTEST_MainStripped_DEX := $(basename $(ART_TEST_HOST_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_HOST_GTEST_Main_DEX)) |
| 57 | ART_TEST_TARGET_GTEST_MainStripped_DEX := $(basename $(ART_TEST_TARGET_GTEST_Main_DEX))Stripped$(suffix $(ART_TEST_TARGET_GTEST_Main_DEX)) |
| 58 | |
| 59 | $(ART_TEST_HOST_GTEST_MainStripped_DEX): $(ART_TEST_HOST_GTEST_Main_DEX) |
| 60 | cp $< $@ |
| 61 | $(call dexpreopt-remove-classes.dex,$@) |
| 62 | |
| 63 | $(ART_TEST_TARGET_GTEST_MainStripped_DEX): $(ART_TEST_TARGET_GTEST_Main_DEX) |
| 64 | cp $< $@ |
| 65 | $(call dexpreopt-remove-classes.dex,$@) |
| 66 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 67 | # Dex file dependencies for each gtest. |
Andreas Gampe | 81c6f8d | 2015-03-25 17:19:53 -0700 | [diff] [blame] | 68 | ART_GTEST_class_linker_test_DEX_DEPS := Interfaces MultiDex MyClass Nested Statics StaticsFromCode |
Andreas Gampe | 70bef0d | 2015-04-15 02:37:28 -0700 | [diff] [blame] | 69 | ART_GTEST_compiler_driver_test_DEX_DEPS := AbstractMethod StaticLeafMethods |
Mathieu Chartier | d57d454 | 2015-10-14 10:55:30 -0700 | [diff] [blame] | 70 | ART_GTEST_dex_cache_test_DEX_DEPS := Main |
Andreas Gampe | da82344 | 2014-11-03 15:36:53 -0800 | [diff] [blame] | 71 | ART_GTEST_dex_file_test_DEX_DEPS := GetMethodSignature Main Nested |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 72 | ART_GTEST_exception_test_DEX_DEPS := ExceptionHandle |
Sebastien Hertz | 0462c4c | 2015-04-01 16:34:17 +0200 | [diff] [blame] | 73 | ART_GTEST_instrumentation_test_DEX_DEPS := Instrumentation |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 74 | ART_GTEST_jni_compiler_test_DEX_DEPS := MyClassNatives |
| 75 | ART_GTEST_jni_internal_test_DEX_DEPS := AllFields StaticLeafMethods |
Richard Uhler | 67ff7d1 | 2015-05-14 13:21:13 -0700 | [diff] [blame] | 76 | ART_GTEST_oat_file_assistant_test_DEX_DEPS := Main MainStripped MultiDex MultiDexModifiedSecondary Nested |
Andreas Gampe | 7848da4 | 2015-04-09 11:15:04 -0700 | [diff] [blame] | 77 | ART_GTEST_oat_file_test_DEX_DEPS := Main MultiDex |
Mathieu Chartier | 07ddb6f | 2015-11-05 11:16:34 -0800 | [diff] [blame] | 78 | ART_GTEST_oat_test_DEX_DEPS := Main |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 79 | ART_GTEST_object_test_DEX_DEPS := ProtoCompare ProtoCompare2 StaticsFromCode XandY |
| 80 | ART_GTEST_proxy_test_DEX_DEPS := Interfaces |
Igor Murashkin | 457e874 | 2015-10-22 17:37:50 -0700 | [diff] [blame] | 81 | ART_GTEST_lambda_proxy_test_DEX_DEPS := LambdaInterfaces |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 82 | ART_GTEST_reflection_test_DEX_DEPS := Main NonStaticLeafMethods StaticLeafMethods |
| 83 | ART_GTEST_stub_test_DEX_DEPS := AllFields |
| 84 | ART_GTEST_transaction_test_DEX_DEPS := Transaction |
Artem Udovichenko | d9786b0 | 2015-10-14 16:36:55 +0300 | [diff] [blame] | 85 | ART_GTEST_type_lookup_table_test_DEX_DEPS := Lookup |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 86 | |
| 87 | # The elf writer test has dependencies on core.oat. |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 88 | ART_GTEST_elf_writer_test_HOST_DEPS := $(HOST_CORE_IMAGE_default_no-pic_64) $(HOST_CORE_IMAGE_default_no-pic_32) |
| 89 | ART_GTEST_elf_writer_test_TARGET_DEPS := $(TARGET_CORE_IMAGE_default_no-pic_64) $(TARGET_CORE_IMAGE_default_no-pic_32) |
Brian Carlstrom | 53463ea | 2014-11-09 14:11:51 -0800 | [diff] [blame] | 90 | |
Richard Uhler | 9a44f87 | 2015-03-12 12:35:43 -0700 | [diff] [blame] | 91 | ART_GTEST_oat_file_assistant_test_HOST_DEPS := \ |
| 92 | $(HOST_CORE_IMAGE_default_no-pic_64) \ |
| 93 | $(HOST_CORE_IMAGE_default_no-pic_32) \ |
| 94 | $(HOST_OUT_EXECUTABLES)/patchoatd |
| 95 | ART_GTEST_oat_file_assistant_test_TARGET_DEPS := \ |
| 96 | $(TARGET_CORE_IMAGE_default_no-pic_64) \ |
| 97 | $(TARGET_CORE_IMAGE_default_no-pic_32) \ |
| 98 | $(TARGET_OUT_EXECUTABLES)/patchoatd |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 99 | |
Brian Carlstrom | 53463ea | 2014-11-09 14:11:51 -0800 | [diff] [blame] | 100 | # TODO: document why this is needed. |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 101 | ART_GTEST_proxy_test_HOST_DEPS := $(HOST_CORE_IMAGE_default_no-pic_64) $(HOST_CORE_IMAGE_default_no-pic_32) |
Igor Murashkin | 457e874 | 2015-10-22 17:37:50 -0700 | [diff] [blame] | 102 | ART_GTEST_lambda_proxy_test_HOST_DEPS := $(HOST_CORE_IMAGE_default_no-pic_64) $(HOST_CORE_IMAGE_default_no-pic_32) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 103 | |
Aart Bik | cfbe53c | 2015-07-06 14:27:27 -0700 | [diff] [blame] | 104 | # The dexdump test requires an image and the dexdump utility. |
Aart Bik | 22c26f5 | 2015-07-08 21:20:13 +0000 | [diff] [blame] | 105 | # TODO: rename into dexdump when migration completes |
Aart Bik | cfbe53c | 2015-07-06 14:27:27 -0700 | [diff] [blame] | 106 | ART_GTEST_dexdump_test_HOST_DEPS := \ |
| 107 | $(HOST_CORE_IMAGE_default_no-pic_64) \ |
| 108 | $(HOST_CORE_IMAGE_default_no-pic_32) \ |
Aart Bik | 22c26f5 | 2015-07-08 21:20:13 +0000 | [diff] [blame] | 109 | $(HOST_OUT_EXECUTABLES)/dexdump2 |
Aart Bik | cfbe53c | 2015-07-06 14:27:27 -0700 | [diff] [blame] | 110 | ART_GTEST_dexdump_test_TARGET_DEPS := \ |
| 111 | $(TARGET_CORE_IMAGE_default_no-pic_64) \ |
| 112 | $(TARGET_CORE_IMAGE_default_no-pic_32) \ |
Aart Bik | 22c26f5 | 2015-07-08 21:20:13 +0000 | [diff] [blame] | 113 | dexdump2 |
Aart Bik | cfbe53c | 2015-07-06 14:27:27 -0700 | [diff] [blame] | 114 | |
Aart Bik | 3e40f4a | 2015-07-07 17:09:41 -0700 | [diff] [blame] | 115 | # The dexlist test requires an image and the dexlist utility. |
Aart Bik | 3e40f4a | 2015-07-07 17:09:41 -0700 | [diff] [blame] | 116 | ART_GTEST_dexlist_test_HOST_DEPS := \ |
| 117 | $(HOST_CORE_IMAGE_default_no-pic_64) \ |
| 118 | $(HOST_CORE_IMAGE_default_no-pic_32) \ |
Aart Bik | b1b45be | 2015-08-28 11:09:29 -0700 | [diff] [blame] | 119 | $(HOST_OUT_EXECUTABLES)/dexlist |
Aart Bik | 3e40f4a | 2015-07-07 17:09:41 -0700 | [diff] [blame] | 120 | ART_GTEST_dexlist_test_TARGET_DEPS := \ |
| 121 | $(TARGET_CORE_IMAGE_default_no-pic_64) \ |
| 122 | $(TARGET_CORE_IMAGE_default_no-pic_32) \ |
Aart Bik | b1b45be | 2015-08-28 11:09:29 -0700 | [diff] [blame] | 123 | dexlist |
Aart Bik | 3e40f4a | 2015-07-07 17:09:41 -0700 | [diff] [blame] | 124 | |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 125 | # 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] | 126 | # For the host, also add the installed tool (in the base size, that should suffice). For the |
| 127 | # target, just the module is fine, the sync will happen late enough. |
| 128 | ART_GTEST_imgdiag_test_HOST_DEPS := \ |
| 129 | $(HOST_CORE_IMAGE_default_no-pic_64) \ |
| 130 | $(HOST_CORE_IMAGE_default_no-pic_32) \ |
| 131 | $(HOST_OUT_EXECUTABLES)/imgdiagd |
| 132 | ART_GTEST_imgdiag_test_TARGET_DEPS := \ |
| 133 | $(TARGET_CORE_IMAGE_default_no-pic_64) \ |
| 134 | $(TARGET_CORE_IMAGE_default_no-pic_32) \ |
| 135 | imgdiagd |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 136 | |
Mathieu Chartier | ea216b3 | 2015-05-26 19:48:16 -0700 | [diff] [blame] | 137 | # Oatdump test requires an image and oatfile to dump. |
| 138 | ART_GTEST_oatdump_test_HOST_DEPS := \ |
| 139 | $(HOST_CORE_IMAGE_default_no-pic_64) \ |
| 140 | $(HOST_CORE_IMAGE_default_no-pic_32) \ |
| 141 | $(HOST_OUT_EXECUTABLES)/oatdumpd |
| 142 | ART_GTEST_oatdump_test_TARGET_DEPS := \ |
| 143 | $(TARGET_CORE_IMAGE_default_no-pic_64) \ |
| 144 | $(TARGET_CORE_IMAGE_default_no-pic_32) \ |
| 145 | oatdump |
| 146 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 147 | # 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] | 148 | LOCAL_PATH := art |
| 149 | |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 150 | RUNTIME_GTEST_COMMON_SRC_FILES := \ |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 151 | cmdline/cmdline_parser_test.cc \ |
Aart Bik | 69ae54a | 2015-07-01 14:52:26 -0700 | [diff] [blame] | 152 | dexdump/dexdump_test.cc \ |
Aart Bik | 3e40f4a | 2015-07-07 17:09:41 -0700 | [diff] [blame] | 153 | dexlist/dexlist_test.cc \ |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 154 | imgdiag/imgdiag_test.cc \ |
Mathieu Chartier | 19510f0 | 2015-05-26 14:44:35 -0700 | [diff] [blame] | 155 | oatdump/oatdump_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 156 | runtime/arch/arch_test.cc \ |
Ian Rogers | d582fa4 | 2014-11-05 23:46:43 -0800 | [diff] [blame] | 157 | runtime/arch/instruction_set_test.cc \ |
| 158 | runtime/arch/instruction_set_features_test.cc \ |
Serban Constantinescu | 86797a7 | 2014-06-19 16:17:56 +0100 | [diff] [blame] | 159 | runtime/arch/memcmp16_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 160 | runtime/arch/stub_test.cc \ |
Ian Rogers | d582fa4 | 2014-11-05 23:46:43 -0800 | [diff] [blame] | 161 | runtime/arch/arm/instruction_set_features_arm_test.cc \ |
| 162 | runtime/arch/arm64/instruction_set_features_arm64_test.cc \ |
| 163 | runtime/arch/mips/instruction_set_features_mips_test.cc \ |
Andreas Gampe | 57b3429 | 2015-01-14 15:45:59 -0800 | [diff] [blame] | 164 | runtime/arch/mips64/instruction_set_features_mips64_test.cc \ |
Ian Rogers | d582fa4 | 2014-11-05 23:46:43 -0800 | [diff] [blame] | 165 | runtime/arch/x86/instruction_set_features_x86_test.cc \ |
| 166 | runtime/arch/x86_64/instruction_set_features_x86_64_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 167 | runtime/barrier_test.cc \ |
| 168 | runtime/base/bit_field_test.cc \ |
Vladimir Marko | 80afd02 | 2015-05-19 18:08:00 +0100 | [diff] [blame] | 169 | runtime/base/bit_utils_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 170 | runtime/base/bit_vector_test.cc \ |
Mathieu Chartier | c2e2062 | 2014-11-03 11:41:47 -0800 | [diff] [blame] | 171 | runtime/base/hash_set_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 172 | runtime/base/hex_dump_test.cc \ |
| 173 | runtime/base/histogram_test.cc \ |
| 174 | runtime/base/mutex_test.cc \ |
| 175 | runtime/base/scoped_flock_test.cc \ |
Brian Carlstrom | 2cbaccb | 2014-09-14 20:34:17 -0700 | [diff] [blame] | 176 | runtime/base/stringprintf_test.cc \ |
Vladimir Marko | 80afd02 | 2015-05-19 18:08:00 +0100 | [diff] [blame] | 177 | runtime/base/time_utils_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 178 | runtime/base/timing_logger_test.cc \ |
Igor Murashkin | aaebaa0 | 2015-01-26 10:55:53 -0800 | [diff] [blame] | 179 | runtime/base/variant_map_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 180 | runtime/base/unix_file/fd_file_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 181 | runtime/class_linker_test.cc \ |
| 182 | runtime/dex_file_test.cc \ |
| 183 | runtime/dex_file_verifier_test.cc \ |
Aart Bik | b1f3753 | 2015-06-29 11:03:55 -0700 | [diff] [blame] | 184 | runtime/dex_instruction_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 185 | runtime/dex_instruction_visitor_test.cc \ |
| 186 | runtime/dex_method_iterator_test.cc \ |
| 187 | runtime/entrypoints/math_entrypoints_test.cc \ |
| 188 | runtime/entrypoints/quick/quick_trampoline_entrypoints_test.cc \ |
| 189 | runtime/entrypoints_order_test.cc \ |
| 190 | runtime/exception_test.cc \ |
Mathieu Chartier | 2c26501 | 2014-08-05 18:15:56 -0700 | [diff] [blame] | 191 | runtime/gc/accounting/card_table_test.cc \ |
Mathieu Chartier | 4858a93 | 2015-01-23 13:18:53 -0800 | [diff] [blame] | 192 | runtime/gc/accounting/mod_union_table_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 193 | runtime/gc/accounting/space_bitmap_test.cc \ |
Mathieu Chartier | 763a31e | 2015-11-16 16:05:55 -0800 | [diff] [blame] | 194 | runtime/gc/collector/immune_spaces_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 195 | runtime/gc/heap_test.cc \ |
Mathieu Chartier | 9e2094f | 2014-12-11 18:43:48 -0800 | [diff] [blame] | 196 | runtime/gc/reference_queue_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 197 | runtime/gc/space/dlmalloc_space_base_test.cc \ |
| 198 | runtime/gc/space/dlmalloc_space_static_test.cc \ |
| 199 | runtime/gc/space/dlmalloc_space_random_test.cc \ |
| 200 | runtime/gc/space/rosalloc_space_base_test.cc \ |
| 201 | runtime/gc/space/rosalloc_space_static_test.cc \ |
| 202 | runtime/gc/space/rosalloc_space_random_test.cc \ |
| 203 | runtime/gc/space/large_object_space_test.cc \ |
Mathieu Chartier | a5eae69 | 2014-12-17 17:56:03 -0800 | [diff] [blame] | 204 | runtime/gc/task_processor_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 205 | runtime/gtest_test.cc \ |
| 206 | runtime/handle_scope_test.cc \ |
| 207 | runtime/indenter_test.cc \ |
| 208 | runtime/indirect_reference_table_test.cc \ |
Sebastien Hertz | 0462c4c | 2015-04-01 16:34:17 +0200 | [diff] [blame] | 209 | runtime/instrumentation_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 210 | runtime/intern_table_test.cc \ |
Ian Rogers | 5ac814a | 2014-11-04 16:39:32 -0800 | [diff] [blame] | 211 | runtime/interpreter/safe_math_test.cc \ |
Andreas Gampe | 799681b | 2015-05-15 19:24:12 -0700 | [diff] [blame] | 212 | runtime/interpreter/unstarted_runtime_test.cc \ |
Ian Rogers | f4d4da1 | 2014-11-11 16:10:33 -0800 | [diff] [blame] | 213 | runtime/java_vm_ext_test.cc \ |
Igor Murashkin | fc1ccd7 | 2015-07-30 15:11:09 -0700 | [diff] [blame] | 214 | runtime/lambda/closure_test.cc \ |
| 215 | runtime/lambda/shorty_field_type_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 216 | runtime/leb128_test.cc \ |
| 217 | runtime/mem_map_test.cc \ |
Roland Levillain | a2d8ec6 | 2015-03-12 15:25:29 +0000 | [diff] [blame] | 218 | runtime/memory_region_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 219 | runtime/mirror/dex_cache_test.cc \ |
| 220 | runtime/mirror/object_test.cc \ |
Andreas Gampe | 7424081 | 2014-04-17 10:35:09 -0700 | [diff] [blame] | 221 | runtime/monitor_pool_test.cc \ |
Elena Sayapina | 1af6a1f | 2014-06-20 16:58:37 +0700 | [diff] [blame] | 222 | runtime/monitor_test.cc \ |
Richard Uhler | e5fed03 | 2015-03-18 08:21:11 -0700 | [diff] [blame] | 223 | runtime/oat_file_test.cc \ |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 224 | runtime/oat_file_assistant_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 225 | runtime/parsed_options_test.cc \ |
David Srbecky | 3e52aa4 | 2015-04-12 07:45:18 +0100 | [diff] [blame] | 226 | runtime/prebuilt_tools_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 227 | runtime/reference_table_test.cc \ |
| 228 | runtime/thread_pool_test.cc \ |
| 229 | runtime/transaction_test.cc \ |
Artem Udovichenko | d9786b0 | 2015-10-14 16:36:55 +0300 | [diff] [blame] | 230 | runtime/type_lookup_table_test.cc \ |
Narayan Kamath | a5afcfc | 2015-01-29 20:06:46 +0000 | [diff] [blame] | 231 | runtime/utf_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 232 | runtime/utils_test.cc \ |
| 233 | runtime/verifier/method_verifier_test.cc \ |
| 234 | runtime/verifier/reg_type_test.cc \ |
| 235 | runtime/zip_archive_test.cc |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 236 | |
| 237 | COMPILER_GTEST_COMMON_SRC_FILES := \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 238 | runtime/jni_internal_test.cc \ |
Igor Murashkin | 457e874 | 2015-10-22 17:37:50 -0700 | [diff] [blame] | 239 | runtime/lambda_proxy_test.cc \ |
Jeff Hao | db8a664 | 2014-08-14 17:18:52 -0700 | [diff] [blame] | 240 | runtime/proxy_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 241 | runtime/reflection_test.cc \ |
Vladimir Marko | 35831e8 | 2015-09-11 11:59:18 +0100 | [diff] [blame] | 242 | compiler/compiled_method_test.cc \ |
Vladimir Marko | 7a01dc2 | 2015-01-02 17:00:44 +0000 | [diff] [blame] | 243 | compiler/dex/gvn_dead_code_elimination_test.cc \ |
Vladimir Marko | 95a0597 | 2014-05-30 10:01:32 +0100 | [diff] [blame] | 244 | compiler/dex/global_value_numbering_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 245 | compiler/dex/local_value_numbering_test.cc \ |
Vladimir Marko | 55fff04 | 2014-07-10 12:42:52 +0100 | [diff] [blame] | 246 | compiler/dex/mir_graph_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 247 | compiler/dex/mir_optimization_test.cc \ |
Vladimir Marko | c91df2d | 2015-04-23 09:29:21 +0000 | [diff] [blame] | 248 | compiler/dex/type_inference_test.cc \ |
David Srbecky | 15c1975 | 2015-03-31 14:53:55 +0000 | [diff] [blame] | 249 | compiler/dwarf/dwarf_test.cc \ |
Vladimir Marko | 35831e8 | 2015-09-11 11:59:18 +0100 | [diff] [blame] | 250 | compiler/driver/compiled_method_storage_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 251 | compiler/driver/compiler_driver_test.cc \ |
| 252 | compiler/elf_writer_test.cc \ |
| 253 | compiler/image_test.cc \ |
| 254 | compiler/jni/jni_compiler_test.cc \ |
| 255 | compiler/oat_test.cc \ |
Mingyao Yang | f384f88 | 2014-10-22 16:08:18 -0700 | [diff] [blame] | 256 | compiler/optimizing/bounds_check_elimination_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 257 | compiler/optimizing/dominator_test.cc \ |
| 258 | compiler/optimizing/find_loops_test.cc \ |
Roland Levillain | ccc07a9 | 2014-09-16 14:48:16 +0100 | [diff] [blame] | 259 | compiler/optimizing/graph_checker_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 260 | compiler/optimizing/graph_test.cc \ |
Nicolas Geoffray | d31cf3d | 2014-09-08 17:30:24 +0100 | [diff] [blame] | 261 | compiler/optimizing/gvn_test.cc \ |
Aart Bik | 30efb4e | 2015-07-30 12:14:31 -0700 | [diff] [blame] | 262 | compiler/optimizing/induction_var_analysis_test.cc \ |
Aart Bik | 22af3be | 2015-09-10 12:50:58 -0700 | [diff] [blame] | 263 | compiler/optimizing/induction_var_range_test.cc \ |
Aart Bik | 3f307f3 | 2015-07-21 18:30:18 -0700 | [diff] [blame] | 264 | compiler/optimizing/licm_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 265 | compiler/optimizing/live_interval_test.cc \ |
Nicolas Geoffray | 724c963 | 2014-09-22 12:27:27 +0100 | [diff] [blame] | 266 | compiler/optimizing/nodes_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 267 | compiler/optimizing/parallel_move_test.cc \ |
| 268 | compiler/optimizing/pretty_printer_test.cc \ |
Aart Bik | 854a02b | 2015-07-14 16:07:00 -0700 | [diff] [blame] | 269 | compiler/optimizing/side_effects_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 270 | compiler/optimizing/ssa_test.cc \ |
Nicolas Geoffray | 99ea58c | 2014-07-02 15:08:17 +0100 | [diff] [blame] | 271 | compiler/optimizing/stack_map_test.cc \ |
Nicolas Geoffray | fbc695f | 2014-09-15 15:33:30 +0000 | [diff] [blame] | 272 | compiler/optimizing/suspend_check_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 273 | compiler/output_stream_test.cc \ |
| 274 | compiler/utils/arena_allocator_test.cc \ |
| 275 | compiler/utils/dedupe_set_test.cc \ |
Andreas Gampe | e21dc3d | 2014-12-08 16:59:43 -0800 | [diff] [blame] | 276 | compiler/utils/swap_space_test.cc \ |
Vladimir Marko | c91df2d | 2015-04-23 09:29:21 +0000 | [diff] [blame] | 277 | compiler/utils/test_dex_file_builder_test.cc \ |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 278 | |
| 279 | COMPILER_GTEST_COMMON_SRC_FILES_all := \ |
| 280 | compiler/dex/quick/quick_cfi_test.cc \ |
| 281 | compiler/jni/jni_cfi_test.cc \ |
| 282 | compiler/optimizing/codegen_test.cc \ |
| 283 | compiler/optimizing/constant_folding_test.cc \ |
| 284 | compiler/optimizing/dead_code_elimination_test.cc \ |
| 285 | compiler/optimizing/linearize_test.cc \ |
| 286 | compiler/optimizing/liveness_test.cc \ |
| 287 | compiler/optimizing/live_ranges_test.cc \ |
| 288 | compiler/optimizing/optimizing_cfi_test.cc \ |
| 289 | compiler/optimizing/register_allocator_test.cc \ |
| 290 | |
| 291 | COMPILER_GTEST_COMMON_SRC_FILES_arm := \ |
| 292 | compiler/linker/arm/relative_patcher_thumb2_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 293 | compiler/utils/arm/managed_register_arm_test.cc \ |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 294 | |
| 295 | COMPILER_GTEST_COMMON_SRC_FILES_arm64 := \ |
| 296 | compiler/linker/arm64/relative_patcher_arm64_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 297 | compiler/utils/arm64/managed_register_arm64_test.cc \ |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 298 | |
| 299 | COMPILER_GTEST_COMMON_SRC_FILES_mips := \ |
| 300 | |
| 301 | COMPILER_GTEST_COMMON_SRC_FILES_mips64 := \ |
| 302 | |
| 303 | COMPILER_GTEST_COMMON_SRC_FILES_x86 := \ |
| 304 | compiler/linker/x86/relative_patcher_x86_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 305 | compiler/utils/x86/managed_register_x86_test.cc \ |
Brian Carlstrom | 51c2467 | 2013-07-11 16:00:56 -0700 | [diff] [blame] | 306 | |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 307 | COMPILER_GTEST_COMMON_SRC_FILES_x86_64 := \ |
| 308 | compiler/linker/x86_64/relative_patcher_x86_64_test.cc \ |
| 309 | |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 310 | RUNTIME_GTEST_TARGET_SRC_FILES := \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 311 | $(RUNTIME_GTEST_COMMON_SRC_FILES) |
Brian Carlstrom | 51c2467 | 2013-07-11 16:00:56 -0700 | [diff] [blame] | 312 | |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 313 | RUNTIME_GTEST_HOST_SRC_FILES := \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 314 | $(RUNTIME_GTEST_COMMON_SRC_FILES) |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 315 | |
| 316 | COMPILER_GTEST_TARGET_SRC_FILES := \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 317 | $(COMPILER_GTEST_COMMON_SRC_FILES) |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 318 | |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 319 | COMPILER_GTEST_TARGET_SRC_FILES_all := \ |
| 320 | $(COMPILER_GTEST_COMMON_SRC_FILES_all) \ |
| 321 | |
| 322 | COMPILER_GTEST_TARGET_SRC_FILES_arm := \ |
| 323 | $(COMPILER_GTEST_COMMON_SRC_FILES_arm) \ |
| 324 | |
| 325 | COMPILER_GTEST_TARGET_SRC_FILES_arm64 := \ |
| 326 | $(COMPILER_GTEST_COMMON_SRC_FILES_arm64) \ |
| 327 | |
| 328 | COMPILER_GTEST_TARGET_SRC_FILES_mips := \ |
| 329 | $(COMPILER_GTEST_COMMON_SRC_FILES_mips) \ |
| 330 | |
| 331 | COMPILER_GTEST_TARGET_SRC_FILES_mips64 := \ |
| 332 | $(COMPILER_GTEST_COMMON_SRC_FILES_mips64) \ |
| 333 | |
| 334 | COMPILER_GTEST_TARGET_SRC_FILES_x86 := \ |
| 335 | $(COMPILER_GTEST_COMMON_SRC_FILES_x86) \ |
| 336 | |
| 337 | COMPILER_GTEST_TARGET_SRC_FILES_x86_64 := \ |
| 338 | $(COMPILER_GTEST_COMMON_SRC_FILES_x86_64) \ |
| 339 | |
| 340 | $(foreach arch,$(ART_TARGET_CODEGEN_ARCHS),$(eval COMPILER_GTEST_TARGET_SRC_FILES += $$(COMPILER_GTEST_TARGET_SRC_FILES_$(arch)))) |
| 341 | ifeq (true,$(ART_TARGET_COMPILER_TESTS)) |
| 342 | COMPILER_GTEST_TARGET_SRC_FILES += $(COMPILER_GTEST_TARGET_SRC_FILES_all) |
| 343 | endif |
| 344 | |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 345 | COMPILER_GTEST_HOST_SRC_FILES := \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 346 | $(COMPILER_GTEST_COMMON_SRC_FILES) \ |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 347 | |
| 348 | COMPILER_GTEST_HOST_SRC_FILES_all := \ |
| 349 | $(COMPILER_GTEST_COMMON_SRC_FILES_all) \ |
| 350 | |
| 351 | COMPILER_GTEST_HOST_SRC_FILES_arm := \ |
| 352 | $(COMPILER_GTEST_COMMON_SRC_FILES_arm) \ |
Roland Levillain | 1a28fc4 | 2014-11-13 18:03:06 +0000 | [diff] [blame] | 353 | compiler/utils/arm/assembler_arm32_test.cc \ |
| 354 | compiler/utils/arm/assembler_thumb2_test.cc \ |
| 355 | compiler/utils/assembler_thumb_test.cc \ |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 356 | |
| 357 | COMPILER_GTEST_HOST_SRC_FILES_arm64 := \ |
| 358 | $(COMPILER_GTEST_COMMON_SRC_FILES_arm64) \ |
| 359 | |
| 360 | COMPILER_GTEST_HOST_SRC_FILES_mips := \ |
| 361 | $(COMPILER_GTEST_COMMON_SRC_FILES_mips) \ |
Goran Jakovljevic | 8c434dc | 2015-08-26 14:39:44 +0200 | [diff] [blame] | 362 | compiler/utils/mips/assembler_mips_test.cc \ |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 363 | |
| 364 | COMPILER_GTEST_HOST_SRC_FILES_mips64 := \ |
| 365 | $(COMPILER_GTEST_COMMON_SRC_FILES_mips64) \ |
Chris Larsen | dbce0d7 | 2015-09-17 13:34:00 -0700 | [diff] [blame] | 366 | compiler/utils/mips64/assembler_mips64_test.cc \ |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 367 | |
| 368 | COMPILER_GTEST_HOST_SRC_FILES_x86 := \ |
| 369 | $(COMPILER_GTEST_COMMON_SRC_FILES_x86) \ |
| 370 | compiler/dex/quick/x86/quick_assemble_x86_test.cc \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 371 | compiler/utils/x86/assembler_x86_test.cc \ |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 372 | |
| 373 | COMPILER_GTEST_HOST_SRC_FILES_x86_64 := \ |
| 374 | $(COMPILER_GTEST_COMMON_SRC_FILES_x86_64) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 375 | compiler/utils/x86_64/assembler_x86_64_test.cc |
Brian Carlstrom | 8ecd08c | 2011-07-27 17:50:51 -0700 | [diff] [blame] | 376 | |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 377 | $(foreach arch,$(ART_HOST_CODEGEN_ARCHS),$(eval COMPILER_GTEST_HOST_SRC_FILES += $$(COMPILER_GTEST_HOST_SRC_FILES_$(arch)))) |
| 378 | ifeq (true,$(ART_HOST_COMPILER_TESTS)) |
| 379 | COMPILER_GTEST_HOST_SRC_FILES += $(COMPILER_GTEST_HOST_SRC_FILES_all) |
| 380 | endif |
| 381 | |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 382 | ART_TEST_CFLAGS := |
buzbee | 2cfc639 | 2012-05-07 14:51:40 -0700 | [diff] [blame] | 383 | |
Ian Rogers | e63db27 | 2014-07-15 15:36:11 -0700 | [diff] [blame] | 384 | include $(CLEAR_VARS) |
| 385 | LOCAL_MODULE := libart-gtest |
| 386 | LOCAL_MODULE_TAGS := optional |
| 387 | LOCAL_CPP_EXTENSION := cc |
Ian Rogers | e63db27 | 2014-07-15 15:36:11 -0700 | [diff] [blame] | 388 | LOCAL_SRC_FILES := runtime/common_runtime_test.cc compiler/common_compiler_test.cc |
| 389 | LOCAL_C_INCLUDES := $(ART_C_INCLUDES) art/runtime art/compiler |
Ian Rogers | 872dd82 | 2014-10-30 11:19:14 -0700 | [diff] [blame] | 390 | LOCAL_SHARED_LIBRARIES := libartd libartd-compiler libdl |
Dan Albert | fd84f66 | 2014-11-11 18:53:41 -0800 | [diff] [blame] | 391 | LOCAL_STATIC_LIBRARIES += libgtest |
Ian Rogers | e63db27 | 2014-07-15 15:36:11 -0700 | [diff] [blame] | 392 | LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk |
| 393 | LOCAL_ADDITIONAL_DEPENDENCIES += art/build/Android.gtest.mk |
Andreas Gampe | bced67d | 2015-01-07 14:35:44 -0800 | [diff] [blame] | 394 | $(eval $(call set-target-local-clang-vars)) |
| 395 | $(eval $(call set-target-local-cflags-vars,debug)) |
Andreas Gampe | 9b14dc3 | 2015-04-06 15:35:02 -0700 | [diff] [blame] | 396 | LOCAL_CLANG_CFLAGS += -Wno-used-but-marked-unused -Wno-deprecated -Wno-missing-noreturn # gtest issue |
Ian Rogers | e63db27 | 2014-07-15 15:36:11 -0700 | [diff] [blame] | 397 | include $(BUILD_SHARED_LIBRARY) |
| 398 | |
| 399 | include $(CLEAR_VARS) |
| 400 | LOCAL_MODULE := libart-gtest |
| 401 | LOCAL_MODULE_TAGS := optional |
| 402 | LOCAL_CPP_EXTENSION := cc |
| 403 | LOCAL_CFLAGS := $(ART_HOST_CFLAGS) |
Roland Levillain | 12bd721 | 2015-06-04 17:50:27 +0100 | [diff] [blame] | 404 | LOCAL_ASFLAGS := $(ART_HOST_ASFLAGS) |
Ian Rogers | e63db27 | 2014-07-15 15:36:11 -0700 | [diff] [blame] | 405 | LOCAL_SRC_FILES := runtime/common_runtime_test.cc compiler/common_compiler_test.cc |
| 406 | LOCAL_C_INCLUDES := $(ART_C_INCLUDES) art/runtime art/compiler |
| 407 | LOCAL_SHARED_LIBRARIES := libartd libartd-compiler |
Nicolas Geoffray | 10fc34b | 2014-11-10 21:38:15 +0000 | [diff] [blame] | 408 | LOCAL_STATIC_LIBRARIES := libgtest_host |
Ian Rogers | e63db27 | 2014-07-15 15:36:11 -0700 | [diff] [blame] | 409 | LOCAL_LDLIBS += -ldl -lpthread |
| 410 | LOCAL_MULTILIB := both |
| 411 | LOCAL_CLANG := $(ART_HOST_CLANG) |
Andreas Gampe | 9b14dc3 | 2015-04-06 15:35:02 -0700 | [diff] [blame] | 412 | LOCAL_CLANG_CFLAGS += -Wno-used-but-marked-unused -Wno-deprecated -Wno-missing-noreturn # gtest issue |
Ian Rogers | e63db27 | 2014-07-15 15:36:11 -0700 | [diff] [blame] | 413 | LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk |
| 414 | LOCAL_ADDITIONAL_DEPENDENCIES += art/build/Android.gtest.mk |
Ian Rogers | e63db27 | 2014-07-15 15:36:11 -0700 | [diff] [blame] | 415 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 416 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 417 | # Variables holding collections of gtest pre-requisits used to run a number of gtests. |
| 418 | ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 419 | ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 420 | ART_TEST_HOST_GTEST_RULES := |
| 421 | ART_TEST_HOST_VALGRIND_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 422 | ART_TEST_HOST_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 423 | ART_TEST_HOST_VALGRIND_GTEST_RULES := |
| 424 | ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 425 | ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 426 | ART_TEST_TARGET_GTEST_RULES := |
Nicolas Geoffray | 58035ae | 2015-05-27 19:10:27 +0100 | [diff] [blame] | 427 | ART_TEST_HOST_GTEST_DEPENDENCIES := |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 428 | |
Nicolas Geoffray | 96a37c8 | 2014-10-29 23:50:40 +0000 | [diff] [blame] | 429 | ART_GTEST_TARGET_ANDROID_ROOT := '/system' |
| 430 | ifneq ($(ART_TEST_ANDROID_ROOT),) |
| 431 | ART_GTEST_TARGET_ANDROID_ROOT := $(ART_TEST_ANDROID_ROOT) |
| 432 | endif |
| 433 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 434 | # Define a make rule for a target device gtest. |
| 435 | # $(1): gtest name - the name of the test we're building such as leb128_test. |
| 436 | # $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture. |
Nicolas Geoffray | 9eb4074 | 2014-10-29 22:38:53 +0000 | [diff] [blame] | 437 | # $(3): 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] | 438 | define define-art-gtest-rule-target |
| 439 | gtest_rule := test-art-target-gtest-$(1)$$($(2)ART_PHONY_TEST_TARGET_SUFFIX) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 440 | |
Brian Carlstrom | 532714a | 2014-06-25 02:15:31 -0700 | [diff] [blame] | 441 | # 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] | 442 | # to ensure files are pushed to the device. |
| 443 | TEST_ART_TARGET_SYNC_DEPS += \ |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 444 | $$(ART_GTEST_$(1)_TARGET_DEPS) \ |
Ian Rogers | 1a2f84e | 2014-07-07 16:05:18 -0700 | [diff] [blame] | 445 | $(foreach file,$(ART_GTEST_$(1)_DEX_DEPS),$(ART_TEST_TARGET_GTEST_$(file)_DEX)) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 446 | $$(ART_TARGET_NATIVETEST_OUT)/$$(TARGET_$(2)ARCH)/$(1) \ |
Nicolas Geoffray | 96a6345 | 2014-10-30 12:13:17 +0000 | [diff] [blame] | 447 | $$($(2)TARGET_OUT_SHARED_LIBRARIES)/libjavacore.so \ |
Narayan Kamath | d7b3c7f | 2015-11-18 09:49:10 +0000 | [diff] [blame] | 448 | $$($(2)TARGET_OUT_SHARED_LIBRARIES)/libopenjdk.so \ |
Narayan Kamath | d50687e | 2015-11-17 12:37:27 +0000 | [diff] [blame] | 449 | $$(TARGET_OUT_JAVA_LIBRARIES)/core-libart.jar \ |
| 450 | $$(TARGET_OUT_JAVA_LIBRARIES)/core-oj.jar |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 451 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 452 | .PHONY: $$(gtest_rule) |
| 453 | $$(gtest_rule): test-art-target-sync |
| 454 | $(hide) adb shell touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(2)ARCH)/$$@-$$$$PPID |
| 455 | $(hide) adb shell rm $(ART_TARGET_TEST_DIR)/$(TARGET_$(2)ARCH)/$$@-$$$$PPID |
| 456 | $(hide) adb shell chmod 755 $(ART_TARGET_NATIVETEST_DIR)/$(TARGET_$(2)ARCH)/$(1) |
| 457 | $(hide) $$(call ART_TEST_SKIP,$$@) && \ |
Dan Albert | 31fb260 | 2014-09-30 22:10:10 -0700 | [diff] [blame] | 458 | (adb shell "$(GCOV_ENV) LD_LIBRARY_PATH=$(3) ANDROID_ROOT=$(ART_GTEST_TARGET_ANDROID_ROOT) \ |
Nicolas Geoffray | 9eb4074 | 2014-10-29 22:38:53 +0000 | [diff] [blame] | 459 | $(ART_TARGET_NATIVETEST_DIR)/$(TARGET_$(2)ARCH)/$(1) && touch $(ART_TARGET_TEST_DIR)/$(TARGET_$(2)ARCH)/$$@-$$$$PPID" \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 460 | && (adb pull $(ART_TARGET_TEST_DIR)/$(TARGET_$(2)ARCH)/$$@-$$$$PPID /tmp/ \ |
| 461 | && $$(call ART_TEST_PASSED,$$@)) \ |
| 462 | || $$(call ART_TEST_FAILED,$$@)) |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 463 | $(hide) rm -f /tmp/$$@-$$$$PPID |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 464 | |
| 465 | ART_TEST_TARGET_GTEST$($(2)ART_PHONY_TEST_TARGET_SUFFIX)_RULES += $$(gtest_rule) |
| 466 | ART_TEST_TARGET_GTEST_RULES += $$(gtest_rule) |
| 467 | ART_TEST_TARGET_GTEST_$(1)_RULES += $$(gtest_rule) |
| 468 | |
| 469 | # Clear locally defined variables. |
| 470 | gtest_rule := |
| 471 | endef # define-art-gtest-rule-target |
| 472 | |
Andreas Gampe | 3c0bb31 | 2015-02-19 10:02:19 -0800 | [diff] [blame] | 473 | ART_VALGRIND_DEPENDENCIES := \ |
| 474 | $(HOST_OUT_EXECUTABLES)/valgrind \ |
| 475 | $(HOST_OUT)/lib64/valgrind/memcheck-amd64-linux \ |
| 476 | $(HOST_OUT)/lib64/valgrind/memcheck-x86-linux \ |
| 477 | $(HOST_OUT)/lib64/valgrind/default.supp \ |
| 478 | $(HOST_OUT)/lib64/valgrind/vgpreload_core-amd64-linux.so \ |
| 479 | $(HOST_OUT)/lib64/valgrind/vgpreload_core-x86-linux.so \ |
| 480 | $(HOST_OUT)/lib64/valgrind/vgpreload_memcheck-amd64-linux.so \ |
| 481 | $(HOST_OUT)/lib64/valgrind/vgpreload_memcheck-x86-linux.so |
| 482 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 483 | # Define make rules for a host gtests. |
| 484 | # $(1): gtest name - the name of the test we're building such as leb128_test. |
| 485 | # $(2): 2ND_ or undefined - used to differentiate between the primary and secondary architecture. |
| 486 | define define-art-gtest-rule-host |
| 487 | gtest_rule := test-art-host-gtest-$(1)$$($(2)ART_PHONY_TEST_HOST_SUFFIX) |
| 488 | gtest_exe := $$(HOST_OUT_EXECUTABLES)/$(1)$$($(2)ART_PHONY_TEST_HOST_SUFFIX) |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 489 | # Dependencies for all host gtests. |
| 490 | gtest_deps := $$(HOST_CORE_DEX_LOCATIONS) \ |
Nicolas Geoffray | 58035ae | 2015-05-27 19:10:27 +0100 | [diff] [blame] | 491 | $$($(2)ART_HOST_OUT_SHARED_LIBRARIES)/libjavacore$$(ART_HOST_SHLIB_EXTENSION) \ |
Przemyslaw Szczepaniak | 121b25e | 2015-11-20 11:24:33 +0000 | [diff] [blame] | 492 | $$($(2)ART_HOST_OUT_SHARED_LIBRARIES)/libopenjdk$$(ART_HOST_SHLIB_EXTENSION) \ |
Nicolas Geoffray | 58035ae | 2015-05-27 19:10:27 +0100 | [diff] [blame] | 493 | $$(gtest_exe) \ |
| 494 | $$(ART_GTEST_$(1)_HOST_DEPS) \ |
| 495 | $(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] | 496 | |
Nicolas Geoffray | 58035ae | 2015-05-27 19:10:27 +0100 | [diff] [blame] | 497 | ART_TEST_HOST_GTEST_DEPENDENCIES += $$(gtest_deps) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 498 | |
| 499 | .PHONY: $$(gtest_rule) |
Nicolas Geoffray | 0f7c06d | 2015-05-28 10:21:03 +0100 | [diff] [blame] | 500 | $$(gtest_rule): $$(gtest_exe) $$(gtest_deps) |
Dmitriy Ivanov | 8508a43 | 2014-10-14 11:38:46 -0700 | [diff] [blame] | 501 | $(hide) ($$(call ART_TEST_SKIP,$$@) && $$< && $$(call ART_TEST_PASSED,$$@)) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 502 | || $$(call ART_TEST_FAILED,$$@) |
| 503 | |
| 504 | ART_TEST_HOST_GTEST$$($(2)ART_PHONY_TEST_HOST_SUFFIX)_RULES += $$(gtest_rule) |
| 505 | ART_TEST_HOST_GTEST_RULES += $$(gtest_rule) |
| 506 | ART_TEST_HOST_GTEST_$(1)_RULES += $$(gtest_rule) |
| 507 | |
Andreas Gampe | 3c0bb31 | 2015-02-19 10:02:19 -0800 | [diff] [blame] | 508 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 509 | .PHONY: valgrind-$$(gtest_rule) |
Andreas Gampe | 3db3600 | 2015-05-28 20:17:09 -0700 | [diff] [blame] | 510 | valgrind-$$(gtest_rule): $$(gtest_exe) $$(gtest_deps) $(ART_VALGRIND_DEPENDENCIES) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 511 | $(hide) $$(call ART_TEST_SKIP,$$@) && \ |
Andreas Gampe | 8df91ac | 2015-02-20 13:15:15 -0800 | [diff] [blame] | 512 | VALGRIND_LIB=$(HOST_OUT)/lib64/valgrind \ |
Andreas Gampe | 3c0bb31 | 2015-02-19 10:02:19 -0800 | [diff] [blame] | 513 | $(HOST_OUT_EXECUTABLES)/valgrind --leak-check=full --error-exitcode=1 $$< && \ |
| 514 | $$(call ART_TEST_PASSED,$$@) || $$(call ART_TEST_FAILED,$$@) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 515 | |
| 516 | ART_TEST_HOST_VALGRIND_GTEST$$($(2)ART_PHONY_TEST_HOST_SUFFIX)_RULES += valgrind-$$(gtest_rule) |
| 517 | ART_TEST_HOST_VALGRIND_GTEST_RULES += valgrind-$$(gtest_rule) |
| 518 | ART_TEST_HOST_VALGRIND_GTEST_$(1)_RULES += valgrind-$$(gtest_rule) |
| 519 | |
| 520 | # Clear locally defined variables. |
| 521 | valgrind_gtest_rule := |
| 522 | gtest_rule := |
| 523 | gtest_exe := |
Ian Rogers | 665de8a | 2014-06-24 21:34:09 -0700 | [diff] [blame] | 524 | gtest_deps := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 525 | endef # define-art-gtest-rule-host |
| 526 | |
| 527 | # Define the rules to build and run host and target gtests. |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 528 | # $(1): target or host |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 529 | # $(2): file name |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 530 | # $(3): extra C includes |
| 531 | # $(4): extra shared libraries |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 532 | define define-art-gtest |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 533 | ifneq ($(1),target) |
| 534 | ifneq ($(1),host) |
| 535 | $$(error expected target or host for argument 1, received $(1)) |
| 536 | endif |
| 537 | endif |
| 538 | |
| 539 | art_target_or_host := $(1) |
| 540 | art_gtest_filename := $(2) |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 541 | art_gtest_extra_c_includes := $(3) |
| 542 | art_gtest_extra_shared_libraries := $(4) |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 543 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 544 | include $$(CLEAR_VARS) |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 545 | art_gtest_name := $$(notdir $$(basename $$(art_gtest_filename))) |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 546 | LOCAL_MODULE := $$(art_gtest_name) |
Brian Carlstrom | 871599a | 2012-09-06 13:27:49 -0700 | [diff] [blame] | 547 | ifeq ($$(art_target_or_host),target) |
| 548 | LOCAL_MODULE_TAGS := tests |
| 549 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 550 | LOCAL_CPP_EXTENSION := $$(ART_CPP_EXTENSION) |
Dmitriy Ivanov | e49a4f6 | 2014-10-20 14:11:00 -0700 | [diff] [blame] | 551 | LOCAL_SRC_FILES := $$(art_gtest_filename) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 552 | LOCAL_C_INCLUDES += $$(ART_C_INCLUDES) art/runtime $$(art_gtest_extra_c_includes) |
Andreas Gampe | 0ae3bf8 | 2015-05-20 16:09:36 -0700 | [diff] [blame] | 553 | LOCAL_SHARED_LIBRARIES += libartd $$(art_gtest_extra_shared_libraries) libart-gtest libartd-disassembler |
Dmitriy Ivanov | e49a4f6 | 2014-10-20 14:11:00 -0700 | [diff] [blame] | 554 | LOCAL_WHOLE_STATIC_LIBRARIES += libsigchain |
Brian Carlstrom | 4478eb0 | 2013-07-14 21:05:57 -0700 | [diff] [blame] | 555 | |
Ian Rogers | e63db27 | 2014-07-15 15:36:11 -0700 | [diff] [blame] | 556 | LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk |
| 557 | LOCAL_ADDITIONAL_DEPENDENCIES += art/build/Android.gtest.mk |
Brian Carlstrom | b9cc1ca | 2012-01-27 00:57:42 -0800 | [diff] [blame] | 558 | |
Elliott Hughes | 0f09676 | 2012-01-31 10:32:46 -0800 | [diff] [blame] | 559 | # Mac OS linker doesn't understand --export-dynamic. |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 560 | ifneq ($$(HOST_OS)-$$(art_target_or_host),darwin-host) |
Elliott Hughes | b264f08 | 2012-04-06 17:10:10 -0700 | [diff] [blame] | 561 | # Allow jni_compiler_test to find Java_MyClassNatives_bar within itself using dlopen(NULL, ...). |
| 562 | LOCAL_LDFLAGS := -Wl,--export-dynamic -Wl,-u,Java_MyClassNatives_bar -Wl,-u,Java_MyClassNatives_sbar |
Brian Carlstrom | cfede66 | 2012-01-29 17:25:54 -0800 | [diff] [blame] | 563 | endif |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 564 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 565 | LOCAL_CFLAGS := $$(ART_TEST_CFLAGS) |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 566 | ifeq ($$(art_target_or_host),target) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 567 | $$(eval $$(call set-target-local-clang-vars)) |
| 568 | $$(eval $$(call set-target-local-cflags-vars,debug)) |
Serban Constantinescu | 32f5b4d | 2014-11-25 20:05:46 +0000 | [diff] [blame] | 569 | LOCAL_SHARED_LIBRARIES += libdl libicuuc libicui18n libnativehelper libz libcutils libvixld |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 570 | LOCAL_MODULE_PATH_32 := $$(ART_TARGET_NATIVETEST_OUT)/$$(ART_TARGET_ARCH_32) |
| 571 | LOCAL_MODULE_PATH_64 := $$(ART_TARGET_NATIVETEST_OUT)/$$(ART_TARGET_ARCH_64) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 572 | LOCAL_MULTILIB := both |
Andreas Gampe | 9b14dc3 | 2015-04-06 15:35:02 -0700 | [diff] [blame] | 573 | LOCAL_CLANG_CFLAGS += -Wno-used-but-marked-unused -Wno-deprecated -Wno-missing-noreturn # gtest issue |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 574 | include $$(BUILD_EXECUTABLE) |
Nicolas Geoffray | 9eb4074 | 2014-10-29 22:38:53 +0000 | [diff] [blame] | 575 | library_path := |
| 576 | 2nd_library_path := |
| 577 | ifneq ($$(ART_TEST_ANDROID_ROOT),) |
| 578 | ifdef TARGET_2ND_ARCH |
| 579 | 2nd_library_path := $$(ART_TEST_ANDROID_ROOT)/lib |
| 580 | library_path := $$(ART_TEST_ANDROID_ROOT)/lib64 |
| 581 | else |
Nicolas Geoffray | c1dea4a | 2014-11-10 08:33:52 +0000 | [diff] [blame] | 582 | ifneq ($(filter %64,$(TARGET_ARCH)),) |
| 583 | library_path := $$(ART_TEST_ANDROID_ROOT)/lib64 |
| 584 | else |
| 585 | library_path := $$(ART_TEST_ANDROID_ROOT)/lib |
| 586 | endif |
Nicolas Geoffray | 9eb4074 | 2014-10-29 22:38:53 +0000 | [diff] [blame] | 587 | endif |
| 588 | endif |
Andreas Gampe | 5ca4eaa | 2014-05-29 02:09:33 -0700 | [diff] [blame] | 589 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 590 | ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES := |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 591 | ifdef TARGET_2ND_ARCH |
Nicolas Geoffray | 9eb4074 | 2014-10-29 22:38:53 +0000 | [diff] [blame] | 592 | $$(eval $$(call define-art-gtest-rule-target,$$(art_gtest_name),2ND_,$$(2nd_library_path))) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 593 | endif |
Nicolas Geoffray | 9eb4074 | 2014-10-29 22:38:53 +0000 | [diff] [blame] | 594 | $$(eval $$(call define-art-gtest-rule-target,$$(art_gtest_name),,$$(library_path))) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 595 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 596 | # A rule to run the different architecture versions of the gtest. |
| 597 | .PHONY: test-art-target-gtest-$$(art_gtest_name) |
| 598 | test-art-target-gtest-$$(art_gtest_name): $$(ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES) |
| 599 | $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
| 600 | |
| 601 | # Clear locally defined variables. |
| 602 | ART_TEST_TARGET_GTEST_$$(art_gtest_name)_RULES := |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 603 | else # host |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 604 | LOCAL_CLANG := $$(ART_HOST_CLANG) |
| 605 | LOCAL_CFLAGS += $$(ART_HOST_CFLAGS) $$(ART_HOST_DEBUG_CFLAGS) |
Roland Levillain | 12bd721 | 2015-06-04 17:50:27 +0100 | [diff] [blame] | 606 | LOCAL_ASFLAGS += $$(ART_HOST_ASFLAGS) |
Serban Constantinescu | 32f5b4d | 2014-11-25 20:05:46 +0000 | [diff] [blame] | 607 | LOCAL_SHARED_LIBRARIES += libicuuc-host libicui18n-host libnativehelper libziparchive-host libz-host libvixld |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 608 | LOCAL_LDLIBS := $(ART_HOST_LDLIBS) -lpthread -ldl |
Ian Rogers | bd5ea6a | 2014-04-16 16:34:44 -0700 | [diff] [blame] | 609 | LOCAL_IS_HOST_MODULE := true |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 610 | LOCAL_MULTILIB := both |
| 611 | LOCAL_MODULE_STEM_32 := $$(art_gtest_name)32 |
| 612 | LOCAL_MODULE_STEM_64 := $$(art_gtest_name)64 |
Andreas Gampe | 9b14dc3 | 2015-04-06 15:35:02 -0700 | [diff] [blame] | 613 | LOCAL_CLANG_CFLAGS += -Wno-used-but-marked-unused -Wno-deprecated -Wno-missing-noreturn # gtest issue |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 614 | include $$(BUILD_HOST_EXECUTABLE) |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 615 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 616 | ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES := |
| 617 | ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES := |
| 618 | ifneq ($$(HOST_PREFER_32_BIT),true) |
| 619 | $$(eval $$(call define-art-gtest-rule-host,$$(art_gtest_name),2ND_)) |
| 620 | endif |
| 621 | $$(eval $$(call define-art-gtest-rule-host,$$(art_gtest_name),)) |
Ian Rogers | d912e5c | 2013-11-13 12:40:11 -0800 | [diff] [blame] | 622 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 623 | # Rules to run the different architecture versions of the gtest. |
| 624 | .PHONY: test-art-host-gtest-$$(art_gtest_name) |
| 625 | test-art-host-gtest-$$(art_gtest_name): $$(ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES) |
| 626 | $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
Ian Rogers | d912e5c | 2013-11-13 12:40:11 -0800 | [diff] [blame] | 627 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 628 | .PHONY: valgrind-test-art-host-gtest-$$(art_gtest_name) |
| 629 | valgrind-test-art-host-gtest-$$(art_gtest_name): $$(ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES) |
| 630 | $$(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
| 631 | |
| 632 | # Clear locally defined variables. |
| 633 | ART_TEST_HOST_GTEST_$$(art_gtest_name)_RULES := |
| 634 | ART_TEST_HOST_VALGRIND_GTEST_$$(art_gtest_name)_RULES := |
| 635 | endif # host_or_target |
| 636 | |
| 637 | # Clear locally defined variables. |
| 638 | art_target_or_host := |
| 639 | art_gtest_filename := |
| 640 | art_gtest_extra_c_includes := |
| 641 | art_gtest_extra_shared_libraries := |
| 642 | art_gtest_name := |
Nicolas Geoffray | 96a37c8 | 2014-10-29 23:50:40 +0000 | [diff] [blame] | 643 | library_path := |
| 644 | 2nd_library_path := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 645 | endef # define-art-gtest |
Carl Shapiro | 008e412 | 2011-06-23 17:27:46 -0700 | [diff] [blame] | 646 | |
Alex Light | 50fa993 | 2015-08-10 15:30:07 -0700 | [diff] [blame] | 647 | |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 648 | ifeq ($(ART_BUILD_TARGET),true) |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 649 | $(foreach file,$(RUNTIME_GTEST_TARGET_SRC_FILES), $(eval $(call define-art-gtest,target,$(file),,libbacktrace))) |
| 650 | $(foreach file,$(COMPILER_GTEST_TARGET_SRC_FILES), $(eval $(call define-art-gtest,target,$(file),art/compiler,libartd-compiler libbacktrace))) |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 651 | endif |
Ian Rogers | c5f1773 | 2014-06-05 20:48:42 -0700 | [diff] [blame] | 652 | ifeq ($(ART_BUILD_HOST),true) |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 653 | $(foreach file,$(RUNTIME_GTEST_HOST_SRC_FILES), $(eval $(call define-art-gtest,host,$(file),,libbacktrace))) |
| 654 | $(foreach file,$(COMPILER_GTEST_HOST_SRC_FILES), $(eval $(call define-art-gtest,host,$(file),art/compiler,libartd-compiler libbacktrace))) |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 655 | endif |
Tsu Chiang Chuang | ec245a4 | 2014-05-15 21:16:21 -0700 | [diff] [blame] | 656 | |
| 657 | # Used outside the art project to get a list of the current tests |
| 658 | RUNTIME_TARGET_GTEST_MAKE_TARGETS := |
| 659 | $(foreach file, $(RUNTIME_GTEST_TARGET_SRC_FILES), $(eval RUNTIME_TARGET_GTEST_MAKE_TARGETS += $$(notdir $$(basename $$(file))))) |
| 660 | COMPILER_TARGET_GTEST_MAKE_TARGETS := |
| 661 | $(foreach file, $(COMPILER_GTEST_TARGET_SRC_FILES), $(eval COMPILER_TARGET_GTEST_MAKE_TARGETS += $$(notdir $$(basename $$(file))))) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 662 | |
| 663 | # Define all the combinations of host/target, valgrind and suffix such as: |
| 664 | # test-art-host-gtest or valgrind-test-art-host-gtest64 |
| 665 | # $(1): host or target |
| 666 | # $(2): HOST or TARGET |
| 667 | # $(3): valgrind- or undefined |
| 668 | # $(4): undefined, 32 or 64 |
| 669 | define define-test-art-gtest-combination |
| 670 | ifeq ($(1),host) |
| 671 | ifneq ($(2),HOST) |
| 672 | $$(error argument mismatch $(1) and ($2)) |
| 673 | endif |
| 674 | else |
| 675 | ifneq ($(1),target) |
| 676 | $$(error found $(1) expected host or target) |
| 677 | endif |
| 678 | ifneq ($(2),TARGET) |
| 679 | $$(error argument mismatch $(1) and ($2)) |
| 680 | endif |
| 681 | endif |
| 682 | |
| 683 | rule_name := $(3)test-art-$(1)-gtest$(4) |
Andreas Gampe | 928f72b | 2014-09-09 19:53:48 -0700 | [diff] [blame] | 684 | ifeq ($(3),valgrind-) |
| 685 | ifneq ($(1),host) |
| 686 | $$(error valgrind tests only wired up for the host) |
| 687 | endif |
| 688 | dependencies := $$(ART_TEST_$(2)_VALGRIND_GTEST$(4)_RULES) |
| 689 | else |
| 690 | dependencies := $$(ART_TEST_$(2)_GTEST$(4)_RULES) |
| 691 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 692 | |
| 693 | .PHONY: $$(rule_name) |
| 694 | $$(rule_name): $$(dependencies) |
| 695 | $(hide) $$(call ART_TEST_PREREQ_FINISHED,$$@) |
| 696 | |
| 697 | # Clear locally defined variables. |
| 698 | rule_name := |
| 699 | dependencies := |
| 700 | endef # define-test-art-gtest-combination |
| 701 | |
| 702 | $(eval $(call define-test-art-gtest-combination,target,TARGET,,)) |
| 703 | $(eval $(call define-test-art-gtest-combination,target,TARGET,,$(ART_PHONY_TEST_TARGET_SUFFIX))) |
| 704 | ifdef TARGET_2ND_ARCH |
| 705 | $(eval $(call define-test-art-gtest-combination,target,TARGET,,$(2ND_ART_PHONY_TEST_TARGET_SUFFIX))) |
| 706 | endif |
| 707 | $(eval $(call define-test-art-gtest-combination,host,HOST,,)) |
| 708 | $(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,)) |
| 709 | $(eval $(call define-test-art-gtest-combination,host,HOST,,$(ART_PHONY_TEST_HOST_SUFFIX))) |
| 710 | $(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,$(ART_PHONY_TEST_HOST_SUFFIX))) |
| 711 | ifneq ($(HOST_PREFER_32_BIT),true) |
| 712 | $(eval $(call define-test-art-gtest-combination,host,HOST,,$(2ND_ART_PHONY_TEST_HOST_SUFFIX))) |
| 713 | $(eval $(call define-test-art-gtest-combination,host,HOST,valgrind-,$(2ND_ART_PHONY_TEST_HOST_SUFFIX))) |
| 714 | endif |
| 715 | |
| 716 | # Clear locally defined variables. |
| 717 | define-art-gtest-rule-target := |
| 718 | define-art-gtest-rule-host := |
| 719 | define-art-gtest := |
| 720 | define-test-art-gtest-combination := |
| 721 | RUNTIME_GTEST_COMMON_SRC_FILES := |
| 722 | COMPILER_GTEST_COMMON_SRC_FILES := |
| 723 | RUNTIME_GTEST_TARGET_SRC_FILES := |
| 724 | RUNTIME_GTEST_HOST_SRC_FILES := |
| 725 | COMPILER_GTEST_TARGET_SRC_FILES := |
| 726 | COMPILER_GTEST_HOST_SRC_FILES := |
| 727 | ART_TEST_CFLAGS := |
| 728 | ART_TEST_HOST_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 729 | ART_TEST_HOST_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 730 | ART_TEST_HOST_GTEST_RULES := |
| 731 | ART_TEST_HOST_VALGRIND_GTEST$(ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 732 | ART_TEST_HOST_VALGRIND_GTEST$(2ND_ART_PHONY_TEST_HOST_SUFFIX)_RULES := |
| 733 | ART_TEST_HOST_VALGRIND_GTEST_RULES := |
| 734 | ART_TEST_TARGET_GTEST$(ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 735 | ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := |
| 736 | ART_TEST_TARGET_GTEST_RULES := |
Nicolas Geoffray | 96a37c8 | 2014-10-29 23:50:40 +0000 | [diff] [blame] | 737 | ART_GTEST_TARGET_ANDROID_ROOT := |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 738 | ART_GTEST_class_linker_test_DEX_DEPS := |
| 739 | ART_GTEST_compiler_driver_test_DEX_DEPS := |
| 740 | ART_GTEST_dex_file_test_DEX_DEPS := |
| 741 | ART_GTEST_exception_test_DEX_DEPS := |
| 742 | ART_GTEST_elf_writer_test_HOST_DEPS := |
| 743 | ART_GTEST_elf_writer_test_TARGET_DEPS := |
| 744 | ART_GTEST_jni_compiler_test_DEX_DEPS := |
| 745 | ART_GTEST_jni_internal_test_DEX_DEPS := |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 746 | ART_GTEST_oat_file_assistant_test_DEX_DEPS := |
| 747 | ART_GTEST_oat_file_assistant_test_HOST_DEPS := |
| 748 | ART_GTEST_oat_file_assistant_test_TARGET_DEPS := |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 749 | ART_GTEST_object_test_DEX_DEPS := |
| 750 | ART_GTEST_proxy_test_DEX_DEPS := |
Igor Murashkin | 457e874 | 2015-10-22 17:37:50 -0700 | [diff] [blame] | 751 | ART_GTEST_lambda_proxy_test_DEX_DEPS := |
Brian Carlstrom | eb85f2b | 2014-06-25 13:23:00 -0700 | [diff] [blame] | 752 | ART_GTEST_reflection_test_DEX_DEPS := |
| 753 | ART_GTEST_stub_test_DEX_DEPS := |
| 754 | ART_GTEST_transaction_test_DEX_DEPS := |
Andreas Gampe | 3c0bb31 | 2015-02-19 10:02:19 -0800 | [diff] [blame] | 755 | ART_VALGRIND_DEPENDENCIES := |
Ian Rogers | 1a2f84e | 2014-07-07 16:05:18 -0700 | [diff] [blame] | 756 | $(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_TARGET_GTEST_$(dir)_DEX :=)) |
| 757 | $(foreach dir,$(GTEST_DEX_DIRECTORIES), $(eval ART_TEST_HOST_GTEST_$(dir)_DEX :=)) |
Richard Uhler | 66d874d | 2015-01-15 09:37:19 -0800 | [diff] [blame] | 758 | ART_TEST_HOST_GTEST_MainStripped_DEX := |
| 759 | ART_TEST_TARGET_GTEST_MainStripped_DEX := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 760 | GTEST_DEX_DIRECTORIES := |
Brian Carlstrom | 532714a | 2014-06-25 02:15:31 -0700 | [diff] [blame] | 761 | LOCAL_PATH := |