blob: 7dd86dc12ed573dd778bb7a953588c3d2f4af258 [file] [log] [blame]
Philipp Schrader9b1790e2018-03-10 20:21:30 -08001licenses(["notice"])
Brian Silverman660d6092015-11-26 18:41:59 -05002
Austin Schuhdde64052019-12-11 20:28:00 -08003load("//tools/build_rules:select.bzl", "compiler_select", "cpu_select")
Philipp Schrader9b1790e2018-03-10 20:21:30 -08004load("//tools/build_rules:empty_main.bzl", "empty_main_if_asan")
Brian Silverman660d6092015-11-26 18:41:59 -05005
6common_copts = [
Brian Silvermana659aaa2022-01-02 00:19:11 -08007 # Stuff from their Makefile.
Philipp Schrader9b1790e2018-03-10 20:21:30 -08008 "-Wno-cast-align",
9 "-Wno-sign-compare",
10 "-fno-builtin-malloc",
11 "-fno-builtin-free",
12 "-fno-builtin-realloc",
13 "-fno-builtin-calloc",
14 "-fno-builtin-cfree",
15 "-fno-builtin-memalign",
16 "-fno-builtin-posix_memalign",
17 "-fno-builtin-valloc",
18 "-fno-builtin-pvalloc",
19 "-Wno-unused-result",
20 "-fno-omit-frame-pointer",
21 "-DNDEBUG",
Brian Silvermana659aaa2022-01-02 00:19:11 -080022 "-DENABLE_EMERGENCY_MALLOC",
Brian Silverman660d6092015-11-26 18:41:59 -050023
Brian Silvermana659aaa2022-01-02 00:19:11 -080024 # Stuff to make it work for us.
Philipp Schrader9b1790e2018-03-10 20:21:30 -080025 "-Ithird_party/gperftools/src/",
26 "-Ithird_party/empty_config_h",
27 "-Wno-unused-parameter",
28 "-Wno-missing-field-initializers",
29 "-Wno-unused-function",
30 "-Wno-unused-variable",
31 "-Wno-format-nonliteral",
32 "-Wno-switch-enum",
33 "-Wno-error=cast-align",
34 "-Wno-error=cast-qual",
Brian Silverman660d6092015-11-26 18:41:59 -050035
Brian Silvermana659aaa2022-01-02 00:19:11 -080036 # //build_tests:tcmalloc_build_test relies on this.
37 "-DENABLE_LARGE_ALLOC_REPORT=1",
38
39 # Stuff pulled out of config.h.
40 "-DGPERFTOOLS_CONFIG_H_=1",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080041 "-DHAVE_BUILTIN_EXPECT=1",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080042 "-DHAVE_DECL_MEMALIGN=1",
43 "-DHAVE_DECL_POSIX_MEMALIGN=1",
44 "-DHAVE_DECL_PVALLOC=1",
45 "-DHAVE_DECL_UNAME=1",
46 "-DHAVE_DECL_VALLOC=1",
47 "-DHAVE_DLFCN_H=1",
48 "-DHAVE_ELF32_VERSYM=1",
49 "-DHAVE_EXECINFO_H=1",
50 "-DHAVE_FCNTL_H=1",
51 "-DHAVE_FEATURES_H=1",
52 "-DHAVE_FORK=1",
53 "-DHAVE_GETEUID=1",
54 "-DHAVE_GLOB_H=1",
55 "-DHAVE_GRP_H=1",
56 "-DHAVE_INTTYPES_H=1",
57 "-DHAVE_LINUX_PTRACE_H=1",
58 "-DHAVE_LINUX_SIGEV_THREAD_ID=1",
59 "-DHAVE_MALLOC_H=1",
60 "-DHAVE_MEMORY_H=1",
61 "-DHAVE_MMAP=1",
62 "-DHAVE_NAMESPACES=1",
63 "-DHAVE_POLL_H=1",
64 "-DHAVE_PROGRAM_INVOCATION_NAME=1",
65 "-DHAVE_PTHREAD=1",
66 "-DHAVE_PWD_H=1",
67 "-DHAVE_SBRK=1",
68 "-DHAVE_SCHED_H=1",
69 "-DHAVE_STDINT_H=1",
70 "-DHAVE_STDLIB_H=1",
71 "-DHAVE_STRINGS_H=1",
72 "-DHAVE_STRING_H=1",
73 "-DHAVE_STRUCT_MALLINFO=1",
74 "-DHAVE_SYS_CDEFS_H=1",
75 "-DHAVE_SYS_PRCTL_H=1",
76 "-DHAVE_SYS_RESOURCE_H=1",
77 "-DHAVE_SYS_SOCKET_H=1",
78 "-DHAVE_SYS_STAT_H=1",
79 "-DHAVE_SYS_SYSCALL_H=1",
80 "-DHAVE_SYS_TYPES_H=1",
81 "-DHAVE_SYS_UCONTEXT_H=1",
82 "-DHAVE_SYS_WAIT_H=1",
83 "-DHAVE_TLS=1",
84 "-DHAVE_UCONTEXT_H=1",
85 "-DHAVE_UNISTD_H=1",
86 "-DHAVE_UNWIND_H=1",
87 "-DHAVE___ATTRIBUTE__=1",
88 "-DHAVE___ENVIRON=1",
89 "-DMALLOC_HOOK_MAYBE_VOLATILE=volatile",
90 "-DPERFTOOLS_DLL_DECL=",
91 "-DSTDC_HEADERS=1",
92 "-DSTL_NAMESPACE=std",
Brian Silvermana659aaa2022-01-02 00:19:11 -080093 "-DPACKAGE_STRING=\\\"gperftools\\ 2.9.1\\\"",
Austin Schuha5778ae2020-10-21 21:15:35 -070094 "-DPACKAGE_BUGREPORT=\\\"https://frc971.org/contact\\\"",
Brian Silvermana659aaa2022-01-02 00:19:11 -080095 "-DPACKAGE_VERSION=\\\"2.9.1\\\"",
Brian Silverman660d6092015-11-26 18:41:59 -050096] + cpu_select({
Philipp Schrader9b1790e2018-03-10 20:21:30 -080097 "amd64": [
98 "-DHAVE_GETPAGESZE=1",
99 "-DHAVE_SYS_PARAM_H=1",
100 "-DPC_FROM_UCONTEXT=uc_mcontext.gregs[REG_RIP]",
101 "-DPRIdS=\\\"ld\\\"",
102 "-DPRIuS=\\\"lu\\\"",
103 "-DPRIxS=\\\"lx\\\"",
104 ],
105 "arm": [
106 "-DPC_FROM_UCONTEXT=uc_mcontext.arm_pc",
107 "-DPRIdS=\\\"d\\\"",
108 "-DPRIuS=\\\"u\\\"",
109 "-DPRIxS=\\\"x\\\"",
110 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500111}) + compiler_select({
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800112 "clang": [
113 "-Wno-unused-const-variable",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800114 "-Wno-unused-but-set-variable",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800115 "-Wno-gnu-alignof-expression",
116 "-Wno-unused-private-field",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800117
118 # It has annotations for this analysis, but the invariants are too tricky
119 # for clang to figure out by itself so it has lots of false positives. Just
120 # disable the analysis to simplify.
121 "-Wno-thread-safety-analysis",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800122 ],
123 "gcc": [],
Brian Silverman660d6092015-11-26 18:41:59 -0500124})
125
126cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800127 name = "tcmalloc",
128 srcs = glob(
129 include = [
130 "src/*.cc",
131 "src/*.c",
132 "src/base/*.cc",
133 "src/base/*.c",
134 ],
135 exclude = [
136 "**/*_unittest.cc",
137 "**/*_test.cc",
138 "src/debugallocation.cc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800139 "src/fake_stacktrace_scope.cc",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800140 ],
141 ),
142 hdrs = glob([
143 "src/*.h",
144 "src/base/*.h",
145 "src/gperftools/*.h",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800146 ]),
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800147 copts = common_copts,
Austin Schuhdde64052019-12-11 20:28:00 -0800148 includes = ["src"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800149 linkopts = [
150 "-lrt",
151 "-lpthread",
152 ],
Austin Schuha4f69d62020-02-28 13:58:14 -0800153 nocopts = "-std=gnu\\+\\+1y",
Philipp Schraderdada1072020-11-24 11:34:46 -0800154 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800155 visibility = ["//visibility:public"],
156 deps = [
157 "//third_party/empty_config_h",
158 ],
159 alwayslink = True,
Brian Silverman660d6092015-11-26 18:41:59 -0500160)
161
162cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800163 name = "testutil",
164 srcs = [
165 "src/tests/testutil.cc",
Brian Silverman660d6092015-11-26 18:41:59 -0500166 ],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800167 hdrs = [
168 "src/tests/testutil.h",
169 ],
170 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800171 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800172 deps = [
173 ":tcmalloc",
174 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500175)
176
177cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800178 name = "low_level_alloc_unittest",
179 size = "medium",
180 srcs = [
181 "src/tests/low_level_alloc_unittest.cc",
182 ],
183 copts = common_copts,
184 defines = [
185 "NO_TCMALLOC_SAMPLES",
186 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800187 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800188 deps = [
189 ":tcmalloc",
190 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500191)
192
193cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800194 name = "atomicops_unittest",
195 size = "small",
196 srcs = [
197 "src/tests/atomicops_unittest.cc",
198 ],
199 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800200 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800201 deps = [
202 ":tcmalloc",
203 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500204)
205
206cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800207 name = "stacktrace_unittest",
208 size = "small",
209 srcs = [
210 "src/tests/stacktrace_unittest.cc",
211 ],
212 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800213 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800214 deps = [
215 ":tcmalloc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800216 ":testutil",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800217 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500218)
219
220cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800221 name = "tcmalloc_unittest",
222 size = "small",
223 srcs = empty_main_if_asan([
224 "src/tests/tcmalloc_unittest.cc",
225 ]),
226 copts = common_copts + [
227 "-fno-builtin",
Austin Schuhdde64052019-12-11 20:28:00 -0800228 #Add this back in when we upgrade clang.
229 #'-Wno-mismatched-new-delete',
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800230 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800231 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800232 deps = [
233 ":tcmalloc",
234 ":testutil",
235 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500236)
237
238cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800239 name = "tcmalloc_large_unittest",
240 size = "small",
241 srcs = empty_main_if_asan([
242 "src/tests/tcmalloc_large_unittest.cc",
243 ]),
244 copts = common_copts + [
245 "-fno-builtin",
246 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800247 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800248 deps = [
249 ":tcmalloc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800250 ":testutil",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800251 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500252)
253
254cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800255 name = "addressmap_unittest",
256 size = "medium",
257 srcs = [
258 "src/tests/addressmap_unittest.cc",
259 ],
260 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800261 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800262 deps = [
263 ":tcmalloc",
264 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500265)
266
267cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800268 name = "system_alloc_unittest",
269 size = "small",
270 srcs = empty_main_if_asan([
271 "src/tests/system-alloc_unittest.cc",
272 ]),
273 copts = common_copts + [
274 "-fno-builtin",
275 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800276 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800277 deps = [
278 ":tcmalloc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800279 ":testutil",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800280 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500281)
282
283cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800284 name = "packed_cache_test",
285 size = "small",
286 srcs = [
287 "src/tests/packed-cache_test.cc",
288 ],
289 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800290 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800291 deps = [
292 ":tcmalloc",
293 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500294)
295
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800296cc_test(
297 name = "frag_unittest",
298 size = "small",
299 srcs = [
300 "src/tests/frag_unittest.cc",
301 ],
302 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800303 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800304 deps = [
305 ":tcmalloc",
306 ],
307)
308
309cc_test(
310 name = "markidle_unittest",
311 size = "small",
312 srcs = empty_main_if_asan([
313 "src/tests/markidle_unittest.cc",
314 ]),
315 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800316 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800317 deps = [
318 ":tcmalloc",
319 ":testutil",
320 ],
321)
322
323cc_test(
324 name = "current_allocated_bytes_test",
325 size = "small",
326 srcs = [
327 "src/tests/current_allocated_bytes_test.cc",
328 ],
329 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800330 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800331 deps = [
332 ":tcmalloc",
333 ],
334)
335
336cc_test(
337 name = "malloc_hook_test",
338 size = "small",
339 srcs = [
340 "src/tests/malloc_hook_test.cc",
341 ],
342 copts = common_copts + compiler_select({
343 "gcc": [
344 "-Wno-maybe-uninitialized",
345 ],
346 "clang": [],
347 }),
Philipp Schraderdada1072020-11-24 11:34:46 -0800348 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800349 deps = [
350 ":tcmalloc",
351 ":testutil",
352 ],
353)
354
355cc_test(
356 name = "malloc_extension_test",
357 size = "small",
358 srcs = empty_main_if_asan([
359 "src/tests/malloc_extension_test.cc",
360 ]),
361 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800362 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800363 deps = [
364 ":tcmalloc",
365 ],
366)
367
368cc_test(
369 name = "malloc_extension_c_test",
370 size = "small",
371 srcs = empty_main_if_asan([
372 "src/tests/malloc_extension_c_test.c",
373 ]),
374 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800375 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800376 deps = [
377 ":tcmalloc",
378 ],
379)
380
381cc_test(
382 name = "memalign_unittest",
383 size = "small",
384 srcs = empty_main_if_asan([
385 "src/tests/memalign_unittest.cc",
386 ]),
387 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800388 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800389 deps = [
390 ":tcmalloc",
391 ":testutil",
392 ],
393)
394
395cc_test(
396 name = "page_heap_test",
397 size = "small",
398 srcs = [
399 "src/tests/page_heap_test.cc",
400 ],
401 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800402 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800403 deps = [
404 ":tcmalloc",
405 ],
406)
407
408cc_test(
409 name = "pagemap_unittest",
410 size = "small",
411 srcs = empty_main_if_asan([
412 "src/tests/pagemap_unittest.cc",
413 ]),
414 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800415 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800416 deps = [
417 ":tcmalloc",
418 ],
419)
420
421cc_test(
422 name = "realloc_unittest",
423 size = "small",
424 srcs = [
425 "src/tests/realloc_unittest.cc",
426 ],
427 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800428 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800429 deps = [
430 ":tcmalloc",
431 ],
432)
433
434cc_test(
435 name = "stack_trace_table_test",
436 size = "small",
437 srcs = [
438 "src/tests/stack_trace_table_test.cc",
439 ],
440 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800441 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800442 deps = [
443 ":tcmalloc",
444 ],
445)
446
447cc_test(
448 name = "thread_dealloc_unittest",
449 size = "small",
450 srcs = [
451 "src/tests/thread_dealloc_unittest.cc",
452 ],
453 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800454 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800455 deps = [
456 ":tcmalloc",
457 ":testutil",
458 ],
459)
460
461"""
Brian Silverman660d6092015-11-26 18:41:59 -0500462We don't build this because it actually needs to be in a separate binary.
463cc_test(
464 name = 'debugallocation_test',
465 srcs = [
466 'src/tests/debugallocation_test.cc',
467 ],
468 deps = [
469 ':tcmalloc',
470 ],
471 copts = common_copts,
472 size = 'small',
473)
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800474"""
Brian Silverman660d6092015-11-26 18:41:59 -0500475
476cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800477 name = "tcmalloc_large_heap_fragmentation_unittest",
478 size = "small",
479 srcs = empty_main_if_asan([
480 "src/tests/large_heap_fragmentation_unittest.cc",
481 ]),
482 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800483 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800484 deps = [
485 ":tcmalloc",
486 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500487)
488
489cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800490 name = "raw_printer_test",
491 size = "small",
492 srcs = [
493 "src/tests/raw_printer_test.cc",
494 ],
495 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800496 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800497 deps = [
498 ":tcmalloc",
499 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500500)
501
502cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800503 name = "getpc_test",
504 size = "small",
505 srcs = empty_main_if_asan([
506 "src/tests/getpc_test.cc",
507 ]),
508 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800509 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800510 deps = [
511 ":tcmalloc",
512 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500513)
514
515cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800516 name = "profiledata_unittest",
517 size = "small",
518 srcs = [
519 "src/tests/profiledata_unittest.cc",
520 ],
521 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800522 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800523 deps = [
524 ":tcmalloc",
525 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500526)
527
528cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800529 name = "profile_handler_unittest",
530 size = "small",
531 srcs = [
532 "src/tests/profile-handler_unittest.cc",
533 ],
534 copts = common_copts,
535 flaky = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800536 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800537 deps = [
538 ":tcmalloc",
539 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500540)
541
542cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800543 name = "heap_profiler_unittest",
544 size = "small",
545 srcs = [
546 "src/tests/heap-profiler_unittest.cc",
547 ],
548 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800549 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800550 deps = [
551 ":tcmalloc",
552 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500553)
554
555cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800556 name = "sampler_test",
557 size = "small",
558 srcs = [
559 "src/tests/sampler_test.cc",
560 ],
561 copts = common_copts + [
562 "-Wno-type-limits",
563 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800564 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800565 deps = [
566 ":tcmalloc",
567 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500568)