File: test_loop.sh

package info (click to toggle)
python-baron 0.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,080 kB
  • sloc: python: 26,926; makefile: 126; sh: 27
file content (27 lines) | stat: -rwxr-xr-x 1,025 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash

while true
do
    clear
    if [ "$1" == "grammator" ]
    then
        py.test test_grammator* -x | tee /tmp/.baron_test_ouput
    else
        py.test -x | tee /tmp/.baron_test_ouput
    fi
    if ([ ! "$1" ] || [ "$1" == "grammator" ]) && [ "$(grep ': AssertionError' /tmp/.baron_test_ouput)" ]
    then
        grep "   def" /tmp/.baron_test_ouput | head -n 1 | sed 's/^ *//'
        sed 's/, *$//' /tmp/a > /tmp/aa
        sed 's/, *$//' /tmp/b > /tmp/bb
        colordiff -W $(stty size | cut -d " " -f 2) -y /tmp/aa /tmp/bb
        echo
        grep ":[0-9]\+:" /tmp/.baron_test_ouput | sed -n '$d;1p'
    elif [ "$1" == "dump" ] && [ "$(grep ': AssertionError' /tmp/.baron_test_ouput)" ] && [ ! "$(grep 'Warning: couldn.t write dumps output to debug file' /tmp/.baron_test_ouput)" ]
    then
        grep "   def" /tmp/.baron_test_ouput | head -n 1 | sed 's/^ *//'
        colordiff -W $(stty size | cut -d " " -f 2) -y /tmp/c /tmp/d
        echo
    fi
    inotifywait -e modify *.py ../baron/*.py
done