• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:preserve +full:- +full:paths

6 # This source code is licensed under both the BSD-style license (found in the
9 # You may select, at your option, one of the above-listed licenses.
67 def exclude_dir(dirname: str) -> bool:
76 def exclude_file(filename: str) -> bool:
85 def read_file(filename: str) -> bytes:
91 def diff(a: bytes, b: bytes) -> str:
92 """Returns a diff between two different byte-strings :a: and :b:."""
105 def pop_line(data: bytes) -> typing.Tuple[typing.Optional[bytes], bytes]:
125 def glob_line_matches(actual: bytes, expect: bytes) -> bool:
132 def glob_diff(actual: bytes, expect: bytes) -> bytes:
141 # Handle end of file conditions - allow extra newlines
152 diff += b"---\n"
159 diff += b"---\n"
178 diff += b"---\n"
186 diff += b'---\n'
201 preserve: bool,
205 ) -> None:
209 self.preserve = preserve
229 steps for single-threaded use-cases.
233 def __init__(self, test_filename: str, options: Options) -> None:
249 def name(self) -> str:
253 def launch(self) -> None:
261 def analyze(self) -> bool:
274 def run(self) -> bool:
279 def _log(self, *args, **kwargs) -> None:
283 def _vlog(self, *args, **kwargs) -> None:
288 def _test_environment(self) -> typing.Dict[str, str]:
300 def _launch_test(self) -> None:
320 def _join_test(self) -> None:
332 def _check_output_exact(self, out_name: str, expected: bytes, exact_name: str) -> None:
350 def _check_output_glob(self, out_name: str, expected: bytes) -> None:
366 def _check_output(self, out_name: str) -> None:
372 If :Options.preserve: was set then we save the scratch directory and
376 if self._opts.preserve:
395 def _check_stderr(self) -> None:
399 def _check_stdout(self) -> None:
403 def _check_exit(self) -> None:
409 If :Options.preserve: is set we save the exit code to the
412 if self._opts.preserve:
428 def _analyze_results(self) -> None:
444 self._log("----------------------------------------")
454 def __init__(self, test_directory: str, options: Options) -> None:
461 def __enter__(self) -> 'TestSuite':
465 def __exit__(self, _exc_type, _exc_value, _traceback) -> None:
469 def test_case(self, test_basename: str) -> TestCase:
482 def _remove_scratch_dir(self, dir: str) -> None:
489 def _setup_once(self) -> None:
497 def _teardown_once(self) -> None:
502 if not self._opts.preserve:
505 def _setup(self, test_basename: str) -> None:
513 def _teardown(self, test_basename: str) -> None:
519 if not self._opts.preserve:
522 def _run_script(self, script: str, cwd: str) -> None:
544 def get_all_tests(options: Options) -> TestSuites:
562 ) -> TestSuites:
565 respective test suites. Tests can either be paths, or test names
583 def run_tests(test_suites: TestSuites, options: Options) -> bool:
606 print(f"FAILED {len(tests) - successes} / {len(tests)} tests!")
610 def setup_zstd_symlink_dir(zstd_symlink_dir: str, zstd: str) -> None:
633 "generally correct. Pass --preserve to preserve test output for debugging,\n"
634 "and --verbose to get verbose test output.\n"
638 "--preserve",
640 help="Preserve the scratch directory TEST_DIR/scratch/ for debugging purposes."
642 parser.add_argument("--verbose", action="store_true", help="Verbose test output.")
643 …parser.add_argument("--timeout", default=200, type=int, help="Test case timeout in seconds. Set to…
645 "--exec-prefix",
650 "--zstd",
655 "--zstdgrep",
660 "--zstdless",
665 "--datagen",
670 "--test-dir",
679 "--set-exact-output",
686 help="Run only these test cases. Can either be paths or test names relative to TEST_DIR/"
716 preserve=args.preserve,