Fix lit_autoupdate to use consistent relative paths in FileCheck stanzas regardless of where it's run from. (#2538)

Avoids putting absolute paths in FileCheck lines, resulting in tests which fail when run in a different checkout.
This commit is contained in:
Richard Smith
2023-01-19 15:10:18 -08:00
committed by GitHub
parent c8f18446f4
commit 52b11c3cb8
+3 -2
View File
@@ -431,10 +431,11 @@ def main() -> None:
parsed_args = parse_args()
# Remaining script logic should be relative to the repository root.
os.chdir(Path(__file__).parent.parent.parent)
root = Path(__file__).parent.parent.parent
os.chdir(root)
if parsed_args.tests:
tests = set(parsed_args.tests)
tests = {test.relative_to(root) for test in parsed_args.tests}
else:
print("HINT: run `update_checks.py f1 f2 ...` to update specific tests")
tests = get_tests(parsed_args.testdata)