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