Skip to content

Commit

Permalink
#43: Can explicitly exclude symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
theHolgi committed Mar 20, 2024
1 parent 77bd43b commit 52040ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hammocking/hammocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ def main(pargv):
arg.add_argument("--style", "-t", help="Mockup style to output", required=False, default="gmock")
arg.add_argument("--suffix", help="Suffix to be added to the generated files", required=False)
arg.add_argument("--except", help="Path prefixes that should not be mocked", nargs="*", dest="exclude_pathes", default=["/usr/include"])
arg.add_argument("--exclude", help="Symbols that should not be mocked", nargs="*", default=[])
arg.add_argument("--config", help="Configuration file", required=False, default="")
args, cmd_args = arg.parse_known_args(args=pargv)

Expand All @@ -312,6 +313,8 @@ def main(pargv):
if not args.symbols:
args.symbols = NmWrapper(args.plink).get_undefined_symbols()

args.symbols -= set(args.exclude)

logging.debug("Extra arguments: %s" % cmd_args)

h = Hammock(symbols=args.symbols, cmd_args=cmd_args, mockup_style=args.style, suffix=args.suffix)
Expand Down

0 comments on commit 52040ab

Please sign in to comment.