#When doing ziglings, how to stop screen on first failed test?

1 messages · Page 1 of 1 (latest)

dry kestrel
#

Right now I use this:

watchexec -i zig-cache -e zig -r 'zig build 2>&1| less

But then I need to scroll to first failed test.

Or maybe option to not output from passed tests?

dry kestrel
#

ChatGPT helped 😄

#
#!/usr/bin/env python3

import re
import sys
import os

def clear_terminal():
    if os.name == "posix":  # Linux and macOS
        os.system("clear")
    elif os.name == "nt":  # Windows
        os.system("cls")

pattern = r'(Compiling .*\nerror: .*)'
input_text = sys.stdin.read()

clear_terminal()

matches = re.findall(pattern, input_text)

for match in matches:
    print(match)
    remaining_lines = input_text.split(match, 1)[1]
    print(remaining_lines)
#

watchexec -i zig-cache -e zig -r 'zig build 2>&1 | ziglings_cut_passed.py'

vivid dagger