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