diff options
| author | Léo Lam <leo@leolam.fr> | 2021-07-31 12:23:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-31 12:23:40 +0200 |
| commit | 71fc0f35e81402a7c2954bd0ca12352ea2550858 (patch) | |
| tree | 630aa9546bae7ea8e6f377dcf25f1b879c8f3a53 /tools/progress.py | |
| parent | ea030c356cf283e5cf0bde58ea08a445504573f4 (diff) | |
| parent | 6e30bbea3274679c34832182dcbeb4ed1211dd16 (diff) | |
Merge pull request #51 from leoetlino/optimized-checker
tools: Add a new, optimized check tool
Diffstat (limited to 'tools/progress.py')
| -rwxr-xr-x | tools/progress.py | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/tools/progress.py b/tools/progress.py index 155a6572..f5166701 100755 --- a/tools/progress.py +++ b/tools/progress.py @@ -2,8 +2,6 @@ import argparse from collections import defaultdict from colorama import Back, Fore, Style -import enum -from pathlib import Path from util import utils from util.utils import FunctionStatus import typing as tp @@ -17,8 +15,6 @@ parser.add_argument("--print-eq", "-e", action="store_true", help="Print non-matching functions with minor issues") parser.add_argument("--print-ok", "-m", action="store_true", help="Print matching functions") -parser.add_argument("--hide-nonmatchings-with-dumps", "-H", help="Hide non-matching functions that have expected " - "output dumps", action="store_true") args = parser.parse_args() code_size_total = 0 @@ -26,15 +22,6 @@ num_total = 0 code_size: tp.DefaultDict[FunctionStatus, int] = defaultdict(int) counts: tp.DefaultDict[FunctionStatus, int] = defaultdict(int) -nonmatching_fns_with_dump = {p.stem for p in (Path(__file__).parent.parent / "expected").glob("*.bin")} - - -def should_hide_nonmatching(name: str) -> bool: - if not args.hide_nonmatchings_with_dumps: - return False - return name in nonmatching_fns_with_dump - - for info in utils.get_functions(): code_size_total += info.size num_total += 1 @@ -47,10 +34,10 @@ for info in utils.get_functions(): if not args.csv: if info.status == FunctionStatus.NonMatching: - if args.print_nm and not should_hide_nonmatching(info.decomp_name): + if args.print_nm: print(f"{Fore.RED}NM{Fore.RESET} {utils.format_symbol_name(info.decomp_name)}") elif info.status == FunctionStatus.Equivalent: - if args.print_eq and not should_hide_nonmatching(info.decomp_name): + if args.print_eq: print(f"{Fore.YELLOW}EQ{Fore.RESET} {utils.format_symbol_name(info.decomp_name)}") elif info.status == FunctionStatus.Matching: if args.print_ok: |
