]> rtime.felk.cvut.cz Git - git.git/commitdiff
t: Make wvtest compatible output wvtest
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 20 Jun 2010 18:25:11 +0000 (20:25 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sun, 20 Jun 2010 18:25:11 +0000 (20:25 +0200)
t/test-lib.sh

index 454880ac7d281d901156136900814dee9aae46c5..d95bd871699906abdcad5072ecc0192d38154cf7 100644 (file)
@@ -161,7 +161,7 @@ if test -n "$color"; then
                        *) test -n "$quiet" && return;;
                esac
                shift
-               printf "%s" "$*"
+               printf "%s" "$*"
                tput sgr0
                echo
                )
@@ -170,7 +170,7 @@ else
        say_color() {
                test -z "$1" && test -n "$quiet" && return
                shift
-               echo "$*"
+               echo "$*"
        }
 fi
 
@@ -187,6 +187,9 @@ say () {
 test "${test_description}" != "" ||
 error "Test script did not set test_description."
 
+d=$(echo "${test_description}"|head -n 1)
+say "Testing \"$d\" in $0:"
+
 if test "$help" = "t"
 then
        echo "$test_description"
@@ -340,12 +343,12 @@ test_have_prereq () {
 
 test_ok_ () {
        test_success=$(($test_success + 1))
-       say_color "" "  ok $test_count: $@"
+       say_color "" "! $0:$test_count $@ ok"
 }
 
 test_failure_ () {
        test_failure=$(($test_failure + 1))
-       say_color error "FAIL $test_count: $1"
+       say_color error "! $0:$test_count $1 FAIL"
        shift
        echo "$@" | sed -e 's/^/        /'
        test "$immediate" = "" || { GIT_EXIT_OK=t; exit 1; }