diff --git a/hatlib/verify_hat_package.py b/hatlib/verify_hat_package.py index 8890312..4fe1360 100644 --- a/hatlib/verify_hat_package.py +++ b/hatlib/verify_hat_package.py @@ -9,21 +9,34 @@ def verify_hat_package(hat_path): _, funcs = hat.load(hat_path) inputs = hat.generate_input_sets_for_hat_file(hat_path) for name, fn in funcs.items(): - print(f"Verifying function {name} --") + print(f"\n{'*' * 10}\n") + + print(f"[*] Verifying function {name} --") func_inputs = inputs[name] - print("Inputs before function call:") + print("[*] Inputs before function call:") for i, func_input in enumerate(func_inputs): - print(f"\tInput {i}: {','.join(map(str, func_input.ravel()[:32]))}") + print(f"[*]\tInput {i}: {','.join(map(str, func_input.ravel()[:32]))}") - time = fn(*inputs[name]) + try: + + time = fn(*inputs[name]) + except RuntimeError as e: + print(f"[!] Error while running {name}: {e}") + continue + print("Inputs after function call:") for i, func_input in enumerate(func_inputs): - print(f"\tInput {i}: {','.join(map(str, func_input.ravel()[:32]))}") + print(f"[*]\tInput {i}: {','.join(map(str, func_input.ravel()[:32]))}") if time: - print(f"Function execution time: {time:4f}ms") + print(f"[*] Function execution time: {time:4f}ms") + + del inputs[name] + + else: + print(f"\n{'*' * 10}\n") def main():