Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2012 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. |
Benoit Goby | 5ac9eee | 2012-08-31 19:52:15 -0700 | [diff] [blame] | 15 | # |
| 16 | |
Elliott Hughes | e7c59f9 | 2013-12-17 20:47:06 -0800 | [diff] [blame] | 17 | ifneq ($(BUILD_TINY_ANDROID),true) |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 18 | |
| 19 | LOCAL_PATH := $(call my-dir) |
| 20 | |
Elliott Hughes | 7be369d | 2012-11-08 15:37:43 -0800 | [diff] [blame] | 21 | # ----------------------------------------------------------------------------- |
Elliott Hughes | 7be369d | 2012-11-08 15:37:43 -0800 | [diff] [blame] | 22 | # Unit tests. |
| 23 | # ----------------------------------------------------------------------------- |
| 24 | |
Elliott Hughes | ad88a08 | 2012-10-24 18:37:21 -0700 | [diff] [blame] | 25 | test_c_flags = \ |
Nick Kralevich | dcab1b2 | 2013-01-10 17:12:29 -0800 | [diff] [blame] | 26 | -fstack-protector-all \ |
Elliott Hughes | ad88a08 | 2012-10-24 18:37:21 -0700 | [diff] [blame] | 27 | -g \ |
| 28 | -Wall -Wextra \ |
| 29 | -Werror \ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 30 | -fno-builtin \ |
Elliott Hughes | ad88a08 | 2012-10-24 18:37:21 -0700 | [diff] [blame] | 31 | |
Serban Constantinescu | 282e232 | 2013-10-22 11:30:12 +0100 | [diff] [blame] | 32 | ifeq ($(TARGET_ARCH),aarch64) |
| 33 | $(info TODO: $(LOCAL_PATH)/Android.mk -fstack-protector not yet available for the AArch64 toolchain) |
| 34 | test_c_flags += -fno-stack-protector |
Serban Constantinescu | 282e232 | 2013-10-22 11:30:12 +0100 | [diff] [blame] | 35 | endif # aarch64 |
| 36 | |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 37 | test_src_files = \ |
Christopher Ferris | b687ad3 | 2013-11-06 17:32:11 -0800 | [diff] [blame] | 38 | buffer_tests.cpp \ |
Elliott Hughes | 063cfb2 | 2012-10-25 20:55:23 -0700 | [diff] [blame] | 39 | dirent_test.cpp \ |
Kito Cheng | 8baa929 | 2013-04-03 11:29:40 +0800 | [diff] [blame] | 40 | eventfd_test.cpp \ |
Elliott Hughes | 0620925 | 2013-11-06 16:20:54 -0800 | [diff] [blame] | 41 | fcntl_test.cpp \ |
Elliott Hughes | 90e10d4 | 2012-11-02 17:05:20 -0700 | [diff] [blame] | 42 | fenv_test.cpp \ |
Nick Kralevich | 2c5153b | 2013-01-11 14:43:05 -0800 | [diff] [blame] | 43 | getauxval_test.cpp \ |
Elliott Hughes | 04a83a4 | 2012-08-16 15:59:12 -0700 | [diff] [blame] | 44 | getcwd_test.cpp \ |
Elliott Hughes | 74f0833 | 2013-07-02 15:23:38 -0700 | [diff] [blame] | 45 | inttypes_test.cpp \ |
Elliott Hughes | 8f2a5a0 | 2013-03-15 15:30:25 -0700 | [diff] [blame] | 46 | libc_logging_test.cpp \ |
Elliott Hughes | 58b5754 | 2012-10-29 14:27:10 -0700 | [diff] [blame] | 47 | libgen_test.cpp \ |
Christopher Ferris | 885f3b9 | 2013-05-21 17:48:01 -0700 | [diff] [blame] | 48 | malloc_test.cpp \ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 49 | math_test.cpp \ |
Elliott Hughes | d3b9d11 | 2013-02-13 08:22:07 -0800 | [diff] [blame] | 50 | netdb_test.cpp \ |
Elliott Hughes | bfeab1b | 2012-09-05 17:47:37 -0700 | [diff] [blame] | 51 | pthread_test.cpp \ |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 52 | regex_test.cpp \ |
Elliott Hughes | 53bfdae | 2013-10-18 19:39:09 -0700 | [diff] [blame] | 53 | sched_test.cpp \ |
Elliott Hughes | da73f65 | 2012-11-30 16:40:55 -0800 | [diff] [blame] | 54 | signal_test.cpp \ |
Elliott Hughes | ad88a08 | 2012-10-24 18:37:21 -0700 | [diff] [blame] | 55 | stack_protector_test.cpp \ |
Sergey Melnikov | c45087b | 2013-01-25 16:40:13 +0400 | [diff] [blame] | 56 | stack_unwinding_test.cpp \ |
Elliott Hughes | 06040fd | 2013-07-09 13:25:03 -0700 | [diff] [blame] | 57 | statvfs_test.cpp \ |
Elliott Hughes | 91875dc | 2012-09-24 17:55:15 -0700 | [diff] [blame] | 58 | stdio_test.cpp \ |
Elliott Hughes | 774c7f5 | 2012-10-01 13:11:03 -0700 | [diff] [blame] | 59 | stdlib_test.cpp \ |
Irina Tirdea | b5f053b | 2012-09-08 09:17:54 +0300 | [diff] [blame] | 60 | string_test.cpp \ |
Elliott Hughes | 73964c5 | 2013-02-13 14:35:14 -0800 | [diff] [blame] | 61 | strings_test.cpp \ |
Kenny Root | 2a54e5e | 2012-09-13 10:52:52 -0700 | [diff] [blame] | 62 | stubs_test.cpp \ |
Elliott Hughes | 1195207 | 2013-10-24 15:15:14 -0700 | [diff] [blame] | 63 | sys_epoll_test.cpp \ |
Elliott Hughes | 5b9310e | 2013-10-02 16:59:05 -0700 | [diff] [blame] | 64 | sys_select_test.cpp \ |
Elliott Hughes | b4f7616 | 2013-09-19 16:27:24 -0700 | [diff] [blame] | 65 | sys_sendfile_test.cpp \ |
Elliott Hughes | d0be7c8 | 2013-08-08 17:13:33 -0700 | [diff] [blame] | 66 | sys_stat_test.cpp \ |
Elliott Hughes | e61dc71 | 2013-11-13 13:14:31 -0800 | [diff] [blame] | 67 | sys_syscall_test.cpp \ |
Elliott Hughes | f8fcfbc | 2013-10-22 13:28:46 -0700 | [diff] [blame] | 68 | sys_time_test.cpp \ |
Colin Cross | b27e200 | 2013-01-28 17:19:43 -0800 | [diff] [blame] | 69 | system_properties_test.cpp \ |
Elliott Hughes | e0175ca | 2013-03-14 14:38:08 -0700 | [diff] [blame] | 70 | time_test.cpp \ |
Elliott Hughes | a55f630 | 2013-01-02 14:23:43 -0800 | [diff] [blame] | 71 | unistd_test.cpp \ |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 72 | |
jeffhao | acf5aa7 | 2012-09-12 17:25:30 -0700 | [diff] [blame] | 73 | test_dynamic_ldflags = -Wl,--export-dynamic -Wl,-u,DlSymTestFunction |
| 74 | test_dynamic_src_files = \ |
Elliott Hughes | e66190d | 2012-12-18 15:57:55 -0800 | [diff] [blame] | 75 | dlfcn_test.cpp \ |
jeffhao | acf5aa7 | 2012-09-12 17:25:30 -0700 | [diff] [blame] | 76 | |
Nick Kralevich | 5bcf398 | 2013-06-28 10:34:09 -0700 | [diff] [blame] | 77 | test_fortify_static_libraries = \ |
| 78 | fortify1-tests-gcc fortify2-tests-gcc fortify1-tests-clang fortify2-tests-clang |
| 79 | |
Sergey Melnikov | c45087b | 2013-01-25 16:40:13 +0400 | [diff] [blame] | 80 | include $(CLEAR_VARS) |
| 81 | LOCAL_MODULE := bionic-unit-tests-unwind-test-impl |
| 82 | LOCAL_CFLAGS += $(test_c_flags) -fexceptions -fnon-call-exceptions |
| 83 | LOCAL_SRC_FILES := stack_unwinding_test_impl.c |
| 84 | include $(BUILD_STATIC_LIBRARY) |
| 85 | |
| 86 | include $(CLEAR_VARS) |
| 87 | LOCAL_MODULE := bionic-unit-tests-unwind-test-impl-host |
| 88 | LOCAL_CFLAGS += $(test_c_flags) -fexceptions -fnon-call-exceptions |
| 89 | LOCAL_SRC_FILES := stack_unwinding_test_impl.c |
| 90 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 91 | |
Elliott Hughes | 7be369d | 2012-11-08 15:37:43 -0800 | [diff] [blame] | 92 | # Build tests for the device (with bionic's .so). Run with: |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 93 | # adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests |
| 94 | include $(CLEAR_VARS) |
Joe Onorato | 7b841f3 | 2012-08-15 20:27:04 -0700 | [diff] [blame] | 95 | LOCAL_MODULE := bionic-unit-tests |
Elliott Hughes | 2e8f434 | 2012-09-05 14:27:17 -0700 | [diff] [blame] | 96 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Elliott Hughes | ad88a08 | 2012-10-24 18:37:21 -0700 | [diff] [blame] | 97 | LOCAL_CFLAGS += $(test_c_flags) |
jeffhao | acf5aa7 | 2012-09-12 17:25:30 -0700 | [diff] [blame] | 98 | LOCAL_LDFLAGS += $(test_dynamic_ldflags) |
| 99 | LOCAL_SHARED_LIBRARIES += libdl |
| 100 | LOCAL_SRC_FILES := $(test_src_files) $(test_dynamic_src_files) |
Nick Kralevich | 5bcf398 | 2013-06-28 10:34:09 -0700 | [diff] [blame] | 101 | LOCAL_WHOLE_STATIC_LIBRARIES := $(test_fortify_static_libraries) |
Sergey Melnikov | c45087b | 2013-01-25 16:40:13 +0400 | [diff] [blame] | 102 | LOCAL_STATIC_LIBRARIES += bionic-unit-tests-unwind-test-impl |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 103 | include $(BUILD_NATIVE_TEST) |
| 104 | |
Elliott Hughes | 7be369d | 2012-11-08 15:37:43 -0800 | [diff] [blame] | 105 | # Build tests for the device (with bionic's .a). Run with: |
Elliott Hughes | bfeab1b | 2012-09-05 17:47:37 -0700 | [diff] [blame] | 106 | # adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static |
| 107 | include $(CLEAR_VARS) |
Elliott Hughes | bfeab1b | 2012-09-05 17:47:37 -0700 | [diff] [blame] | 108 | LOCAL_MODULE := bionic-unit-tests-static |
| 109 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
jeffhao | acf5aa7 | 2012-09-12 17:25:30 -0700 | [diff] [blame] | 110 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
Christopher Ferris | 153d927 | 2013-08-27 14:32:15 -0700 | [diff] [blame] | 111 | LOCAL_WHOLE_STATIC_LIBRARIES += libBionicTests |
Christopher Ferris | 8240bed | 2013-08-29 11:37:33 -0700 | [diff] [blame] | 112 | LOCAL_STATIC_LIBRARIES += libstlport_static libstdc++ libm libc |
Elliott Hughes | bfeab1b | 2012-09-05 17:47:37 -0700 | [diff] [blame] | 113 | include $(BUILD_NATIVE_TEST) |
| 114 | |
Elliott Hughes | 7be369d | 2012-11-08 15:37:43 -0800 | [diff] [blame] | 115 | # ----------------------------------------------------------------------------- |
Christopher Ferris | 153d927 | 2013-08-27 14:32:15 -0700 | [diff] [blame] | 116 | # We build the static unit tests as a library so they can be used both for |
| 117 | # bionic-unit-tests-static and also as part of CTS. |
| 118 | # ----------------------------------------------------------------------------- |
| 119 | |
| 120 | include $(CLEAR_VARS) |
| 121 | LOCAL_MODULE := libBionicTests |
| 122 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 123 | LOCAL_CFLAGS += $(test_c_flags) |
| 124 | LOCAL_SRC_FILES := $(test_src_files) |
Christopher Ferris | 8240bed | 2013-08-29 11:37:33 -0700 | [diff] [blame] | 125 | LOCAL_CFLAGS += \ |
| 126 | -DGTEST_OS_LINUX_ANDROID \ |
| 127 | -DGTEST_HAS_STD_STRING \ |
| 128 | |
| 129 | LOCAL_C_INCLUDES += \ |
| 130 | bionic bionic/libstdc++/include \ |
| 131 | external/gtest/include \ |
| 132 | external/stlport/stlport \ |
| 133 | |
| 134 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 135 | $(test_fortify_static_libraries) \ |
| 136 | bionic-unit-tests-unwind-test-impl \ |
| 137 | |
Christopher Ferris | 153d927 | 2013-08-27 14:32:15 -0700 | [diff] [blame] | 138 | include $(BUILD_STATIC_LIBRARY) |
| 139 | |
| 140 | # ----------------------------------------------------------------------------- |
Elliott Hughes | 7be369d | 2012-11-08 15:37:43 -0800 | [diff] [blame] | 141 | # Test library for the unit tests. |
| 142 | # ----------------------------------------------------------------------------- |
Elliott Hughes | 124fae9 | 2012-10-31 14:20:03 -0700 | [diff] [blame] | 143 | |
| 144 | # Build no-elf-hash-table-library.so to test dlopen(3) on a library that |
Elliott Hughes | a43e906 | 2013-01-07 14:18:22 -0800 | [diff] [blame] | 145 | # only has a GNU-style hash table. MIPS doesn't support GNU hash style. |
| 146 | ifneq ($(TARGET_ARCH),mips) |
Elliott Hughes | 124fae9 | 2012-10-31 14:20:03 -0700 | [diff] [blame] | 147 | include $(CLEAR_VARS) |
| 148 | LOCAL_MODULE := no-elf-hash-table-library |
| 149 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 150 | LOCAL_SRC_FILES := empty.cpp |
| 151 | LOCAL_LDFLAGS := -Wl,--hash-style=gnu |
| 152 | include $(BUILD_SHARED_LIBRARY) |
Elliott Hughes | a43e906 | 2013-01-07 14:18:22 -0800 | [diff] [blame] | 153 | endif |
Elliott Hughes | 124fae9 | 2012-10-31 14:20:03 -0700 | [diff] [blame] | 154 | |
Elliott Hughes | 7be369d | 2012-11-08 15:37:43 -0800 | [diff] [blame] | 155 | # ----------------------------------------------------------------------------- |
| 156 | # Unit tests built against glibc. |
| 157 | # ----------------------------------------------------------------------------- |
Elliott Hughes | 124fae9 | 2012-10-31 14:20:03 -0700 | [diff] [blame] | 158 | |
Elliott Hughes | 7be369d | 2012-11-08 15:37:43 -0800 | [diff] [blame] | 159 | # Build tests for the host (with glibc). |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 160 | # Note that this will build against glibc, so it's not useful for testing |
| 161 | # bionic's implementation, but it does let you use glibc as a reference |
| 162 | # implementation for testing the tests themselves. |
Elliott Hughes | 38bfa21 | 2012-09-13 11:01:46 -0700 | [diff] [blame] | 163 | ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86) |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 164 | include $(CLEAR_VARS) |
Joe Onorato | 7b841f3 | 2012-08-15 20:27:04 -0700 | [diff] [blame] | 165 | LOCAL_MODULE := bionic-unit-tests-glibc |
Elliott Hughes | 2e8f434 | 2012-09-05 14:27:17 -0700 | [diff] [blame] | 166 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Elliott Hughes | ad88a08 | 2012-10-24 18:37:21 -0700 | [diff] [blame] | 167 | LOCAL_CFLAGS += $(test_c_flags) |
Jeff Hao | 9b06cc3 | 2013-08-15 14:51:16 -0700 | [diff] [blame] | 168 | LOCAL_LDFLAGS += -lpthread -ldl -lrt |
jeffhao | acf5aa7 | 2012-09-12 17:25:30 -0700 | [diff] [blame] | 169 | LOCAL_LDFLAGS += $(test_dynamic_ldflags) |
| 170 | LOCAL_SRC_FILES := $(test_src_files) $(test_dynamic_src_files) |
Sergey Melnikov | c45087b | 2013-01-25 16:40:13 +0400 | [diff] [blame] | 171 | LOCAL_STATIC_LIBRARIES += bionic-unit-tests-unwind-test-impl-host |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 172 | include $(BUILD_HOST_NATIVE_TEST) |
Christopher Ferris | b38e4d5 | 2013-10-25 10:06:57 -0700 | [diff] [blame] | 173 | |
| 174 | # gtest needs ANDROID_DATA/local/tmp for death test output. |
| 175 | # Make sure to create ANDROID_DATA/local/tmp if doesn't exist. |
| 176 | # Use the current target out directory as ANDROID_DATA. |
| 177 | bionic-unit-tests-glibc-run: bionic-unit-tests-glibc |
| 178 | mkdir -p $(TARGET_OUT_DATA)/local/tmp |
| 179 | ANDROID_DATA=$(TARGET_OUT_DATA) \ |
| 180 | ANDROID_ROOT=$(TARGET_OUT) \ |
| 181 | $(HOST_OUT_EXECUTABLES)/bionic-unit-tests-glibc |
Elliott Hughes | 38bfa21 | 2012-09-13 11:01:46 -0700 | [diff] [blame] | 182 | endif |
Benoit Goby | 5ac9eee | 2012-08-31 19:52:15 -0700 | [diff] [blame] | 183 | |
Nick Kralevich | 16d1af1 | 2013-06-17 14:49:19 -0700 | [diff] [blame] | 184 | # ----------------------------------------------------------------------------- |
Pavel Chupin | f22fb68 | 2013-09-06 18:43:27 +0400 | [diff] [blame] | 185 | # Run the unit tests built against x86 bionic on an x86 host. |
| 186 | # ----------------------------------------------------------------------------- |
| 187 | |
| 188 | ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86) |
Pavel Chupin | 17558de | 2013-10-17 14:41:34 +0400 | [diff] [blame] | 189 | ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64)) |
Pavel Chupin | f22fb68 | 2013-09-06 18:43:27 +0400 | [diff] [blame] | 190 | ifeq ($(TARGET_ARCH),x86) |
Pavel Chupin | 17558de | 2013-10-17 14:41:34 +0400 | [diff] [blame] | 191 | LINKER = linker |
| 192 | else |
| 193 | LINKER = linker64 |
| 194 | endif |
Christopher Ferris | b38e4d5 | 2013-10-25 10:06:57 -0700 | [diff] [blame] | 195 | # gtest needs ANDROID_DATA/local/tmp for death test output. |
| 196 | # Make sure to create ANDROID_DATA/local/tmp if doesn't exist. |
Pavel Chupin | f22fb68 | 2013-09-06 18:43:27 +0400 | [diff] [blame] | 197 | # bionic itself should always work relative to ANDROID_DATA or ANDROID_ROOT. |
Pavel Chupin | 17558de | 2013-10-17 14:41:34 +0400 | [diff] [blame] | 198 | bionic-unit-tests-run-on-host: bionic-unit-tests $(TARGET_OUT_EXECUTABLES)/$(LINKER) $(TARGET_OUT_EXECUTABLES)/sh |
Christopher Ferris | b38e4d5 | 2013-10-25 10:06:57 -0700 | [diff] [blame] | 199 | if [ ! -d /system -o ! -d /system/bin ]; then \ |
| 200 | echo "Attempting to create /system/bin"; \ |
| 201 | sudo mkdir -p -m 0777 /system/bin; \ |
| 202 | fi |
Pavel Chupin | f22fb68 | 2013-09-06 18:43:27 +0400 | [diff] [blame] | 203 | mkdir -p $(TARGET_OUT_DATA)/local/tmp |
Pavel Chupin | 17558de | 2013-10-17 14:41:34 +0400 | [diff] [blame] | 204 | cp $(TARGET_OUT_EXECUTABLES)/$(LINKER) /system/bin |
Elliott Hughes | e60c4f0 | 2013-09-19 11:28:20 -0700 | [diff] [blame] | 205 | cp $(TARGET_OUT_EXECUTABLES)/sh /system/bin |
Pavel Chupin | f22fb68 | 2013-09-06 18:43:27 +0400 | [diff] [blame] | 206 | ANDROID_DATA=$(TARGET_OUT_DATA) \ |
| 207 | ANDROID_ROOT=$(TARGET_OUT) \ |
Pavel Chupin | f22fb68 | 2013-09-06 18:43:27 +0400 | [diff] [blame] | 208 | LD_LIBRARY_PATH=$(TARGET_OUT_SHARED_LIBRARIES) \ |
| 209 | $(TARGET_OUT_DATA_NATIVE_TESTS)/bionic-unit-tests/bionic-unit-tests |
| 210 | endif |
| 211 | endif |
| 212 | |
| 213 | # ----------------------------------------------------------------------------- |
Nick Kralevich | 5bcf398 | 2013-06-28 10:34:09 -0700 | [diff] [blame] | 214 | # FORTIFY_SOURCE tests |
Nick Kralevich | 16d1af1 | 2013-06-17 14:49:19 -0700 | [diff] [blame] | 215 | # ----------------------------------------------------------------------------- |
Nick Kralevich | 5bcf398 | 2013-06-28 10:34:09 -0700 | [diff] [blame] | 216 | |
| 217 | fortify_c_includes = \ |
| 218 | bionic \ |
| 219 | bionic/libstdc++/include \ |
| 220 | external/stlport/stlport \ |
| 221 | external/gtest/include |
| 222 | fortify_test_files = fortify_test.cpp |
Nick Kralevich | 16d1af1 | 2013-06-17 14:49:19 -0700 | [diff] [blame] | 223 | |
| 224 | # -Wno-error=unused-parameter needed as |
| 225 | # external/stlport/stlport/stl/_threads.c (included from |
| 226 | # external/gtest/include/gtest/gtest.h) does not compile cleanly under |
| 227 | # clang. TODO: fix this. |
Nick Kralevich | 5bcf398 | 2013-06-28 10:34:09 -0700 | [diff] [blame] | 228 | fortify_c_flags = $(test_c_flags) -Wno-error=unused-parameter |
Nick Kralevich | 16d1af1 | 2013-06-17 14:49:19 -0700 | [diff] [blame] | 229 | |
Nick Kralevich | 5bcf398 | 2013-06-28 10:34:09 -0700 | [diff] [blame] | 230 | include $(CLEAR_VARS) |
| 231 | LOCAL_SRC_FILES := $(fortify_test_files) |
| 232 | LOCAL_MODULE := fortify1-tests-gcc |
| 233 | LOCAL_CFLAGS += $(fortify_c_flags) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DTEST_NAME=Fortify1_Gcc |
Nick Kralevich | 16d1af1 | 2013-06-17 14:49:19 -0700 | [diff] [blame] | 234 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Nick Kralevich | 5bcf398 | 2013-06-28 10:34:09 -0700 | [diff] [blame] | 235 | LOCAL_C_INCLUDES += $(fortify_c_includes) |
| 236 | include $(BUILD_STATIC_LIBRARY) |
Nick Kralevich | 16d1af1 | 2013-06-17 14:49:19 -0700 | [diff] [blame] | 237 | |
Nick Kralevich | 5bcf398 | 2013-06-28 10:34:09 -0700 | [diff] [blame] | 238 | include $(CLEAR_VARS) |
| 239 | LOCAL_SRC_FILES := $(fortify_test_files) |
| 240 | LOCAL_MODULE := fortify2-tests-gcc |
| 241 | LOCAL_CFLAGS += $(fortify_c_flags) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DTEST_NAME=Fortify2_Gcc |
| 242 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 243 | LOCAL_C_INCLUDES += $(fortify_c_includes) |
| 244 | include $(BUILD_STATIC_LIBRARY) |
| 245 | |
| 246 | include $(CLEAR_VARS) |
| 247 | LOCAL_SRC_FILES := $(fortify_test_files) |
| 248 | LOCAL_MODULE := fortify1-tests-clang |
| 249 | LOCAL_CLANG := true |
| 250 | LOCAL_CFLAGS += $(fortify_c_flags) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DTEST_NAME=Fortify1_Clang |
| 251 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 252 | LOCAL_C_INCLUDES += $(fortify_c_includes) |
| 253 | include $(BUILD_STATIC_LIBRARY) |
| 254 | |
| 255 | include $(CLEAR_VARS) |
| 256 | LOCAL_SRC_FILES := $(fortify_test_files) |
| 257 | LOCAL_MODULE := fortify2-tests-clang |
| 258 | LOCAL_CLANG := true |
| 259 | LOCAL_CFLAGS += $(fortify_c_flags) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DTEST_NAME=Fortify2_Clang |
| 260 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 261 | LOCAL_C_INCLUDES += $(fortify_c_includes) |
Nick Kralevich | 16d1af1 | 2013-06-17 14:49:19 -0700 | [diff] [blame] | 262 | include $(BUILD_STATIC_LIBRARY) |
| 263 | |
Benoit Goby | 5ac9eee | 2012-08-31 19:52:15 -0700 | [diff] [blame] | 264 | endif # !BUILD_TINY_ANDROID |