blob: 14ac82126198719af516069faad6d2e977a8d371 [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",
Tyler Chatowb8304af2022-02-25 20:52:46 -080035 "-Wno-deprecated-volatile",
36 "-Wno-cast-qual",
Brian Silverman660d6092015-11-26 18:41:59 -050037
Brian Silvermana659aaa2022-01-02 00:19:11 -080038 # //build_tests:tcmalloc_build_test relies on this.
39 "-DENABLE_LARGE_ALLOC_REPORT=1",
40
41 # Stuff pulled out of config.h.
42 "-DGPERFTOOLS_CONFIG_H_=1",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080043 "-DHAVE_BUILTIN_EXPECT=1",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080044 "-DHAVE_DECL_MEMALIGN=1",
45 "-DHAVE_DECL_POSIX_MEMALIGN=1",
46 "-DHAVE_DECL_PVALLOC=1",
47 "-DHAVE_DECL_UNAME=1",
48 "-DHAVE_DECL_VALLOC=1",
49 "-DHAVE_DLFCN_H=1",
50 "-DHAVE_ELF32_VERSYM=1",
51 "-DHAVE_EXECINFO_H=1",
52 "-DHAVE_FCNTL_H=1",
53 "-DHAVE_FEATURES_H=1",
54 "-DHAVE_FORK=1",
55 "-DHAVE_GETEUID=1",
56 "-DHAVE_GLOB_H=1",
57 "-DHAVE_GRP_H=1",
58 "-DHAVE_INTTYPES_H=1",
59 "-DHAVE_LINUX_PTRACE_H=1",
60 "-DHAVE_LINUX_SIGEV_THREAD_ID=1",
61 "-DHAVE_MALLOC_H=1",
62 "-DHAVE_MEMORY_H=1",
63 "-DHAVE_MMAP=1",
64 "-DHAVE_NAMESPACES=1",
65 "-DHAVE_POLL_H=1",
66 "-DHAVE_PROGRAM_INVOCATION_NAME=1",
67 "-DHAVE_PTHREAD=1",
68 "-DHAVE_PWD_H=1",
69 "-DHAVE_SBRK=1",
70 "-DHAVE_SCHED_H=1",
71 "-DHAVE_STDINT_H=1",
72 "-DHAVE_STDLIB_H=1",
73 "-DHAVE_STRINGS_H=1",
74 "-DHAVE_STRING_H=1",
75 "-DHAVE_STRUCT_MALLINFO=1",
76 "-DHAVE_SYS_CDEFS_H=1",
77 "-DHAVE_SYS_PRCTL_H=1",
78 "-DHAVE_SYS_RESOURCE_H=1",
79 "-DHAVE_SYS_SOCKET_H=1",
80 "-DHAVE_SYS_STAT_H=1",
81 "-DHAVE_SYS_SYSCALL_H=1",
82 "-DHAVE_SYS_TYPES_H=1",
83 "-DHAVE_SYS_UCONTEXT_H=1",
84 "-DHAVE_SYS_WAIT_H=1",
85 "-DHAVE_TLS=1",
86 "-DHAVE_UCONTEXT_H=1",
87 "-DHAVE_UNISTD_H=1",
88 "-DHAVE_UNWIND_H=1",
89 "-DHAVE___ATTRIBUTE__=1",
90 "-DHAVE___ENVIRON=1",
91 "-DMALLOC_HOOK_MAYBE_VOLATILE=volatile",
92 "-DPERFTOOLS_DLL_DECL=",
93 "-DSTDC_HEADERS=1",
94 "-DSTL_NAMESPACE=std",
Brian Silvermana659aaa2022-01-02 00:19:11 -080095 "-DPACKAGE_STRING=\\\"gperftools\\ 2.9.1\\\"",
Austin Schuha5778ae2020-10-21 21:15:35 -070096 "-DPACKAGE_BUGREPORT=\\\"https://frc971.org/contact\\\"",
Brian Silvermana659aaa2022-01-02 00:19:11 -080097 "-DPACKAGE_VERSION=\\\"2.9.1\\\"",
Brian Silverman660d6092015-11-26 18:41:59 -050098] + cpu_select({
Philipp Schrader9b1790e2018-03-10 20:21:30 -080099 "amd64": [
100 "-DHAVE_GETPAGESZE=1",
101 "-DHAVE_SYS_PARAM_H=1",
102 "-DPC_FROM_UCONTEXT=uc_mcontext.gregs[REG_RIP]",
103 "-DPRIdS=\\\"ld\\\"",
104 "-DPRIuS=\\\"lu\\\"",
105 "-DPRIxS=\\\"lx\\\"",
106 ],
Philipp Schraderf1bbf342022-02-05 14:30:15 -0800107 "arm32": [
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800108 "-DPC_FROM_UCONTEXT=uc_mcontext.arm_pc",
109 "-DPRIdS=\\\"d\\\"",
110 "-DPRIuS=\\\"u\\\"",
111 "-DPRIxS=\\\"x\\\"",
112 ],
Philipp Schraderf1bbf342022-02-05 14:30:15 -0800113 "arm64": [
114 "-DPC_FROM_UCONTEXT=uc_mcontext.pc",
115 "-DPRIdS=\\\"ld\\\"",
116 "-DPRIuS=\\\"lu\\\"",
117 "-DPRIxS=\\\"lx\\\"",
118 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500119}) + compiler_select({
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800120 "clang": [
121 "-Wno-unused-const-variable",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800122 "-Wno-unused-but-set-variable",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800123 "-Wno-gnu-alignof-expression",
124 "-Wno-unused-private-field",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800125
126 # It has annotations for this analysis, but the invariants are too tricky
127 # for clang to figure out by itself so it has lots of false positives. Just
128 # disable the analysis to simplify.
129 "-Wno-thread-safety-analysis",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800130 ],
131 "gcc": [],
Brian Silverman660d6092015-11-26 18:41:59 -0500132})
133
134cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800135 name = "tcmalloc",
136 srcs = glob(
137 include = [
138 "src/*.cc",
139 "src/*.c",
140 "src/base/*.cc",
141 "src/base/*.c",
142 ],
143 exclude = [
144 "**/*_unittest.cc",
145 "**/*_test.cc",
146 "src/debugallocation.cc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800147 "src/fake_stacktrace_scope.cc",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800148 ],
149 ),
150 hdrs = glob([
151 "src/*.h",
152 "src/base/*.h",
153 "src/gperftools/*.h",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800154 ]),
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800155 copts = common_copts,
Austin Schuhdde64052019-12-11 20:28:00 -0800156 includes = ["src"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800157 linkopts = [
158 "-lrt",
159 "-lpthread",
160 ],
Austin Schuha4f69d62020-02-28 13:58:14 -0800161 nocopts = "-std=gnu\\+\\+1y",
Philipp Schraderdada1072020-11-24 11:34:46 -0800162 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800163 visibility = ["//visibility:public"],
164 deps = [
165 "//third_party/empty_config_h",
166 ],
167 alwayslink = True,
Brian Silverman660d6092015-11-26 18:41:59 -0500168)
169
170cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800171 name = "testutil",
172 srcs = [
173 "src/tests/testutil.cc",
Brian Silverman660d6092015-11-26 18:41:59 -0500174 ],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800175 hdrs = [
176 "src/tests/testutil.h",
177 ],
178 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800179 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800180 deps = [
181 ":tcmalloc",
182 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500183)
184
185cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800186 name = "low_level_alloc_unittest",
187 size = "medium",
188 srcs = [
189 "src/tests/low_level_alloc_unittest.cc",
190 ],
191 copts = common_copts,
192 defines = [
193 "NO_TCMALLOC_SAMPLES",
194 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800195 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800196 deps = [
197 ":tcmalloc",
198 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500199)
200
201cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800202 name = "atomicops_unittest",
203 size = "small",
204 srcs = [
205 "src/tests/atomicops_unittest.cc",
206 ],
207 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800208 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800209 deps = [
210 ":tcmalloc",
211 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500212)
213
214cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800215 name = "stacktrace_unittest",
216 size = "small",
217 srcs = [
218 "src/tests/stacktrace_unittest.cc",
219 ],
220 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800221 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800222 deps = [
223 ":tcmalloc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800224 ":testutil",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800225 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500226)
227
228cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800229 name = "tcmalloc_unittest",
230 size = "small",
231 srcs = empty_main_if_asan([
232 "src/tests/tcmalloc_unittest.cc",
233 ]),
234 copts = common_copts + [
235 "-fno-builtin",
Austin Schuhdde64052019-12-11 20:28:00 -0800236 #Add this back in when we upgrade clang.
237 #'-Wno-mismatched-new-delete',
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800238 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800239 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800240 deps = [
241 ":tcmalloc",
242 ":testutil",
243 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500244)
245
246cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800247 name = "tcmalloc_large_unittest",
248 size = "small",
249 srcs = empty_main_if_asan([
250 "src/tests/tcmalloc_large_unittest.cc",
251 ]),
252 copts = common_copts + [
253 "-fno-builtin",
254 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800255 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800256 deps = [
257 ":tcmalloc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800258 ":testutil",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800259 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500260)
261
262cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800263 name = "addressmap_unittest",
264 size = "medium",
265 srcs = [
266 "src/tests/addressmap_unittest.cc",
267 ],
268 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800269 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800270 deps = [
271 ":tcmalloc",
272 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500273)
274
275cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800276 name = "system_alloc_unittest",
277 size = "small",
278 srcs = empty_main_if_asan([
279 "src/tests/system-alloc_unittest.cc",
280 ]),
281 copts = common_copts + [
282 "-fno-builtin",
283 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800284 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800285 deps = [
286 ":tcmalloc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800287 ":testutil",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800288 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500289)
290
291cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800292 name = "packed_cache_test",
293 size = "small",
294 srcs = [
295 "src/tests/packed-cache_test.cc",
296 ],
297 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800298 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800299 deps = [
300 ":tcmalloc",
301 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500302)
303
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800304cc_test(
305 name = "frag_unittest",
306 size = "small",
307 srcs = [
308 "src/tests/frag_unittest.cc",
309 ],
310 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800311 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800312 deps = [
313 ":tcmalloc",
314 ],
315)
316
317cc_test(
318 name = "markidle_unittest",
319 size = "small",
320 srcs = empty_main_if_asan([
321 "src/tests/markidle_unittest.cc",
322 ]),
323 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800324 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800325 deps = [
326 ":tcmalloc",
327 ":testutil",
328 ],
329)
330
331cc_test(
332 name = "current_allocated_bytes_test",
333 size = "small",
334 srcs = [
335 "src/tests/current_allocated_bytes_test.cc",
336 ],
337 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800338 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800339 deps = [
340 ":tcmalloc",
341 ],
342)
343
344cc_test(
345 name = "malloc_hook_test",
346 size = "small",
347 srcs = [
348 "src/tests/malloc_hook_test.cc",
349 ],
350 copts = common_copts + compiler_select({
351 "gcc": [
352 "-Wno-maybe-uninitialized",
353 ],
354 "clang": [],
355 }),
Philipp Schraderdada1072020-11-24 11:34:46 -0800356 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800357 deps = [
358 ":tcmalloc",
359 ":testutil",
360 ],
361)
362
363cc_test(
364 name = "malloc_extension_test",
365 size = "small",
366 srcs = empty_main_if_asan([
367 "src/tests/malloc_extension_test.cc",
368 ]),
369 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800370 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800371 deps = [
372 ":tcmalloc",
373 ],
374)
375
376cc_test(
377 name = "malloc_extension_c_test",
378 size = "small",
379 srcs = empty_main_if_asan([
380 "src/tests/malloc_extension_c_test.c",
381 ]),
382 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800383 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800384 deps = [
385 ":tcmalloc",
386 ],
387)
388
389cc_test(
390 name = "memalign_unittest",
391 size = "small",
392 srcs = empty_main_if_asan([
393 "src/tests/memalign_unittest.cc",
394 ]),
395 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800396 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800397 deps = [
398 ":tcmalloc",
399 ":testutil",
400 ],
401)
402
403cc_test(
404 name = "page_heap_test",
405 size = "small",
406 srcs = [
407 "src/tests/page_heap_test.cc",
408 ],
409 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800410 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800411 deps = [
412 ":tcmalloc",
413 ],
414)
415
416cc_test(
417 name = "pagemap_unittest",
418 size = "small",
419 srcs = empty_main_if_asan([
420 "src/tests/pagemap_unittest.cc",
421 ]),
422 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800423 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800424 deps = [
425 ":tcmalloc",
426 ],
427)
428
429cc_test(
430 name = "realloc_unittest",
431 size = "small",
432 srcs = [
433 "src/tests/realloc_unittest.cc",
434 ],
435 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800436 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800437 deps = [
438 ":tcmalloc",
439 ],
440)
441
442cc_test(
443 name = "stack_trace_table_test",
444 size = "small",
445 srcs = [
446 "src/tests/stack_trace_table_test.cc",
447 ],
448 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800449 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800450 deps = [
451 ":tcmalloc",
452 ],
453)
454
455cc_test(
456 name = "thread_dealloc_unittest",
457 size = "small",
458 srcs = [
459 "src/tests/thread_dealloc_unittest.cc",
460 ],
461 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800462 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800463 deps = [
464 ":tcmalloc",
465 ":testutil",
466 ],
467)
468
469"""
Brian Silverman660d6092015-11-26 18:41:59 -0500470We don't build this because it actually needs to be in a separate binary.
471cc_test(
472 name = 'debugallocation_test',
473 srcs = [
474 'src/tests/debugallocation_test.cc',
475 ],
476 deps = [
477 ':tcmalloc',
478 ],
479 copts = common_copts,
480 size = 'small',
481)
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800482"""
Brian Silverman660d6092015-11-26 18:41:59 -0500483
484cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800485 name = "tcmalloc_large_heap_fragmentation_unittest",
486 size = "small",
487 srcs = empty_main_if_asan([
488 "src/tests/large_heap_fragmentation_unittest.cc",
489 ]),
490 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800491 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800492 deps = [
493 ":tcmalloc",
494 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500495)
496
497cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800498 name = "raw_printer_test",
499 size = "small",
500 srcs = [
501 "src/tests/raw_printer_test.cc",
502 ],
503 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800504 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800505 deps = [
506 ":tcmalloc",
507 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500508)
509
510cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800511 name = "getpc_test",
512 size = "small",
513 srcs = empty_main_if_asan([
514 "src/tests/getpc_test.cc",
515 ]),
516 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800517 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800518 deps = [
519 ":tcmalloc",
520 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500521)
522
523cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800524 name = "profiledata_unittest",
525 size = "small",
526 srcs = [
527 "src/tests/profiledata_unittest.cc",
528 ],
529 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800530 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800531 deps = [
532 ":tcmalloc",
533 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500534)
535
536cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800537 name = "profile_handler_unittest",
538 size = "small",
539 srcs = [
540 "src/tests/profile-handler_unittest.cc",
541 ],
542 copts = common_copts,
543 flaky = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800544 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800545 deps = [
546 ":tcmalloc",
547 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500548)
549
550cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800551 name = "heap_profiler_unittest",
552 size = "small",
553 srcs = [
554 "src/tests/heap-profiler_unittest.cc",
555 ],
556 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800557 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800558 deps = [
559 ":tcmalloc",
560 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500561)
562
563cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800564 name = "sampler_test",
565 size = "small",
566 srcs = [
567 "src/tests/sampler_test.cc",
568 ],
569 copts = common_copts + [
570 "-Wno-type-limits",
571 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800572 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800573 deps = [
574 ":tcmalloc",
575 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500576)