Update test run script, was not writing test name in some cases

This commit is contained in:
Maxime Coste 2016-03-17 11:37:35 +00:00
parent 131b0a8298
commit 544ec7e385

View File

@ -56,18 +56,19 @@ main() {
rm -f /tmp/kakoune/$USER/$session rm -f /tmp/kakoune/$USER/$session
${test}/../src/kak out -n -s "$session" -ui json -e "$kak_commands" > display ${test}/../src/kak out -n -s "$session" -ui json -e "$kak_commands" > display
retval=$? retval=$?
if [ $should_fail = 0 ]; then if [ $should_fail -eq 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)) number_failures=$(($number_failures + 1))
echo "$indent$name" | colorize red normal echo "$indent$name" | colorize red normal
else else
failed=no
for expect in $test_files; do for expect in $test_files; do
if cmp -s $test/$dir/$expect $expect; then if ! cmp -s $test/$dir/$expect $expect; then
echo "$indent$name" | colorize green normal if [ "$failed" = no ]; then
else echo "$indent$name" | colorize red normal
number_failures=$(($number_failures + 1)) failed=yes
echo "$indent$name" | colorize red normal fi
echo echo
diff -u $test/$dir/$expect $expect | while read -r line; do diff -u $test/$dir/$expect $expect | while read -r line; do
first_character=$(echo "$line" | cut -b 1) first_character=$(echo "$line" | cut -b 1)
@ -79,14 +80,19 @@ main() {
esac esac
echo "$line" | colorize $color normal echo "$line" | colorize $color normal
done done
echo
if test -e debug; then
echo "debug buffer:" | colorize yellow normal
cat debug
echo
fi
fi fi
done done
if [ "$failed" = no ]; then
echo "$indent$name" | colorize green normal
else
number_failures=$(($number_failures + 1))
echo
if test -e debug; then
echo "debug buffer:" | colorize yellow normal
cat debug
echo
fi
fi
fi fi
else else
color=green color=green