blob: 2022ee6f88440812a1e93ddb7ffc8fe46964b8ba [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 ],
Philipp Schraderf1bbf342022-02-05 14:30:15 -0800105 "arm32": [
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800106 "-DPC_FROM_UCONTEXT=uc_mcontext.arm_pc",
107 "-DPRIdS=\\\"d\\\"",
108 "-DPRIuS=\\\"u\\\"",
109 "-DPRIxS=\\\"x\\\"",
110 ],
Philipp Schraderf1bbf342022-02-05 14:30:15 -0800111 "arm64": [
112 "-DPC_FROM_UCONTEXT=uc_mcontext.pc",
113 "-DPRIdS=\\\"ld\\\"",
114 "-DPRIuS=\\\"lu\\\"",
115 "-DPRIxS=\\\"lx\\\"",
116 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500117}) + compiler_select({
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800118 "clang": [
119 "-Wno-unused-const-variable",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800120 "-Wno-unused-but-set-variable",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800121 "-Wno-gnu-alignof-expression",
122 "-Wno-unused-private-field",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800123
124 # It has annotations for this analysis, but the invariants are too tricky
125 # for clang to figure out by itself so it has lots of false positives. Just
126 # disable the analysis to simplify.
127 "-Wno-thread-safety-analysis",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800128 ],
129 "gcc": [],
Brian Silverman660d6092015-11-26 18:41:59 -0500130})
131
132cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800133 name = "tcmalloc",
134 srcs = glob(
135 include = [
136 "src/*.cc",
137 "src/*.c",
138 "src/base/*.cc",
139 "src/base/*.c",
140 ],
141 exclude = [
142 "**/*_unittest.cc",
143 "**/*_test.cc",
144 "src/debugallocation.cc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800145 "src/fake_stacktrace_scope.cc",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800146 ],
147 ),
148 hdrs = glob([
149 "src/*.h",
150 "src/base/*.h",
151 "src/gperftools/*.h",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800152 ]),
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800153 copts = common_copts,
Austin Schuhdde64052019-12-11 20:28:00 -0800154 includes = ["src"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800155 linkopts = [
156 "-lrt",
157 "-lpthread",
158 ],
Austin Schuha4f69d62020-02-28 13:58:14 -0800159 nocopts = "-std=gnu\\+\\+1y",
Philipp Schraderdada1072020-11-24 11:34:46 -0800160 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800161 visibility = ["//visibility:public"],
162 deps = [
163 "//third_party/empty_config_h",
164 ],
165 alwayslink = True,
Brian Silverman660d6092015-11-26 18:41:59 -0500166)
167
168cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800169 name = "testutil",
170 srcs = [
171 "src/tests/testutil.cc",
Brian Silverman660d6092015-11-26 18:41:59 -0500172 ],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800173 hdrs = [
174 "src/tests/testutil.h",
175 ],
176 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800177 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800178 deps = [
179 ":tcmalloc",
180 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500181)
182
183cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800184 name = "low_level_alloc_unittest",
185 size = "medium",
186 srcs = [
187 "src/tests/low_level_alloc_unittest.cc",
188 ],
189 copts = common_copts,
190 defines = [
191 "NO_TCMALLOC_SAMPLES",
192 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800193 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800194 deps = [
195 ":tcmalloc",
196 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500197)
198
199cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800200 name = "atomicops_unittest",
201 size = "small",
202 srcs = [
203 "src/tests/atomicops_unittest.cc",
204 ],
205 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800206 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800207 deps = [
208 ":tcmalloc",
209 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500210)
211
212cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800213 name = "stacktrace_unittest",
214 size = "small",
215 srcs = [
216 "src/tests/stacktrace_unittest.cc",
217 ],
218 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800219 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800220 deps = [
221 ":tcmalloc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800222 ":testutil",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800223 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500224)
225
226cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800227 name = "tcmalloc_unittest",
228 size = "small",
229 srcs = empty_main_if_asan([
230 "src/tests/tcmalloc_unittest.cc",
231 ]),
232 copts = common_copts + [
233 "-fno-builtin",
Austin Schuhdde64052019-12-11 20:28:00 -0800234 #Add this back in when we upgrade clang.
235 #'-Wno-mismatched-new-delete',
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800236 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800237 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800238 deps = [
239 ":tcmalloc",
240 ":testutil",
241 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500242)
243
244cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800245 name = "tcmalloc_large_unittest",
246 size = "small",
247 srcs = empty_main_if_asan([
248 "src/tests/tcmalloc_large_unittest.cc",
249 ]),
250 copts = common_copts + [
251 "-fno-builtin",
252 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800253 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800254 deps = [
255 ":tcmalloc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800256 ":testutil",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800257 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500258)
259
260cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800261 name = "addressmap_unittest",
262 size = "medium",
263 srcs = [
264 "src/tests/addressmap_unittest.cc",
265 ],
266 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800267 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800268 deps = [
269 ":tcmalloc",
270 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500271)
272
273cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800274 name = "system_alloc_unittest",
275 size = "small",
276 srcs = empty_main_if_asan([
277 "src/tests/system-alloc_unittest.cc",
278 ]),
279 copts = common_copts + [
280 "-fno-builtin",
281 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800282 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800283 deps = [
284 ":tcmalloc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800285 ":testutil",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800286 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500287)
288
289cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800290 name = "packed_cache_test",
291 size = "small",
292 srcs = [
293 "src/tests/packed-cache_test.cc",
294 ],
295 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800296 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800297 deps = [
298 ":tcmalloc",
299 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500300)
301
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800302cc_test(
303 name = "frag_unittest",
304 size = "small",
305 srcs = [
306 "src/tests/frag_unittest.cc",
307 ],
308 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800309 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800310 deps = [
311 ":tcmalloc",
312 ],
313)
314
315cc_test(
316 name = "markidle_unittest",
317 size = "small",
318 srcs = empty_main_if_asan([
319 "src/tests/markidle_unittest.cc",
320 ]),
321 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800322 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800323 deps = [
324 ":tcmalloc",
325 ":testutil",
326 ],
327)
328
329cc_test(
330 name = "current_allocated_bytes_test",
331 size = "small",
332 srcs = [
333 "src/tests/current_allocated_bytes_test.cc",
334 ],
335 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800336 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800337 deps = [
338 ":tcmalloc",
339 ],
340)
341
342cc_test(
343 name = "malloc_hook_test",
344 size = "small",
345 srcs = [
346 "src/tests/malloc_hook_test.cc",
347 ],
348 copts = common_copts + compiler_select({
349 "gcc": [
350 "-Wno-maybe-uninitialized",
351 ],
352 "clang": [],
353 }),
Philipp Schraderdada1072020-11-24 11:34:46 -0800354 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800355 deps = [
356 ":tcmalloc",
357 ":testutil",
358 ],
359)
360
361cc_test(
362 name = "malloc_extension_test",
363 size = "small",
364 srcs = empty_main_if_asan([
365 "src/tests/malloc_extension_test.cc",
366 ]),
367 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800368 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800369 deps = [
370 ":tcmalloc",
371 ],
372)
373
374cc_test(
375 name = "malloc_extension_c_test",
376 size = "small",
377 srcs = empty_main_if_asan([
378 "src/tests/malloc_extension_c_test.c",
379 ]),
380 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800381 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800382 deps = [
383 ":tcmalloc",
384 ],
385)
386
387cc_test(
388 name = "memalign_unittest",
389 size = "small",
390 srcs = empty_main_if_asan([
391 "src/tests/memalign_unittest.cc",
392 ]),
393 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800394 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800395 deps = [
396 ":tcmalloc",
397 ":testutil",
398 ],
399)
400
401cc_test(
402 name = "page_heap_test",
403 size = "small",
404 srcs = [
405 "src/tests/page_heap_test.cc",
406 ],
407 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800408 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800409 deps = [
410 ":tcmalloc",
411 ],
412)
413
414cc_test(
415 name = "pagemap_unittest",
416 size = "small",
417 srcs = empty_main_if_asan([
418 "src/tests/pagemap_unittest.cc",
419 ]),
420 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800421 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800422 deps = [
423 ":tcmalloc",
424 ],
425)
426
427cc_test(
428 name = "realloc_unittest",
429 size = "small",
430 srcs = [
431 "src/tests/realloc_unittest.cc",
432 ],
433 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800434 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800435 deps = [
436 ":tcmalloc",
437 ],
438)
439
440cc_test(
441 name = "stack_trace_table_test",
442 size = "small",
443 srcs = [
444 "src/tests/stack_trace_table_test.cc",
445 ],
446 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800447 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800448 deps = [
449 ":tcmalloc",
450 ],
451)
452
453cc_test(
454 name = "thread_dealloc_unittest",
455 size = "small",
456 srcs = [
457 "src/tests/thread_dealloc_unittest.cc",
458 ],
459 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800460 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800461 deps = [
462 ":tcmalloc",
463 ":testutil",
464 ],
465)
466
467"""
Brian Silverman660d6092015-11-26 18:41:59 -0500468We don't build this because it actually needs to be in a separate binary.
469cc_test(
470 name = 'debugallocation_test',
471 srcs = [
472 'src/tests/debugallocation_test.cc',
473 ],
474 deps = [
475 ':tcmalloc',
476 ],
477 copts = common_copts,
478 size = 'small',
479)
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800480"""
Brian Silverman660d6092015-11-26 18:41:59 -0500481
482cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800483 name = "tcmalloc_large_heap_fragmentation_unittest",
484 size = "small",
485 srcs = empty_main_if_asan([
486 "src/tests/large_heap_fragmentation_unittest.cc",
487 ]),
488 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800489 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800490 deps = [
491 ":tcmalloc",
492 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500493)
494
495cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800496 name = "raw_printer_test",
497 size = "small",
498 srcs = [
499 "src/tests/raw_printer_test.cc",
500 ],
501 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800502 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800503 deps = [
504 ":tcmalloc",
505 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500506)
507
508cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800509 name = "getpc_test",
510 size = "small",
511 srcs = empty_main_if_asan([
512 "src/tests/getpc_test.cc",
513 ]),
514 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800515 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800516 deps = [
517 ":tcmalloc",
518 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500519)
520
521cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800522 name = "profiledata_unittest",
523 size = "small",
524 srcs = [
525 "src/tests/profiledata_unittest.cc",
526 ],
527 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800528 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800529 deps = [
530 ":tcmalloc",
531 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500532)
533
534cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800535 name = "profile_handler_unittest",
536 size = "small",
537 srcs = [
538 "src/tests/profile-handler_unittest.cc",
539 ],
540 copts = common_copts,
541 flaky = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800542 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800543 deps = [
544 ":tcmalloc",
545 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500546)
547
548cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800549 name = "heap_profiler_unittest",
550 size = "small",
551 srcs = [
552 "src/tests/heap-profiler_unittest.cc",
553 ],
554 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800555 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800556 deps = [
557 ":tcmalloc",
558 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500559)
560
561cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800562 name = "sampler_test",
563 size = "small",
564 srcs = [
565 "src/tests/sampler_test.cc",
566 ],
567 copts = common_copts + [
568 "-Wno-type-limits",
569 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800570 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800571 deps = [
572 ":tcmalloc",
573 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500574)