Skip to content

Commit

Permalink
Remove unused verify.py option
Browse files Browse the repository at this point in the history
Summary: The --normalize-paths option for verify.py is no longer used; remove it

Reviewed By: mheiber

Differential Revision: D65575580

fbshipit-source-id: 19aa39b84dbb176d936a1bb8abbf0141df4f954f
  • Loading branch information
Millie Chen authored and facebook-github-bot committed Nov 8, 2024
1 parent 584b54c commit fc99075
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions hphp/hack/test/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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.
Expand Down Expand Up @@ -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,
Expand All @@ -456,7 +439,6 @@ def check_result(
test_case,
default_expect_regex,
ignore_error_messages,
normalize_paths,
verify_pessimisation,
out,
)
Expand All @@ -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:
Expand All @@ -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 (
Expand All @@ -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)

Expand Down Expand Up @@ -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]],
Expand Down Expand Up @@ -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,
Expand All @@ -769,7 +746,6 @@ def run_tests(
ignore_error_text,
no_stderr,
force_color,
normalize_paths,
mode_flag,
get_flags,
verify_pessimisation,
Expand Down Expand Up @@ -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 = [
Expand All @@ -829,7 +804,6 @@ def run_idempotence_tests(
False,
False,
False,
normalize_paths,
mode_flag,
get_flags,
VerifyPessimisationOptions.no,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
)

Expand Down

0 comments on commit fc99075

Please sign in to comment.