Lines Matching +full:- +full:name
19 sys.path.insert(0, str(Path(__file__).parent / "junit-xml"))
64 name: str = field(default_factory=str) variable in TestSpec
65 csv_rtol: float = -1
66 csv_ztol: float = -1
67 cgns_tol: float = -1
88 def get_source_path(self, test: str) -> Path:
92 test (str): Name of test
100 def get_run_path(self, test: str) -> Path:
104 test (str): Name of test
112 def get_output_path(self, test: str, output_file: str) -> Path:
116 test (str): Name of test
117 output_file (str): File name of output file
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:
176 test (str): Name of test
181 def check_pre_skip(self, test: str, spec: TestSpec, resource: str, nproc: int) -> Optional[str]:
185 test (str): Name of test
195 … def check_post_skip(self, test: str, spec: TestSpec, resource: str, stderr: str) -> Optional[str]:
199 test (str): Name of test
209 …def check_required_failure(self, test: str, spec: TestSpec, resource: str, stderr: str) -> Tuple[s…
213 test (str): Name of test
223 def check_allowed_stdout(self, test: str) -> bool:
227 test (str): Name of test
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]
331 …([A-Za-z]+[\w\-]+) # match key starting with alpha, containing alphanumeric, _, or -; captured as…
360 if not 'name' in known.keys():
361 known['name'] = fallback_name
371 print(f"warning, unknown TESTCASE option for test '{known['name']}': {k}={v}")
375 def get_test_args(source_file: Path) -> List[TestSpec]:
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.
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'
552 output_str += f' -\n'
561 output_str += f'Test: {test} {spec.name}\n'
573 def save_failure_artifact(suite_spec: SuiteSpec, file: Path) -> Path:
580 save_path: Path = suite_spec.test_failure_artifacts_path / file.name
586 mode: RunMode, nproc: int, suite_spec: SuiteSpec, verbose: bool = False) -> TestCase:
609 run_args[i] = arg.replace('{ceed_resource}', backend.replace('/', '-'))
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()),
623 category=spec.name,)
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'),
640 category=spec.name,)
688 csv_name = ref_csv.name
691 # remove _{ceed_backend} from path name
692 ref_csv = (ref_csv.parent / ref_csv.name.rsplit('_', 1)[0]).with_suffix('.csv')
715 cgn_name = ref_cgn.name
718 # remove _{ceed_backend} from path name
719 ref_cgn = (ref_cgn.parent / ref_cgn.name.rsplit('_', 1)[0]).with_suffix('.cgns')
735 ref_name = ref_file.name
738 # remove _{ceed_backend} from path name
739 … ref_file = (ref_file.parent / ref_file.name.rsplit('_', 1)[0]).with_suffix(ref_file.suffix)
769 …suite_spec: SuiteSpec, pool_size: int = 1, search: str = ".*", verbose: bool = False) -> TestSuite:
773 test (str): Name of test
786 …t for t in get_test_args(suite_spec.get_source_path(test)) if re.search(search, t.name, re.IGNOREC…
815 print(f'{"" if subtest_ok else "not "}ok {i} - {test_case.category}')
820 def write_junit_xml(test_suite: TestSuite, batch: str = '') -> None:
825 batch (str): Name of JUnit batch, defaults to empty string
827 output_file = Path('build') / (f'{test_suite.name}{batch}.junit')
831 def has_failures(test_suite: TestSuite) -> bool: