mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-19 21:16:42 +00:00
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:
1 parent
c8f18446f4
commit
52b11c3cb8
1 file changed
+3
-2
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user