Fix test runner to consider Kakoune returning non 0 as a failure

This commit is contained in:
Maxime Coste 2016-03-03 13:49:57 +00:00
parent 67849f2db7
commit 24d4ee870f

View File

@ -54,30 +54,33 @@ main() {
if [ $should_fail = 0 ]; then if [ $should_fail = 0 ]; then
if [ $retval -ne 0 ]; then if [ $retval -ne 0 ]; then
echo "Kakoune returned error $retval" echo "Kakoune returned error $retval"
number_failures=$(($number_failures + 1))
echo "$indent$name" | colorize red normal
else
for expect in $test_files; do
if cmp -s $test/$dir/$expect $expect; then
echo "$indent$name" | colorize green normal
else
number_failures=$(($number_failures + 1))
echo "$indent$name" | colorize red normal
echo
diff -u $test/$dir/$expect $expect | while read -r line; do
first_character=$(echo "$line" | cut -b 1)
case $first_character in
+) color=green ;;
-) color=red ;;
@) color=magenta ;;
*) color=none ;;
esac
echo "$line" | colorize $color normal
done
echo
echo "debug buffer:" | colorize yellow normal
cat debug
echo
fi
done
fi fi
for expect in $test_files; do
if cmp -s $test/$dir/$expect $expect; then
echo "$indent$name" | colorize green normal
else
number_failures=$(($number_failures + 1))
echo "$indent$name" | colorize red normal
echo
diff -u $test/$dir/$expect $expect | while read -r line; do
first_character=$(echo "$line" | cut -b 1)
case $first_character in
+) color=green ;;
-) color=red ;;
@) color=magenta ;;
*) color=none ;;
esac
echo "$line" | colorize $color normal
done
echo
echo "debug buffer:" | colorize yellow normal
cat debug
echo
fi
done
else else
color=green color=green
if [ ! -e stderr ]; then if [ ! -e stderr ]; then