diff options
Diffstat (limited to 'verif')
-rw-r--r-- | verif/checker/tosa_result_checker.py | 21 | ||||
-rw-r--r-- | verif/checker/verifier.py | 2 | ||||
-rw-r--r-- | verif/generator/datagenerator.py | 2 |
3 files changed, 17 insertions, 8 deletions
diff --git a/verif/checker/tosa_result_checker.py b/verif/checker/tosa_result_checker.py index 8c7e432..6948378 100644 --- a/verif/checker/tosa_result_checker.py +++ b/verif/checker/tosa_result_checker.py @@ -63,18 +63,25 @@ def compliance_check( ofm_name, verify_lib_path, ): - try: - vlib = VerifierLibrary(verify_lib_path) - except VerifierError as e: + if verify_lib_path is None: + error = "Please supply --verify-lib-path" + else: + error = None + try: + vlib = VerifierLibrary(verify_lib_path) + except VerifierError as e: + error = str(e) + + if error is not None: _print_result(LogColors.RED, f"INTERNAL ERROR {test_name}") - msg = f"Could not load verfier library: {str(e)}" + msg = f"Could not load verfier library: {error}" return (TestResult.INTERNAL_ERROR, 0.0, msg) success = vlib.verify_data( ofm_name, compliance_config, imp_result_path, ref_result_path, bnd_result_path ) if success: - _print_result(LogColors.GREEN, f"Results PASS {test_name}") + _print_result(LogColors.GREEN, f"Compliance Results PASS {test_name}") return (TestResult.PASS, 0.0, "") else: _print_result(LogColors.RED, f"Results NON-COMPLIANT {test_name}") @@ -279,8 +286,10 @@ def main(argv=None): "--fp-tolerance", type=float, default=DEFAULT_FP_TOLERANCE, help="FP tolerance" ) parser.add_argument( - "--test_path", type=Path, help="path to the test that produced the results" + "--test-path", type=Path, help="path to the test that produced the results" ) + # Deprecate the incorrectly formatted option by hiding it + parser.add_argument("--test_path", type=Path, help=argparse.SUPPRESS) parser.add_argument( "--bnd-result-path", type=Path, diff --git a/verif/checker/verifier.py b/verif/checker/verifier.py index 684bea3..839aec2 100644 --- a/verif/checker/verifier.py +++ b/verif/checker/verifier.py @@ -48,7 +48,7 @@ class VerifierLibrary: def __init__(self, verify_lib_path): """Find the library and set up the interface.""" self.lib_path = verify_lib_path - if not self.lib_path.is_file(): + if self.lib_path is None or not self.lib_path.is_file(): raise VerifierError(f"Could not find verify library - {self.lib_path}") self.lib = ct.cdll.LoadLibrary(self.lib_path) diff --git a/verif/generator/datagenerator.py b/verif/generator/datagenerator.py index 9de421b..0dd60e5 100644 --- a/verif/generator/datagenerator.py +++ b/verif/generator/datagenerator.py @@ -27,7 +27,7 @@ class GenerateLibrary: def __init__(self, generate_lib_path): """Find the library and set up the interface.""" self.lib_path = generate_lib_path - if not self.lib_path.is_file(): + if self.lib_path is None or not self.lib_path.is_file(): raise GenerateError(f"Could not find generate library - {self.lib_path}") self.schema_validator = sch.TestDescSchemaValidator() |