Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
improve
Browse files Browse the repository at this point in the history
  • Loading branch information
zrr1999 committed Jul 13, 2023
1 parent 4f14064 commit aad2275
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/extract_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
error_msg = sys.stdin.read()

pattern = r'File "?(.*?)"?, line (\d+),.*\n(.*?)\n(.*?)$'
match = re.search(pattern, error_msg, re.MULTILINE)
if match:
for match in re.finditer(pattern, error_msg, re.MULTILINE):
file = match.group(1)
if not file.startswith("/"):
file = f"tests/{file}"
line = match.group(2)
error_info = match.group(4)
# error_info = match.group(3) + '\n' + match.group(4)
output = f"::error file=tests/{file},line={line}::{error_info}"
output = f"::error file={file},line={line}::{error_info}"
print(output)

0 comments on commit aad2275

Please sign in to comment.