From fc990751d32059792b7ec8998aa983c3da8be619 Mon Sep 17 00:00:00 2001 From: Millie Chen Date: Thu, 7 Nov 2024 17:37:51 -0800 Subject: [PATCH] Remove unused verify.py option Summary: The --normalize-paths option for verify.py is no longer used; remove it Reviewed By: mheiber Differential Revision: D65575580 fbshipit-source-id: 19aa39b84dbb176d936a1bb8abbf0141df4f954f --- hphp/hack/test/verify.py | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/hphp/hack/test/verify.py b/hphp/hack/test/verify.py index 3849a5c9bdf387..6d7ce6e02ed7b2 100755 --- a/hphp/hack/test/verify.py +++ b/hphp/hack/test/verify.py @@ -144,7 +144,6 @@ def check_output( default_expect_regex: Optional[str], ignore_error_text: bool, only_compare_error_lines: bool, - normalize_paths: bool, verify_pessimisation: VerifyPessimisationOptions, check_expected_included_in_actual: bool, ) -> Result: @@ -169,7 +168,6 @@ def check_output( case, default_expect_regex, ignore_error_text, - normalize_paths, verify_pessimisation, check_expected_included_in_actual=check_expected_included_in_actual, out=output, @@ -193,7 +191,6 @@ def run_batch_tests( mode_flag: List[str], get_flags: Callable[[str], List[str]], out_extension: str, - normalize_paths: bool, verify_pessimisation: VerifyPessimisationOptions, check_expected_included_in_actual: bool, only_compare_error_lines: bool = False, @@ -265,7 +262,6 @@ def run(test_cases: List[TestCase]) -> List[Result]: default_expect_regex=default_expect_regex, ignore_error_text=ignore_error_text, only_compare_error_lines=only_compare_error_lines, - normalize_paths=normalize_paths, verify_pessimisation=verify_pessimisation, check_expected_included_in_actual=check_expected_included_in_actual, ) @@ -299,7 +295,6 @@ def run_test_program( ignore_error_text: bool, no_stderr: bool, force_color: bool, - normalize_paths: bool, mode_flag: List[str], get_flags: Callable[[str], List[str]], verify_pessimisation: VerifyPessimisationOptions, @@ -354,7 +349,6 @@ def run(test_case: TestCase) -> Result: test_case, default_expect_regex, ignore_error_text, - normalize_paths, verify_pessimisation, check_expected_included_in_actual=check_expected_included_in_actual, out=output, @@ -381,16 +375,6 @@ def filter_ocaml_stacktrace(text: str) -> str: return "\n".join(out) -def filter_cwd(text: str) -> str: - """take a string and remove all instances of the current cwd""" - assert isinstance(text, str) - # Get the absolute path of the current working directory - cwd = os.path.abspath(os.getcwd()) - # Normalize the path separators to work on different operating systems - cwd = cwd.replace("\\", "/") - return text.replace(cwd, "/") - - def filter_temp_hhi_path(text: str) -> str: """The .hhi files are stored in a temporary directory whose name changes every time. Normalise it. @@ -444,7 +428,6 @@ def check_result( test_case: TestCase, default_expect_regex: Optional[str], ignore_error_messages: bool, - normalize_paths: bool, verify_pessimisation: VerifyPessimisationOptions, check_expected_included_in_actual: bool, out: str, @@ -456,7 +439,6 @@ def check_result( test_case, default_expect_regex, ignore_error_messages, - normalize_paths, verify_pessimisation, out, ) @@ -466,7 +448,6 @@ def check_expected_equal_actual( test_case: TestCase, default_expect_regex: Optional[str], ignore_error_messages: bool, - normalize_paths: bool, verify_pessimisation: VerifyPessimisationOptions, out: str, ) -> Result: @@ -481,7 +462,6 @@ def check_expected_equal_actual( if verify_pessimisation == "no" else strip_pess_suffix(filter_temp_hhi_path(strip_lines(out))) ) - out = filter_cwd(normalized_out) if normalize_paths else out is_ok = ( expected == normalized_out or ( @@ -498,7 +478,6 @@ def check_expected_equal_actual( and re.search(default_expect_regex, normalized_out) is not None and expected == "" ) - or (normalize_paths and (expected == out)) ) return Result(test_case=test_case, output=out, is_failure=not is_ok) @@ -726,7 +705,6 @@ def run_tests( ignore_error_text: bool, no_stderr: bool, force_color: bool, - normalize_paths: bool, verify_pessimisation: VerifyPessimisationOptions, mode_flag: List[str], get_flags: Callable[[str], List[str]], @@ -756,7 +734,6 @@ def run_tests( mode_flag, get_flags, out_extension, - normalize_paths, verify_pessimisation, check_expected_included_in_actual, only_compare_error_lines, @@ -769,7 +746,6 @@ def run_tests( ignore_error_text, no_stderr, force_color, - normalize_paths, mode_flag, get_flags, verify_pessimisation, @@ -810,7 +786,6 @@ def run_idempotence_tests( default_expect_regex: Optional[str], mode_flag: List[str], get_flags: Callable[[str], List[str]], - normalize_paths: bool, check_expected_included_in_actual: bool, ) -> None: idempotence_test_cases = [ @@ -829,7 +804,6 @@ def run_idempotence_tests( False, False, False, - normalize_paths, mode_flag, get_flags, VerifyPessimisationOptions.no, @@ -1032,7 +1006,6 @@ def main() -> None: args.ignore_error_text, args.no_stderr, args.force_color, - args.normalize_paths, args.verify_pessimisation, mode_flag, get_flags, @@ -1054,7 +1027,6 @@ def main() -> None: args.default_expect_regex, mode_flag, get_flags, - args.normalize_paths, check_expected_included_in_actual=args.check_expected_included_in_actual, )