Skip to content

Commit

Permalink
update usage of cpp_unittest
Browse files Browse the repository at this point in the history
Summary:
This doesnt yet get rid of tags inside of cpp_unittest but rather on every target that uses that atttribute.

generated using the following commands. to find all usages:
```
fbgs cpp_unittest --in "tags =" --forcedir "fbcode" | cut -d':' -f1 | uniq > cpp_unittests_with_tags
```
to update the targets:
```
cat cpp_unittests_with_tags | xargs -I{} arc buildozer 'rename tags labels' {}:%cpp_unittest
```

Reviewed By: jermenkoo, dtolnay

Differential Revision: D66903768

fbshipit-source-id: 26ffb43bf1877f82a81342ed23431a6dbd931f6f
  • Loading branch information
annakukliansky authored and facebook-github-bot committed Dec 9, 2024
1 parent 5620dfc commit 44e3865
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions folly/debugging/symbolizer/test/validate_folly_symbolizer.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,18 @@ load("@fbcode_macros//build_defs:custom_unittest.bzl", "custom_unittest")

SPLIT_DWARF_FLAGS = {
"none": ["-gno-split-dwarf"],
"single_inlining": ["-gsplit-dwarf=single", "-fsplit-dwarf-inlining"],
"single_no_inlining": ["-gsplit-dwarf=single", "-fno-split-dwarf-inlining"],
"split_no_inlining": ["-gsplit-dwarf=split", "-fno-split-dwarf-inlining"],
"single_inlining": [
"-gsplit-dwarf=single",
"-fsplit-dwarf-inlining",
],
"single_no_inlining": [
"-gsplit-dwarf=single",
"-fno-split-dwarf-inlining",
],
"split_no_inlining": [
"-gsplit-dwarf=split",
"-fno-split-dwarf-inlining",
],
}

def _dwarf_size_flag(size):
Expand Down Expand Up @@ -35,7 +44,7 @@ def customized_unittest(
for use_aaranges in [False, True]:
cpp_library(
name = "symbolizer_test_utils_" + dwarf_version +
("_dwarf{}".format(dwarf_size)) +
"_dwarf{}".format(dwarf_size) +
("" if split_dwarf_option == "none" else "_" + split_dwarf_option) +
("_aaranges" if use_aaranges else "_noaaranges") + custom_suffix,
srcs = ["SymbolizerTestUtils.cpp"],
Expand All @@ -48,39 +57,39 @@ def customized_unittest(
# flags from dropping debug info.
compiler_flags = ["-g"] +
(["-gdwarf-5"] if dwarf_version == "dwarf5" else ["-gdwarf-4"]) +
(_dwarf_size_flag(dwarf_size)) +
_dwarf_size_flag(dwarf_size) +
SPLIT_DWARF_FLAGS[split_dwarf_option] +
(["-gdwarf-aranges"] if use_aaranges else []) +
extra_compiler_flags,
modular_headers = False,
target_compatible_with = ["fbcode//opensource/macros:broken-in-oss"],
private_linker_flags = [
"--emit-relocs", # makes linker ignore `--strip-debug-*` flags
],
target_compatible_with = ["fbcode//opensource/macros:broken-in-oss"],
)
cpp_unittest(
name = "symbolizer_test_" + dwarf_version +
("_dwarf{}".format(dwarf_size)) +
"_dwarf{}".format(dwarf_size) +
("" if split_dwarf_option == "none" else "_" + split_dwarf_option) +
("_aaranges" if use_aaranges else "_noaaranges") + custom_suffix,
srcs = ["SymbolizerTest.cpp"],
supports_static_listing = True,
tags = ["dwp"] if split_dwarf_option == "single_inlining" and use_aaranges else [],
# This tests requires full debug info, so use `-g` to override the platform
# default, and use `--emit-relocs` to prevent `--strip-debug-*` flags from
# dropping debug info.
compiler_flags = ["-g"] +
(["-gdwarf-5"] if dwarf_version == "dwarf5" else ["-gdwarf-4"]) +
(_dwarf_size_flag(dwarf_size)) +
_dwarf_size_flag(dwarf_size) +
SPLIT_DWARF_FLAGS[split_dwarf_option] +
(["-gdwarf-aranges"] if use_aaranges else []) + extra_compiler_flags,
labels = ["dwp"] if split_dwarf_option == "single_inlining" and use_aaranges else [],
linker_flags = [
"--emit-relocs", # makes linker ignore `--strip-debug-*` flags
],
supports_static_listing = True,
target_compatible_with = ["fbcode//opensource/macros:broken-in-oss"],
deps = [
":symbolizer_test_utils_" + dwarf_version +
("_dwarf{}".format(dwarf_size)) +
"_dwarf{}".format(dwarf_size) +
("" if split_dwarf_option == "none" else "_" + split_dwarf_option) +
("_aaranges" if use_aaranges else "_noaaranges"), # @manual
"//folly:demangle",
Expand Down

0 comments on commit 44e3865

Please sign in to comment.