Merge remote-tracking branch 'lenormf/failed-tests'

This commit is contained in:
Maxime Coste 2015-12-14 18:44:36 +00:00
commit 6873a44e3e

View File

@ -16,6 +16,7 @@ main() {
cd $work/$dir;
indent="$(echo "${dir}/" | sed -e 's|[^/]*/\+| |g')"
name=$(basename $PWD)
should_fail=$(test ! -e error; echo $?)
if ! test -e cmd; then
echo "$indent$name"
elif test -x enabled && ! ./enabled; then
@ -34,6 +35,10 @@ main() {
catch %{
exec gg
}
hook global RuntimeError .+ %{
nop %sh{echo '\$kak_hook_param' > stderr}
quit!
}
exec '$(cat cmd | sed -e s/\'/\\\\\'/g)'
eval -buffer *debug* write debug
nop %sh{
@ -46,6 +51,7 @@ main() {
"
${test}/../src/kak out -n -u -e "$kak_commands"
retval=$?
if [ $should_fail = 0 ]; then
if [ $retval -ne 0 ]; then
echo "Kakoune returned error $retval"
fi
@ -72,6 +78,19 @@ main() {
echo
fi
done
else
color=green
if [ ! -e stderr ]; then
if [ $retval -eq 0 ]; then
color=red
number_failures=$(($number_failures + 1))
fi
elif [ -s error -a ! $(cmp -s error stderr) ]; then
color=yellow
fi
echo "$indent$name" | colorize $color normal
fi
fi
done
if expr $number_failures > 0; then