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