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 | |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 17 | LOCAL_PATH := art |
| 18 | |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 19 | RUNTIME_GTEST_COMMON_SRC_FILES := \ |
Andreas Gampe | 5c1e435 | 2014-04-21 19:28:24 -0700 | [diff] [blame] | 20 | runtime/arch/arch_test.cc \ |
Andreas Gampe | 525cde2 | 2014-04-22 15:44:50 -0700 | [diff] [blame] | 21 | runtime/arch/stub_test.cc \ |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 22 | runtime/barrier_test.cc \ |
Nicolas Geoffray | 01bc96d | 2014-04-11 17:43:50 +0100 | [diff] [blame] | 23 | runtime/base/bit_field_test.cc \ |
Brian Carlstrom | ba150c3 | 2013-08-27 17:31:03 -0700 | [diff] [blame] | 24 | runtime/base/bit_vector_test.cc \ |
Ian Rogers | 43b2e0f | 2014-01-30 16:58:39 -0800 | [diff] [blame] | 25 | runtime/base/hex_dump_test.cc \ |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 26 | runtime/base/histogram_test.cc \ |
| 27 | runtime/base/mutex_test.cc \ |
Narayan Kamath | d1c606f | 2014-06-09 16:50:19 +0100 | [diff] [blame] | 28 | runtime/base/scoped_flock_test.cc \ |
Anwar Ghuloum | 4446ab9 | 2013-08-09 21:17:25 -0700 | [diff] [blame] | 29 | runtime/base/timing_logger_test.cc \ |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 30 | runtime/base/unix_file/fd_file_test.cc \ |
| 31 | runtime/base/unix_file/mapped_file_test.cc \ |
| 32 | runtime/base/unix_file/null_file_test.cc \ |
| 33 | runtime/base/unix_file/random_access_file_utils_test.cc \ |
| 34 | runtime/base/unix_file/string_file_test.cc \ |
| 35 | runtime/class_linker_test.cc \ |
| 36 | runtime/dex_file_test.cc \ |
Andreas Gampe | df10b32 | 2014-06-11 21:46:05 -0700 | [diff] [blame] | 37 | runtime/dex_file_verifier_test.cc \ |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 38 | runtime/dex_instruction_visitor_test.cc \ |
| 39 | runtime/dex_method_iterator_test.cc \ |
Ian Rogers | 7655f29 | 2013-07-29 11:07:13 -0700 | [diff] [blame] | 40 | runtime/entrypoints/math_entrypoints_test.cc \ |
Alexei Zavjalov | 41c507a | 2014-05-15 16:02:46 +0700 | [diff] [blame] | 41 | runtime/entrypoints/quick/quick_trampoline_entrypoints_test.cc \ |
Andreas Gampe | 4352b45 | 2014-06-04 18:59:01 -0700 | [diff] [blame] | 42 | runtime/entrypoints_order_test.cc \ |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 43 | runtime/exception_test.cc \ |
| 44 | runtime/gc/accounting/space_bitmap_test.cc \ |
| 45 | runtime/gc/heap_test.cc \ |
Andreas Gampe | 24651ec | 2014-02-27 13:26:16 -0800 | [diff] [blame] | 46 | runtime/gc/space/dlmalloc_space_base_test.cc \ |
| 47 | runtime/gc/space/dlmalloc_space_static_test.cc \ |
| 48 | runtime/gc/space/dlmalloc_space_random_test.cc \ |
| 49 | runtime/gc/space/rosalloc_space_base_test.cc \ |
| 50 | runtime/gc/space/rosalloc_space_static_test.cc \ |
| 51 | runtime/gc/space/rosalloc_space_random_test.cc \ |
Andreas Gampe | a743351 | 2014-02-21 13:19:23 -0800 | [diff] [blame] | 52 | runtime/gc/space/large_object_space_test.cc \ |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 53 | runtime/gtest_test.cc \ |
Mathieu Chartier | eb8167a | 2014-05-07 15:43:14 -0700 | [diff] [blame] | 54 | runtime/handle_scope_test.cc \ |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 55 | runtime/indenter_test.cc \ |
| 56 | runtime/indirect_reference_table_test.cc \ |
Narayan Kamath | 11d9f06 | 2014-04-23 20:24:57 +0100 | [diff] [blame] | 57 | runtime/instruction_set_test.cc \ |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 58 | runtime/intern_table_test.cc \ |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 59 | runtime/leb128_test.cc \ |
Brian Carlstrom | 9004cb6 | 2013-07-26 15:48:31 -0700 | [diff] [blame] | 60 | runtime/mem_map_test.cc \ |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 61 | runtime/mirror/dex_cache_test.cc \ |
| 62 | runtime/mirror/object_test.cc \ |
Brian Carlstrom | 491ca9e | 2014-03-02 18:24:38 -0800 | [diff] [blame] | 63 | runtime/parsed_options_test.cc \ |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 64 | runtime/reference_table_test.cc \ |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 65 | runtime/thread_pool_test.cc \ |
Sebastien Hertz | d2fe10a | 2014-01-15 10:20:56 +0100 | [diff] [blame] | 66 | runtime/transaction_test.cc \ |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 67 | runtime/utils_test.cc \ |
| 68 | runtime/verifier/method_verifier_test.cc \ |
| 69 | runtime/verifier/reg_type_test.cc \ |
Mathieu Chartier | eb8167a | 2014-05-07 15:43:14 -0700 | [diff] [blame] | 70 | runtime/zip_archive_test.cc |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 71 | |
| 72 | COMPILER_GTEST_COMMON_SRC_FILES := \ |
| 73 | runtime/jni_internal_test.cc \ |
Sebastien Hertz | b7054ba | 2014-03-13 11:52:31 +0100 | [diff] [blame] | 74 | runtime/proxy_test.cc \ |
Ian Rogers | 53b8b09 | 2014-03-13 23:45:53 -0700 | [diff] [blame] | 75 | runtime/reflection_test.cc \ |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 76 | compiler/dex/local_value_numbering_test.cc \ |
Vladimir Marko | bfea9c2 | 2014-01-17 17:49:33 +0000 | [diff] [blame] | 77 | compiler/dex/mir_optimization_test.cc \ |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 78 | compiler/driver/compiler_driver_test.cc \ |
| 79 | compiler/elf_writer_test.cc \ |
| 80 | compiler/image_test.cc \ |
| 81 | compiler/jni/jni_compiler_test.cc \ |
| 82 | compiler/oat_test.cc \ |
Nicolas Geoffray | d4dd255 | 2014-02-28 10:23:58 +0000 | [diff] [blame] | 83 | compiler/optimizing/codegen_test.cc \ |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 84 | compiler/optimizing/dominator_test.cc \ |
Nicolas Geoffray | 622d9c3 | 2014-05-12 16:11:02 +0100 | [diff] [blame] | 85 | compiler/optimizing/find_loops_test.cc \ |
Nicolas Geoffray | ec7e472 | 2014-06-06 11:24:33 +0100 | [diff] [blame] | 86 | compiler/optimizing/graph_test.cc \ |
Nicolas Geoffray | 0d3f578 | 2014-05-14 09:43:38 +0100 | [diff] [blame] | 87 | compiler/optimizing/linearize_test.cc \ |
Nicolas Geoffray | 804d093 | 2014-05-02 08:46:00 +0100 | [diff] [blame] | 88 | compiler/optimizing/liveness_test.cc \ |
Nicolas Geoffray | a7062e0 | 2014-05-22 12:50:17 +0100 | [diff] [blame] | 89 | compiler/optimizing/live_interval_test.cc \ |
Nicolas Geoffray | ddb311f | 2014-05-16 09:28:54 +0100 | [diff] [blame] | 90 | compiler/optimizing/live_ranges_test.cc \ |
Nicolas Geoffray | 4e3d23a | 2014-05-22 18:32:45 +0100 | [diff] [blame] | 91 | compiler/optimizing/parallel_move_test.cc \ |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 92 | compiler/optimizing/pretty_printer_test.cc \ |
Nicolas Geoffray | a7062e0 | 2014-05-22 12:50:17 +0100 | [diff] [blame] | 93 | compiler/optimizing/register_allocator_test.cc \ |
Nicolas Geoffray | c32e770 | 2014-04-24 12:43:16 +0100 | [diff] [blame] | 94 | compiler/optimizing/ssa_test.cc \ |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 95 | compiler/output_stream_test.cc \ |
| 96 | compiler/utils/arena_allocator_test.cc \ |
| 97 | compiler/utils/dedupe_set_test.cc \ |
| 98 | compiler/utils/arm/managed_register_arm_test.cc \ |
Serban Constantinescu | ed8dd49 | 2014-02-11 14:15:10 +0000 | [diff] [blame] | 99 | compiler/utils/arm64/managed_register_arm64_test.cc \ |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 100 | compiler/utils/x86/managed_register_x86_test.cc \ |
Brian Carlstrom | 51c2467 | 2013-07-11 16:00:56 -0700 | [diff] [blame] | 101 | |
Dragos Sbirlea | 8cc5162 | 2013-06-21 09:20:34 -0700 | [diff] [blame] | 102 | ifeq ($(ART_SEA_IR_MODE),true) |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 103 | COMPILER_GTEST_COMMON_SRC_FILES += \ |
Dragos Sbirlea | 423fb4d | 2013-08-05 18:33:30 -0700 | [diff] [blame] | 104 | compiler/utils/scoped_hashtable_test.cc \ |
| 105 | compiler/sea_ir/types/type_data_test.cc \ |
Dragos Sbirlea | 597e46b | 2013-08-07 18:15:44 -0700 | [diff] [blame] | 106 | compiler/sea_ir/types/type_inference_visitor_test.cc \ |
| 107 | compiler/sea_ir/ir/regions_test.cc |
Dragos Sbirlea | 8cc5162 | 2013-06-21 09:20:34 -0700 | [diff] [blame] | 108 | endif |
| 109 | |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 110 | RUNTIME_GTEST_TARGET_SRC_FILES := \ |
| 111 | $(RUNTIME_GTEST_COMMON_SRC_FILES) |
Brian Carlstrom | 51c2467 | 2013-07-11 16:00:56 -0700 | [diff] [blame] | 112 | |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 113 | RUNTIME_GTEST_HOST_SRC_FILES := \ |
| 114 | $(RUNTIME_GTEST_COMMON_SRC_FILES) |
| 115 | |
| 116 | COMPILER_GTEST_TARGET_SRC_FILES := \ |
| 117 | $(COMPILER_GTEST_COMMON_SRC_FILES) |
| 118 | |
| 119 | COMPILER_GTEST_HOST_SRC_FILES := \ |
| 120 | $(COMPILER_GTEST_COMMON_SRC_FILES) \ |
Andreas Gampe | 5a4fa82 | 2014-03-31 16:50:12 -0700 | [diff] [blame] | 121 | compiler/utils/x86/assembler_x86_test.cc \ |
| 122 | compiler/utils/x86_64/assembler_x86_64_test.cc |
Brian Carlstrom | 51c2467 | 2013-07-11 16:00:56 -0700 | [diff] [blame] | 123 | |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 124 | ART_HOST_GTEST_EXECUTABLES := |
Andreas Gampe | 2fe0792 | 2014-04-21 07:50:39 -0700 | [diff] [blame] | 125 | ART_TARGET_GTEST_EXECUTABLES$(ART_PHONY_TEST_TARGET_SUFFIX) := |
| 126 | ART_TARGET_GTEST_EXECUTABLES$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) := |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 127 | ART_HOST_GTEST_TARGETS := |
| 128 | ART_HOST_VALGRIND_GTEST_TARGETS := |
Andreas Gampe | 2fe0792 | 2014-04-21 07:50:39 -0700 | [diff] [blame] | 129 | ART_TARGET_GTEST_TARGETS$(ART_PHONY_TEST_TARGET_SUFFIX) := |
| 130 | ART_TARGET_GTEST_TARGETS$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) := |
Brian Carlstrom | 8ecd08c | 2011-07-27 17:50:51 -0700 | [diff] [blame] | 131 | |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 132 | ART_TEST_CFLAGS := |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 133 | ifeq ($(ART_USE_PORTABLE_COMPILER),true) |
| 134 | ART_TEST_CFLAGS += -DART_USE_PORTABLE_COMPILER=1 |
buzbee | 2cfc639 | 2012-05-07 14:51:40 -0700 | [diff] [blame] | 135 | endif |
| 136 | |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 137 | # Build a make target for a target test. |
| 138 | # (1) Prefix for variables |
| 139 | define build-art-test-make-target |
| 140 | .PHONY: $$(art_gtest_target)$($(1)ART_PHONY_TEST_TARGET_SUFFIX) |
Brian Carlstrom | 0e12bdc | 2014-05-14 17:44:28 -0700 | [diff] [blame] | 141 | $$(art_gtest_target)$($(1)ART_PHONY_TEST_TARGET_SUFFIX): $(ART_NATIVETEST_OUT)/$(TARGET_$(1)ARCH)/$$(LOCAL_MODULE) test-art-target-sync |
| 142 | adb shell touch $(ART_TEST_DIR)/$(TARGET_$(1)ARCH)/$$@ |
| 143 | adb shell rm $(ART_TEST_DIR)/$(TARGET_$(1)ARCH)/$$@ |
| 144 | adb shell chmod 755 $(ART_NATIVETEST_DIR)/$(TARGET_$(1)ARCH)/$$(notdir $$<) |
| 145 | adb shell sh -c "$(ART_NATIVETEST_DIR)/$(TARGET_$(1)ARCH)/$$(notdir $$<) && touch $(ART_TEST_DIR)/$(TARGET_$(1)ARCH)/$$@" |
| 146 | $(hide) (adb pull $(ART_TEST_DIR)/$(TARGET_$(1)ARCH)/$$@ /tmp/ && echo $$@ PASSED) || (echo $$@ FAILED && exit 1) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 147 | $(hide) rm /tmp/$$@ |
| 148 | |
Andreas Gampe | 2fe0792 | 2014-04-21 07:50:39 -0700 | [diff] [blame] | 149 | ART_TARGET_GTEST_TARGETS$($(1)ART_PHONY_TEST_TARGET_SUFFIX) += $$(art_gtest_target)$($(1)ART_PHONY_TEST_TARGET_SUFFIX) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 150 | endef |
| 151 | |
| 152 | |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 153 | # $(1): target or host |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 154 | # $(2): file name |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 155 | # $(3): extra C includes |
| 156 | # $(4): extra shared libraries |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 157 | define build-art-test |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 158 | ifneq ($(1),target) |
| 159 | ifneq ($(1),host) |
| 160 | $$(error expected target or host for argument 1, received $(1)) |
| 161 | endif |
| 162 | endif |
| 163 | |
| 164 | art_target_or_host := $(1) |
| 165 | art_gtest_filename := $(2) |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 166 | art_gtest_extra_c_includes := $(3) |
| 167 | art_gtest_extra_shared_libraries := $(4) |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 168 | |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 169 | art_gtest_name := $$(notdir $$(basename $$(art_gtest_filename))) |
| 170 | |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 171 | include $(CLEAR_VARS) |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 172 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 173 | LOCAL_MODULE := $$(art_gtest_name) |
Brian Carlstrom | 871599a | 2012-09-06 13:27:49 -0700 | [diff] [blame] | 174 | ifeq ($$(art_target_or_host),target) |
| 175 | LOCAL_MODULE_TAGS := tests |
| 176 | endif |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 177 | LOCAL_SRC_FILES := $$(art_gtest_filename) runtime/common_runtime_test.cc |
| 178 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime $(3) |
| 179 | LOCAL_SHARED_LIBRARIES += libartd $(4) |
| 180 | # dex2oatd is needed to go with libartd |
Elliott Hughes | 025218c | 2013-07-30 17:13:06 -0700 | [diff] [blame] | 181 | LOCAL_REQUIRED_MODULES := dex2oatd |
Brian Carlstrom | 4478eb0 | 2013-07-14 21:05:57 -0700 | [diff] [blame] | 182 | |
Brian Carlstrom | 17bfe26 | 2013-07-16 17:31:22 -0700 | [diff] [blame] | 183 | LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common.mk |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 184 | LOCAL_ADDITIONAL_DEPENDENCIES += art/build/Android.gtest.mk |
Brian Carlstrom | b9cc1ca | 2012-01-27 00:57:42 -0800 | [diff] [blame] | 185 | |
Elliott Hughes | 0f09676 | 2012-01-31 10:32:46 -0800 | [diff] [blame] | 186 | # Mac OS linker doesn't understand --export-dynamic. |
| 187 | ifneq ($(HOST_OS)-$$(art_target_or_host),darwin-host) |
Elliott Hughes | b264f08 | 2012-04-06 17:10:10 -0700 | [diff] [blame] | 188 | # Allow jni_compiler_test to find Java_MyClassNatives_bar within itself using dlopen(NULL, ...). |
| 189 | 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] | 190 | endif |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 191 | |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 192 | LOCAL_CFLAGS := $(ART_TEST_CFLAGS) |
Dan Albert | 2a0e954 | 2014-05-21 14:55:02 -0700 | [diff] [blame] | 193 | include external/libcxx/libcxx.mk |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 194 | ifeq ($$(art_target_or_host),target) |
Andreas Gampe | 5ca4eaa | 2014-05-29 02:09:33 -0700 | [diff] [blame] | 195 | $(call set-target-local-clang-vars) |
| 196 | $(call set-target-local-cflags-vars,debug) |
Serban Constantinescu | 1552373 | 2014-04-02 13:18:05 +0100 | [diff] [blame] | 197 | LOCAL_SHARED_LIBRARIES += libdl libicuuc libicui18n libnativehelper libz libcutils libvixl |
Ian Rogers | ba0c51f | 2014-05-16 12:26:00 -0700 | [diff] [blame] | 198 | LOCAL_STATIC_LIBRARIES += libgtest_libc++ |
Brian Carlstrom | 0e12bdc | 2014-05-14 17:44:28 -0700 | [diff] [blame] | 199 | LOCAL_MODULE_PATH_32 := $(ART_NATIVETEST_OUT)/$(ART_TARGET_ARCH_32) |
| 200 | LOCAL_MODULE_PATH_64 := $(ART_NATIVETEST_OUT)/$(ART_TARGET_ARCH_64) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 201 | LOCAL_MULTILIB := both |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 202 | include $(BUILD_EXECUTABLE) |
Andreas Gampe | 5ca4eaa | 2014-05-29 02:09:33 -0700 | [diff] [blame] | 203 | |
Brian Carlstrom | 0e12bdc | 2014-05-14 17:44:28 -0700 | [diff] [blame] | 204 | ART_TARGET_GTEST_EXECUTABLES$(ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_NATIVETEST_OUT)/$(TARGET_ARCH)/$$(LOCAL_MODULE) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 205 | art_gtest_target := test-art-$$(art_target_or_host)-gtest-$$(art_gtest_name) |
| 206 | |
| 207 | ifdef TARGET_2ND_ARCH |
| 208 | $(call build-art-test-make-target,2ND_) |
| 209 | |
Brian Carlstrom | 0e12bdc | 2014-05-14 17:44:28 -0700 | [diff] [blame] | 210 | ART_TARGET_GTEST_EXECUTABLES$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_NATIVETEST_OUT)/$(TARGET_2ND_ARCH)/$$(LOCAL_MODULE) |
Andreas Gampe | 2fe0792 | 2014-04-21 07:50:39 -0700 | [diff] [blame] | 211 | |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 212 | # Bind the primary to the non-suffix rule |
| 213 | ifneq ($(ART_PHONY_TEST_TARGET_SUFFIX),) |
| 214 | $$(art_gtest_target): $$(art_gtest_target)$(ART_PHONY_TEST_TARGET_SUFFIX) |
| 215 | endif |
| 216 | endif |
| 217 | $(call build-art-test-make-target,) |
| 218 | |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 219 | else # host |
Ian Rogers | cd5d042 | 2013-05-17 15:54:01 -0700 | [diff] [blame] | 220 | LOCAL_CLANG := $(ART_HOST_CLANG) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 221 | LOCAL_CFLAGS += $(ART_HOST_CFLAGS) $(ART_HOST_DEBUG_CFLAGS) |
Elliott Hughes | 18c0753 | 2011-08-18 15:50:51 -0700 | [diff] [blame] | 222 | LOCAL_SHARED_LIBRARIES += libicuuc-host libicui18n-host libnativehelper libz-host |
Serban Constantinescu | 1552373 | 2014-04-02 13:18:05 +0100 | [diff] [blame] | 223 | LOCAL_STATIC_LIBRARIES += libcutils libvixl |
Brian Carlstrom | 7f2e3da | 2014-03-25 16:23:56 -0700 | [diff] [blame] | 224 | ifneq ($(WITHOUT_HOST_CLANG),true) |
| 225 | # GCC host compiled tests fail with this linked, presumably due to destructors that run. |
Dan Albert | 2a0e954 | 2014-05-21 14:55:02 -0700 | [diff] [blame] | 226 | LOCAL_STATIC_LIBRARIES += libgtest_libc++_host |
Brian Carlstrom | 7f2e3da | 2014-03-25 16:23:56 -0700 | [diff] [blame] | 227 | endif |
Andrew Hsieh | cae10f7 | 2014-04-01 11:52:01 +0800 | [diff] [blame] | 228 | LOCAL_LDLIBS += -lpthread -ldl |
Ian Rogers | bd5ea6a | 2014-04-16 16:34:44 -0700 | [diff] [blame] | 229 | LOCAL_IS_HOST_MODULE := true |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 230 | include $(BUILD_HOST_EXECUTABLE) |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 231 | art_gtest_exe := $(HOST_OUT_EXECUTABLES)/$$(LOCAL_MODULE) |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 232 | ART_HOST_GTEST_EXECUTABLES += $$(art_gtest_exe) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 233 | art_gtest_target := test-art-$$(art_target_or_host)-gtest-$$(art_gtest_name) |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 234 | .PHONY: $$(art_gtest_target) |
Brian Carlstrom | b0aa9d3 | 2012-04-07 23:12:22 -0700 | [diff] [blame] | 235 | $$(art_gtest_target): $$(art_gtest_exe) test-art-host-dependencies |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 236 | $$< |
| 237 | @echo $$@ PASSED |
| 238 | |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 239 | ART_HOST_GTEST_TARGETS += $$(art_gtest_target) |
Ian Rogers | d912e5c | 2013-11-13 12:40:11 -0800 | [diff] [blame] | 240 | |
| 241 | .PHONY: valgrind-$$(art_gtest_target) |
| 242 | valgrind-$$(art_gtest_target): $$(art_gtest_exe) test-art-host-dependencies |
Ian Rogers | 86aed2a | 2013-11-13 15:56:44 -0800 | [diff] [blame] | 243 | valgrind --leak-check=full --error-exitcode=1 $$< |
Ian Rogers | d912e5c | 2013-11-13 12:40:11 -0800 | [diff] [blame] | 244 | @echo $$@ PASSED |
| 245 | |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 246 | ART_HOST_VALGRIND_GTEST_TARGETS += valgrind-$$(art_gtest_target) |
| 247 | endif |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 248 | endef |
Carl Shapiro | 008e412 | 2011-06-23 17:27:46 -0700 | [diff] [blame] | 249 | |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 250 | ifeq ($(ART_BUILD_TARGET),true) |
Brian Carlstrom | a1ce1fe | 2014-02-24 23:23:58 -0800 | [diff] [blame] | 251 | $(foreach file,$(RUNTIME_GTEST_TARGET_SRC_FILES), $(eval $(call build-art-test,target,$(file),,))) |
| 252 | $(foreach file,$(COMPILER_GTEST_TARGET_SRC_FILES), $(eval $(call build-art-test,target,$(file),art/compiler,libartd-compiler))) |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 253 | endif |
Ian Rogers | c5f1773 | 2014-06-05 20:48:42 -0700 | [diff] [blame] | 254 | ifeq ($(ART_BUILD_HOST),true) |
| 255 | $(foreach file,$(RUNTIME_GTEST_HOST_SRC_FILES), $(eval $(call build-art-test,host,$(file),,))) |
| 256 | $(foreach file,$(COMPILER_GTEST_HOST_SRC_FILES), $(eval $(call build-art-test,host,$(file),art/compiler,libartd-compiler))) |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 257 | endif |
Tsu Chiang Chuang | ec245a4 | 2014-05-15 21:16:21 -0700 | [diff] [blame] | 258 | |
| 259 | # Used outside the art project to get a list of the current tests |
| 260 | RUNTIME_TARGET_GTEST_MAKE_TARGETS := |
| 261 | $(foreach file, $(RUNTIME_GTEST_TARGET_SRC_FILES), $(eval RUNTIME_TARGET_GTEST_MAKE_TARGETS += $$(notdir $$(basename $$(file))))) |
| 262 | COMPILER_TARGET_GTEST_MAKE_TARGETS := |
| 263 | $(foreach file, $(COMPILER_GTEST_TARGET_SRC_FILES), $(eval COMPILER_TARGET_GTEST_MAKE_TARGETS += $$(notdir $$(basename $$(file))))) |