diff options
author | Russ Allbery <rra@stanford.edu> | 2010-08-25 15:08:05 -0700 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2010-08-25 15:08:05 -0700 |
commit | 468ded4c2fae05a815bef91bdcb17d52f9cdcb2b (patch) | |
tree | b2b836734664367c03691a8594684187a1be4054 /tests/tap/libtap.sh | |
parent | 32dc393016f0b6241dbf8d405638e18a33bb9b62 (diff) |
Update to rra-c-util 2.6 and C TAP Harness 1.5
Update to C TAP Harness 1.5:
* Better reporting of fatal errors in the test suite.
* Summarize results at the end of test execution.
* Add tests/HOWTO from docs/writing-tests in C TAP Harness.
Update to rra-c-util 2.6:
* Fix portability to bundled Heimdal on OpenBSD.
* Improve checking for krb5_kt_free_entry with older MIT Kerberos.
* Fix portability for missing krb5_get_init_creds_opt_free.
* Fix header guard for util/xwrite.h.
* Restore default compiler configuration after GSS-API library probe.
Diffstat (limited to 'tests/tap/libtap.sh')
-rw-r--r-- | tests/tap/libtap.sh | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/tap/libtap.sh b/tests/tap/libtap.sh index 1846840..a9b46d4 100644 --- a/tests/tap/libtap.sh +++ b/tests/tap/libtap.sh @@ -1,7 +1,7 @@ # Shell function library for test cases. # # Written by Russ Allbery <rra@stanford.edu> -# Copyright 2009 Russ Allbery <rra@stanford.edu> +# Copyright 2009, 2010 Russ Allbery <rra@stanford.edu> # Copyright 2006, 2007, 2008 Board of Trustees, Leland Stanford Jr. University # # See LICENSE for licensing terms. @@ -15,10 +15,22 @@ plan () { trap finish 0 } +# Prepare for lazy planning. +plan_lazy () { + count=1 + planned=0 + failed=0 + trap finish 0 +} + # Report the test status on exit. finish () { local highest looks highest=`expr "$count" - 1` + if [ "$planned" = 0 ] ; then + echo "1..$highest" + planned="$highest" + fi looks='# Looks like you' if [ "$planned" -gt 0 ] ; then if [ "$planned" -gt "$highest" ] ; then @@ -146,3 +158,21 @@ bail () { echo 'Bail out!' "$@" exit 1 } + +# Output a diagnostic on standard error, preceded by the required # mark. +diag () { + echo '#' "$@" +} + +# Search for the given file first in $BUILD and then in $SOURCE and echo the +# path where the file was found, or the empty string if the file wasn't +# found. +test_file_path () { + if [ -f "$BUILD/$1" ] ; then + echo "$BUILD/$1" + elif [ -f "$SOURCE/$1" ] ; then + echo "$SOURCE/$1" + else + echo '' + fi +} |