Fix test runner to consider Kakoune returning non 0 as a failure
This commit is contained in:
parent
67849f2db7
commit
24d4ee870f
49
test/run
49
test/run
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user