Adapt the changes to a smarter way of testing kak for failures

This commit is contained in:
Frank LENORMAND 2015-12-14 15:35:23 +03:00
parent d63238ed9d
commit 6129f1b049

View File

@ -15,11 +15,8 @@ main() {
test_files=$(ls out selections state 2>/dev/null) test_files=$(ls out selections state 2>/dev/null)
cd $work/$dir; cd $work/$dir;
indent="$(echo "${dir}/" | sed -e 's|[^/]*/\+| |g')" indent="$(echo "${dir}/" | sed -e 's|[^/]*/\+| |g')"
name=$(echo ${PWD##*/} | sed 's/-fail^//') name=$(basename $PWD)
should_fail=0 should_fail=$(test ! -e error; echo $?)
if [ ${PWD##*-} = fail ]; then
should_fail=1
fi
if ! test -e cmd; then if ! test -e cmd; then
echo "$indent$name" echo "$indent$name"
elif test -x enabled && ! ./enabled; then elif test -x enabled && ! ./enabled; then
@ -38,6 +35,10 @@ main() {
catch %{ catch %{
exec gg exec gg
} }
hook global RuntimeError .+ %{
nop %sh{echo '\$kak_hook_param' > stderr}
quit!
}
exec '$(cat cmd | sed -e s/\'/\\\\\'/g)' exec '$(cat cmd | sed -e s/\'/\\\\\'/g)'
eval -buffer *debug* write debug eval -buffer *debug* write debug
nop %sh{ nop %sh{
@ -78,10 +79,16 @@ main() {
fi fi
done done
else else
color=green
if [ ! -e stderr ]; then
if [ $retval -eq 0 ]; then if [ $retval -eq 0 ]; then
color=red color=red
number_failures=$(($number_failures + 1))
fi fi
color=${color:-green} elif [ -s error -a ! $(cmp -s error stderr) ]; then
color=yellow
fi
echo "$indent$name" | colorize $color normal echo "$indent$name" | colorize $color normal
fi fi
fi fi