Lines Matching +full:- +full:f

19 sys.path.insert(0, str(Path(__file__).parent / "junit-xml"))
35 raise ValueError(f"{type} must be an Enum")
65 csv_rtol: float = -1
66 csv_ztol: float = -1
67 cgns_tol: float = -1
88 def get_source_path(self, test: str) -> Path:
100 def get_run_path(self, test: str) -> Path:
112 def get_output_path(self, test: str, output_file: str) -> Path:
125 def test_failure_artifacts_path(self) -> Path:
132 return getattr(self, '_cgns_tol', 1.0e-12)
141 return getattr(self, '_csv_ztol', 3e-10)
150 return getattr(self, '_csv_rtol', 1e-6)
157 def csv_comment_diff_fn(self): # -> Any | Callable[..., None]:
172 def post_test_hook(self, test: str, spec: TestSpec, backend: str) -> None:
181 def check_pre_skip(self, test: str, spec: TestSpec, resource: str, nproc: int) -> Optional[str]:
195 … def check_post_skip(self, test: str, spec: TestSpec, resource: str, stderr: str) -> Optional[str]:
209 …def check_required_failure(self, test: str, spec: TestSpec, resource: str, stderr: str) -> Tuple[s…
223 def check_allowed_stdout(self, test: str) -> bool:
235 def has_cgnsdiff() -> bool:
247 return 'not found' not in proc.stderr.decode('utf-8')
250 def contains_any(base: str, substrings: List[str]) -> bool:
263 def startswith_any(base: str, prefixes: List[str]) -> bool:
276 def find_matching(line: str, open: str = '(', close: str = ')') -> Tuple[int, int]:
297 return -1, -1
303 count -= 1
306 return start, -1
309 def parse_test_line(line: str, fallback_name: str = '') -> TestSpec:
319 field_names = [f.name for f in test_fields]
326 raise ParseError(f"Mismatched parentheses in TESTCASE: {line}")
331 …([A-Za-z]+[\w\-]+) # match key starting with alpha, containing alphanumeric, _, or -; captured as…
371 print(f"warning, unknown TESTCASE option for test '{known['name']}': {k}={v}")
375 def get_test_args(source_file: Path) -> List[TestSpec]:
397 raise RuntimeError(f'Unrecognized extension for file: {source_file}')
401 …if line.startswith(f'{comment_str}TESTARGS')] or [TestSpec(source_file.stem, args=['{ceed_resource…
405 …comment_str: str = '#', comment_func: Optional[Callable[[str, str], Optional[str]]] = None) -> str:
412 rel_tol (float): Relative tolerance for comparing non-zero values.
423 return f'No lines found in test output {test_csv}'
425 return f'No lines found in test source {true_csv}'
427 return f'Number of lines in {test_csv} and {true_csv} do not match'
438 return f'Commented line found in {test_csv} at line {n} but not in {true_csv}'
440 return f'Commented line found in {true_csv} at line {n} but not in {test_csv}'
451 return f'No CSV columns found in test output {test_csv}'
453 return f'No CSV columns found in test source {true_csv}'
455 return ''.join(difflib.unified_diff([f'{test_lines[0]}\n'], [f'{true_lines[0]}\n'],
473 diff_lines.append(f'column: {key}, expected: {true_val}, got: {test_val}')
476 … diff_lines.append(f'column: {key}, expected: {true_line[key]}, got: {test_line[key]}')
481 def diff_cgns(test_cgns: Path, true_cgns: Path, cgns_tol: float) -> str:
487 cgns_tol (float): Tolerance for comparing floating-point values
494 run_args: List[str] = ['cgnsdiff', '-d', '-t', f'{cgns_tol}', str(test_cgns), str(true_cgns)]
501 return proc.stderr.decode('utf-8') + proc.stdout.decode('utf-8')
504 def diff_ascii(test_file: Path, true_file: Path, backend: str) -> str:
514 tmp_backend: str = backend.replace('/', '-')
524 backend: str, test: str, index: int, verbose: bool) -> str:
529 …output_str += f' ok {index} - {spec.name}, {backend} # SKIP {test_case.skipped[0]["message"]}\n'
531 … output_str += f' not ok {index} - {spec.name}, {backend} ({test_case.elapsed_sec} s)\n'
533 output_str += f' ok {index} - {spec.name}, {backend} ({test_case.elapsed_sec} s)\n'
535 output_str += f' ---\n'
537 output_str += f' only: {",".join(spec.only)}\n'
538 output_str += f' args: {test_case.args}\n'
540 output_str += f' csv_ztol: {spec.csv_ztol}\n'
542 output_str += f' csv_rtol: {spec.csv_rtol}\n'
544 output_str += f' cgns_tol: {spec.cgns_tol}\n'
546 output_str += f' {k}: {v}\n'
548 output_str += f' error: {test_case.errors[0]["message"]}\n'
550 output_str += f' failures:\n'
552 output_str += f' -\n'
553 output_str += f' message: {failure["message"]}\n'
556 output_str += f' output: |\n {out}\n'
557 output_str += f' ...\n'
561 output_str += f'Test: {test} {spec.name}\n'
562 output_str += f' $ {test_case.args}\n'
573 def save_failure_artifact(suite_spec: SuiteSpec, file: Path) -> Path:
586 mode: RunMode, nproc: int, suite_spec: SuiteSpec, verbose: bool = False) -> TestCase:
603 run_args: List = [f'{suite_spec.get_run_path(test)}', *map(str, spec.args)]
609 run_args[i] = arg.replace('{ceed_resource}', backend.replace('/', '-'))
611 run_args[run_args.index('{nproc}')] = f'{nproc}'
613 run_args = ['mpiexec', '-n', f'{nproc}', *run_args]
618 test_case: TestCase = TestCase(f'{test}, "{spec.name}", n{nproc}, {backend}',
620 … timestamp=time.strftime('%Y-%m-%d %H:%M:%S %Z', time.localtime()),
633 test_case = TestCase(f'{test}, "{spec.name}", n{nproc}, {backend}',
635 elapsed_sec=time.time() - start,
636 timestamp=time.strftime('%Y-%m-%d %H:%M:%S %Z', time.localtime(start)),
637 stdout=proc.stdout.decode('utf-8'),
638 stderr=proc.stderr.decode('utf-8'),
667 test_case.status = f'fails with required: {required_message}'
669 test_case.add_failure_info(f'required failure missing: {required_message}')
676 test_case.add_error_info(f'returncode = {proc.returncode}')
694 test_case.add_failure_info('csv', output=f'{ref_csv} not found')
696 test_case.add_failure_info('csv', output=f'{out_file} not found')
710 test_case.add_failure_info(f'csv: {save_path}', output=diff)
721 test_case.add_failure_info('cgns', output=f'{ref_cgn} not found')
723 test_case.add_failure_info('cgns', output=f'{out_file} not found')
730 test_case.add_failure_info(f'cgns: {save_path}', output=diff)
741 test_case.add_failure_info('ascii', output=f'{ref_file} not found')
743 test_case.add_failure_info('ascii', output=f'{out_file} not found')
749 test_case.add_failure_info(f'ascii: {save_path}', output=diff)
769 …suite_spec: SuiteSpec, pool_size: int = 1, search: str = ".*", verbose: bool = False) -> TestSuite:
791 print(f'1..{len(test_specs)}')
809 print(f'# Subtest: {test_case.category}')
810 print(f' 1..{len(ceed_backends)}')
815 print(f'{"" if subtest_ok else "not "}ok {i} - {test_case.category}')
820 def write_junit_xml(test_suite: TestSuite, batch: str = '') -> None:
827 output_file = Path('build') / (f'{test_suite.name}{batch}.junit')
831 def has_failures(test_suite: TestSuite) -> bool: