Code

test-lib: Print missing prerequisites in test output
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Fri, 6 Aug 2010 21:19:24 +0000 (21:19 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 18 Aug 2010 19:42:04 +0000 (12:42 -0700)
Change the test output to print needed prerequisites as part of the
TAP. This makes it easy to see at a glance why a test was
skipped. Before:

    ok 7 # skip <message>
    ok 9 # skip <message>

After:

    ok 7 # skip <message> (prereqs: DONTHAVEIT)
    ok 9 # skip <message> (prereqs: HAVEIT,DONTHAVEIT)

This'll also be useful for smoke testing output, where the developer
reading the output may not be familiar with the system where tests are
being skipped.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib.sh

index 0b9969ccf7e8f45e68abd522c501ded2bb861492..9ded0eee18e7479b0674a7bce217de46744b1dff 100644 (file)
@@ -403,7 +403,7 @@ test_skip () {
        case "$to_skip" in
        t)
                say_color skip >&3 "skipping test: $@"
-               say_color skip "ok $test_count # skip $1"
+               say_color skip "ok $test_count # skip $1 (prereqs: $prereq)"
                : true
                ;;
        *)