Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions llvm/utils/lit/lit/DiffUpdater.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import shutil
import os
import shlex
import pathlib

"""
This file provides the `diff_test_updater` function, which is invoked on failed RUN lines when lit is executed with --update-tests.
Expand Down Expand Up @@ -76,14 +77,12 @@ def get_target_dir(commands, test_path):

@staticmethod
def create(path, commands, test_path, target_dir):
filename = path.replace(target_dir, "")
if filename.startswith(os.sep):
filename = filename[len(os.sep) :]
path = pathlib.Path(path)
with open(test_path, "r") as f:
lines = f.readlines()
for i, l in enumerate(lines):
p = SplitFileTarget._get_split_line_path(l)
if p == filename:
if p and path.samefile(os.path.join(target_dir, p)):
idx = i
break
else:
Expand Down