1//
2// Copyright (C) 2015 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//
17
18cc_defaults {
19    name: "san_test_defaults",
20
21    cflags: [
22        "-Wall",
23        "-Werror",
24    ],
25    cppflags: [
26        "-fvisibility=hidden",
27        "-fno-exceptions",
28        "-fno-rtti",
29        "-std=c++11",
30        "-Wno-unused-parameter",
31        "-Wno-non-virtual-dtor",
32        "-Wno-format",
33    ],
34
35    include_dirs: ["external/compiler-rt/lib"],
36}
37
38
39cc_test_host {
40    name: "san_test",
41    defaults: ["san_test_defaults"],
42
43    srcs: [
44        "sanitizer_allocator_test.cc",
45        "sanitizer_atomic_test.cc",
46        "sanitizer_bitvector_test.cc",
47        "sanitizer_bvgraph_test.cc",
48        "sanitizer_common_test.cc",
49        "sanitizer_deadlock_detector_test.cc",
50        "sanitizer_flags_test.cc",
51        "sanitizer_format_interceptor_test.cc",
52        "sanitizer_ioctl_test.cc",
53        "sanitizer_libc_test.cc",
54        "sanitizer_linux_test.cc",
55        "sanitizer_list_test.cc",
56        "sanitizer_mutex_test.cc",
57        "sanitizer_nolibc_test.cc",
58        "sanitizer_posix_test.cc",
59        "sanitizer_printf_test.cc",
60        "sanitizer_procmaps_test.cc",
61        "sanitizer_stackdepot_test.cc",
62        "sanitizer_stacktrace_printer_test.cc",
63        "sanitizer_stacktrace_test.cc",
64        "sanitizer_stoptheworld_test.cc",
65        "sanitizer_suppressions_test.cc",
66        "sanitizer_test_main.cc",
67        "sanitizer_thread_registry_test.cc",
68    ],
69    static_libs: ["libsan"],
70    sanitize: {
71        never: true,
72    },
73    target: {
74        darwin: {
75            enabled: false,
76        },
77    },
78}
79
80cc_binary_host {
81    name: "san_test-Nolibc",
82    defaults: ["san_test_defaults"],
83
84    srcs: ["sanitizer_nolibc_test_main.cc"],
85    static_libs: [
86        "libsan",
87        "libgtest_host",
88    ],
89    ldflags: [
90        "-nostdlib",
91        "-Qunused-arguments",
92    ],
93    sanitize: {
94        never: true,
95    },
96    target: {
97        darwin: {
98            enabled: false,
99        },
100    },
101}
102