blob: 3eaab4b536741035de4f9402baaca9b1c426c821 [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-cast-qual",
James Kuszmaul9776b392023-01-14 14:08:08 -080036 "-Wno-array-bounds",
37 "-Wno-cast-function-type",
Brian Silverman660d6092015-11-26 18:41:59 -050038
Brian Silvermana659aaa2022-01-02 00:19:11 -080039 # //build_tests:tcmalloc_build_test relies on this.
40 "-DENABLE_LARGE_ALLOC_REPORT=1",
41
42 # Stuff pulled out of config.h.
43 "-DGPERFTOOLS_CONFIG_H_=1",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080044 "-DHAVE_BUILTIN_EXPECT=1",
Philipp Schrader9b1790e2018-03-10 20:21:30 -080045 "-DHAVE_DECL_MEMALIGN=1",
46 "-DHAVE_DECL_POSIX_MEMALIGN=1",
47 "-DHAVE_DECL_PVALLOC=1",
48 "-DHAVE_DECL_UNAME=1",
49 "-DHAVE_DECL_VALLOC=1",
50 "-DHAVE_DLFCN_H=1",
51 "-DHAVE_ELF32_VERSYM=1",
52 "-DHAVE_EXECINFO_H=1",
53 "-DHAVE_FCNTL_H=1",
54 "-DHAVE_FEATURES_H=1",
55 "-DHAVE_FORK=1",
56 "-DHAVE_GETEUID=1",
57 "-DHAVE_GLOB_H=1",
58 "-DHAVE_GRP_H=1",
59 "-DHAVE_INTTYPES_H=1",
60 "-DHAVE_LINUX_PTRACE_H=1",
61 "-DHAVE_LINUX_SIGEV_THREAD_ID=1",
62 "-DHAVE_MALLOC_H=1",
63 "-DHAVE_MEMORY_H=1",
64 "-DHAVE_MMAP=1",
65 "-DHAVE_NAMESPACES=1",
66 "-DHAVE_POLL_H=1",
67 "-DHAVE_PROGRAM_INVOCATION_NAME=1",
68 "-DHAVE_PTHREAD=1",
69 "-DHAVE_PWD_H=1",
70 "-DHAVE_SBRK=1",
71 "-DHAVE_SCHED_H=1",
72 "-DHAVE_STDINT_H=1",
73 "-DHAVE_STDLIB_H=1",
74 "-DHAVE_STRINGS_H=1",
75 "-DHAVE_STRING_H=1",
76 "-DHAVE_STRUCT_MALLINFO=1",
77 "-DHAVE_SYS_CDEFS_H=1",
78 "-DHAVE_SYS_PRCTL_H=1",
79 "-DHAVE_SYS_RESOURCE_H=1",
80 "-DHAVE_SYS_SOCKET_H=1",
81 "-DHAVE_SYS_STAT_H=1",
82 "-DHAVE_SYS_SYSCALL_H=1",
83 "-DHAVE_SYS_TYPES_H=1",
84 "-DHAVE_SYS_UCONTEXT_H=1",
85 "-DHAVE_SYS_WAIT_H=1",
86 "-DHAVE_TLS=1",
87 "-DHAVE_UCONTEXT_H=1",
88 "-DHAVE_UNISTD_H=1",
89 "-DHAVE_UNWIND_H=1",
90 "-DHAVE___ATTRIBUTE__=1",
91 "-DHAVE___ENVIRON=1",
92 "-DMALLOC_HOOK_MAYBE_VOLATILE=volatile",
93 "-DPERFTOOLS_DLL_DECL=",
94 "-DSTDC_HEADERS=1",
95 "-DSTL_NAMESPACE=std",
Brian Silvermana659aaa2022-01-02 00:19:11 -080096 "-DPACKAGE_STRING=\\\"gperftools\\ 2.9.1\\\"",
Austin Schuha5778ae2020-10-21 21:15:35 -070097 "-DPACKAGE_BUGREPORT=\\\"https://frc971.org/contact\\\"",
Brian Silvermana659aaa2022-01-02 00:19:11 -080098 "-DPACKAGE_VERSION=\\\"2.9.1\\\"",
Brian Silverman660d6092015-11-26 18:41:59 -050099] + cpu_select({
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800100 "amd64": [
101 "-DHAVE_GETPAGESZE=1",
102 "-DHAVE_SYS_PARAM_H=1",
103 "-DPC_FROM_UCONTEXT=uc_mcontext.gregs[REG_RIP]",
104 "-DPRIdS=\\\"ld\\\"",
105 "-DPRIuS=\\\"lu\\\"",
106 "-DPRIxS=\\\"lx\\\"",
107 ],
Philipp Schraderf1bbf342022-02-05 14:30:15 -0800108 "arm32": [
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800109 "-DPC_FROM_UCONTEXT=uc_mcontext.arm_pc",
110 "-DPRIdS=\\\"d\\\"",
111 "-DPRIuS=\\\"u\\\"",
112 "-DPRIxS=\\\"x\\\"",
113 ],
Philipp Schraderf1bbf342022-02-05 14:30:15 -0800114 "arm64": [
115 "-DPC_FROM_UCONTEXT=uc_mcontext.pc",
116 "-DPRIdS=\\\"ld\\\"",
117 "-DPRIuS=\\\"lu\\\"",
118 "-DPRIxS=\\\"lx\\\"",
119 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500120}) + compiler_select({
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800121 "clang": [
122 "-Wno-unused-const-variable",
Brian Silverman4c7235a2021-11-17 19:04:37 -0800123 "-Wno-unused-but-set-variable",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800124 "-Wno-gnu-alignof-expression",
125 "-Wno-unused-private-field",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800126
127 # It has annotations for this analysis, but the invariants are too tricky
128 # for clang to figure out by itself so it has lots of false positives. Just
129 # disable the analysis to simplify.
130 "-Wno-thread-safety-analysis",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800131 ],
James Kuszmaul9776b392023-01-14 14:08:08 -0800132 "gcc": [
133 "-Wno-use-after-free",
134 "-Wno-ignored-qualifiers",
135 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500136})
137
138cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800139 name = "tcmalloc",
140 srcs = glob(
141 include = [
142 "src/*.cc",
143 "src/*.c",
144 "src/base/*.cc",
145 "src/base/*.c",
146 ],
147 exclude = [
148 "**/*_unittest.cc",
149 "**/*_test.cc",
150 "src/debugallocation.cc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800151 "src/fake_stacktrace_scope.cc",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800152 ],
153 ),
154 hdrs = glob([
155 "src/*.h",
156 "src/base/*.h",
157 "src/gperftools/*.h",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800158 ]),
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800159 copts = common_copts,
Austin Schuhdde64052019-12-11 20:28:00 -0800160 includes = ["src"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800161 linkopts = [
162 "-lrt",
163 "-lpthread",
164 ],
Austin Schuha4f69d62020-02-28 13:58:14 -0800165 nocopts = "-std=gnu\\+\\+1y",
Philipp Schraderdada1072020-11-24 11:34:46 -0800166 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800167 visibility = ["//visibility:public"],
168 deps = [
169 "//third_party/empty_config_h",
170 ],
171 alwayslink = True,
Brian Silverman660d6092015-11-26 18:41:59 -0500172)
173
174cc_library(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800175 name = "testutil",
176 srcs = [
177 "src/tests/testutil.cc",
Brian Silverman660d6092015-11-26 18:41:59 -0500178 ],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800179 hdrs = [
180 "src/tests/testutil.h",
181 ],
182 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800183 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800184 deps = [
185 ":tcmalloc",
186 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500187)
188
189cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800190 name = "low_level_alloc_unittest",
191 size = "medium",
192 srcs = [
193 "src/tests/low_level_alloc_unittest.cc",
194 ],
195 copts = common_copts,
196 defines = [
197 "NO_TCMALLOC_SAMPLES",
198 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800199 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800200 deps = [
201 ":tcmalloc",
202 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500203)
204
205cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800206 name = "atomicops_unittest",
207 size = "small",
208 srcs = [
209 "src/tests/atomicops_unittest.cc",
210 ],
211 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800212 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800213 deps = [
214 ":tcmalloc",
215 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500216)
217
218cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800219 name = "stacktrace_unittest",
220 size = "small",
221 srcs = [
222 "src/tests/stacktrace_unittest.cc",
223 ],
224 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800225 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800226 deps = [
227 ":tcmalloc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800228 ":testutil",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800229 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500230)
231
232cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800233 name = "tcmalloc_unittest",
234 size = "small",
235 srcs = empty_main_if_asan([
236 "src/tests/tcmalloc_unittest.cc",
237 ]),
238 copts = common_copts + [
239 "-fno-builtin",
Austin Schuhdde64052019-12-11 20:28:00 -0800240 #Add this back in when we upgrade clang.
241 #'-Wno-mismatched-new-delete',
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800242 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800243 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800244 deps = [
245 ":tcmalloc",
246 ":testutil",
247 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500248)
249
250cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800251 name = "tcmalloc_large_unittest",
252 size = "small",
253 srcs = empty_main_if_asan([
254 "src/tests/tcmalloc_large_unittest.cc",
255 ]),
256 copts = common_copts + [
257 "-fno-builtin",
258 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800259 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800260 deps = [
261 ":tcmalloc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800262 ":testutil",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800263 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500264)
265
266cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800267 name = "addressmap_unittest",
268 size = "medium",
269 srcs = [
270 "src/tests/addressmap_unittest.cc",
271 ],
272 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800273 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800274 deps = [
275 ":tcmalloc",
276 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500277)
278
279cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800280 name = "system_alloc_unittest",
281 size = "small",
282 srcs = empty_main_if_asan([
283 "src/tests/system-alloc_unittest.cc",
284 ]),
285 copts = common_copts + [
286 "-fno-builtin",
287 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800288 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800289 deps = [
290 ":tcmalloc",
Brian Silvermana659aaa2022-01-02 00:19:11 -0800291 ":testutil",
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800292 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500293)
294
295cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800296 name = "packed_cache_test",
297 size = "small",
298 srcs = [
299 "src/tests/packed-cache_test.cc",
300 ],
301 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800302 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800303 deps = [
304 ":tcmalloc",
305 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500306)
307
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800308cc_test(
309 name = "frag_unittest",
310 size = "small",
311 srcs = [
312 "src/tests/frag_unittest.cc",
313 ],
314 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800315 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800316 deps = [
317 ":tcmalloc",
318 ],
319)
320
321cc_test(
322 name = "markidle_unittest",
323 size = "small",
324 srcs = empty_main_if_asan([
325 "src/tests/markidle_unittest.cc",
326 ]),
327 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800328 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800329 deps = [
330 ":tcmalloc",
331 ":testutil",
332 ],
333)
334
335cc_test(
336 name = "current_allocated_bytes_test",
337 size = "small",
338 srcs = [
339 "src/tests/current_allocated_bytes_test.cc",
340 ],
341 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800342 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800343 deps = [
344 ":tcmalloc",
345 ],
346)
347
348cc_test(
349 name = "malloc_hook_test",
350 size = "small",
351 srcs = [
352 "src/tests/malloc_hook_test.cc",
353 ],
354 copts = common_copts + compiler_select({
355 "gcc": [
356 "-Wno-maybe-uninitialized",
357 ],
358 "clang": [],
359 }),
Philipp Schraderdada1072020-11-24 11:34:46 -0800360 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800361 deps = [
362 ":tcmalloc",
363 ":testutil",
364 ],
365)
366
367cc_test(
368 name = "malloc_extension_test",
369 size = "small",
370 srcs = empty_main_if_asan([
371 "src/tests/malloc_extension_test.cc",
372 ]),
373 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800374 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800375 deps = [
376 ":tcmalloc",
377 ],
378)
379
380cc_test(
381 name = "malloc_extension_c_test",
382 size = "small",
383 srcs = empty_main_if_asan([
384 "src/tests/malloc_extension_c_test.c",
385 ]),
386 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800387 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800388 deps = [
389 ":tcmalloc",
390 ],
391)
392
393cc_test(
394 name = "memalign_unittest",
395 size = "small",
396 srcs = empty_main_if_asan([
397 "src/tests/memalign_unittest.cc",
398 ]),
399 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800400 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800401 deps = [
402 ":tcmalloc",
403 ":testutil",
404 ],
405)
406
407cc_test(
408 name = "page_heap_test",
409 size = "small",
410 srcs = [
411 "src/tests/page_heap_test.cc",
412 ],
413 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800414 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800415 deps = [
416 ":tcmalloc",
417 ],
418)
419
420cc_test(
421 name = "pagemap_unittest",
422 size = "small",
423 srcs = empty_main_if_asan([
424 "src/tests/pagemap_unittest.cc",
425 ]),
426 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800427 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800428 deps = [
429 ":tcmalloc",
430 ],
431)
432
433cc_test(
434 name = "realloc_unittest",
435 size = "small",
436 srcs = [
437 "src/tests/realloc_unittest.cc",
438 ],
439 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800440 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800441 deps = [
442 ":tcmalloc",
443 ],
444)
445
446cc_test(
447 name = "stack_trace_table_test",
448 size = "small",
449 srcs = [
450 "src/tests/stack_trace_table_test.cc",
451 ],
452 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800453 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800454 deps = [
455 ":tcmalloc",
456 ],
457)
458
459cc_test(
460 name = "thread_dealloc_unittest",
461 size = "small",
462 srcs = [
463 "src/tests/thread_dealloc_unittest.cc",
464 ],
465 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800466 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800467 deps = [
468 ":tcmalloc",
469 ":testutil",
470 ],
471)
472
473"""
Brian Silverman660d6092015-11-26 18:41:59 -0500474We don't build this because it actually needs to be in a separate binary.
475cc_test(
476 name = 'debugallocation_test',
477 srcs = [
478 'src/tests/debugallocation_test.cc',
479 ],
480 deps = [
481 ':tcmalloc',
482 ],
483 copts = common_copts,
484 size = 'small',
485)
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800486"""
Brian Silverman660d6092015-11-26 18:41:59 -0500487
488cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800489 name = "tcmalloc_large_heap_fragmentation_unittest",
490 size = "small",
491 srcs = empty_main_if_asan([
492 "src/tests/large_heap_fragmentation_unittest.cc",
493 ]),
494 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800495 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800496 deps = [
497 ":tcmalloc",
498 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500499)
500
501cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800502 name = "raw_printer_test",
503 size = "small",
504 srcs = [
505 "src/tests/raw_printer_test.cc",
506 ],
507 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800508 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800509 deps = [
510 ":tcmalloc",
511 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500512)
513
514cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800515 name = "getpc_test",
516 size = "small",
517 srcs = empty_main_if_asan([
518 "src/tests/getpc_test.cc",
519 ]),
520 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800521 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800522 deps = [
523 ":tcmalloc",
524 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500525)
526
527cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800528 name = "profiledata_unittest",
529 size = "small",
530 srcs = [
531 "src/tests/profiledata_unittest.cc",
532 ],
533 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800534 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800535 deps = [
536 ":tcmalloc",
537 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500538)
539
540cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800541 name = "profile_handler_unittest",
542 size = "small",
543 srcs = [
544 "src/tests/profile-handler_unittest.cc",
545 ],
546 copts = common_copts,
547 flaky = True,
Philipp Schraderdada1072020-11-24 11:34:46 -0800548 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800549 deps = [
550 ":tcmalloc",
551 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500552)
553
554cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800555 name = "heap_profiler_unittest",
556 size = "small",
557 srcs = [
558 "src/tests/heap-profiler_unittest.cc",
559 ],
560 copts = common_copts,
Philipp Schraderdada1072020-11-24 11:34:46 -0800561 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800562 deps = [
563 ":tcmalloc",
564 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500565)
566
567cc_test(
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800568 name = "sampler_test",
569 size = "small",
570 srcs = [
571 "src/tests/sampler_test.cc",
572 ],
573 copts = common_copts + [
574 "-Wno-type-limits",
575 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800576 target_compatible_with = ["@platforms//os:linux"],
Philipp Schrader9b1790e2018-03-10 20:21:30 -0800577 deps = [
578 ":tcmalloc",
579 ],
Brian Silverman660d6092015-11-26 18:41:59 -0500580)