Commit Graph

4 Commits

Author SHA1 Message Date
Russ Allbery
92825d6d65 Resync test harness with C TAP Harness 1.7
Includes the following upstream changes:

Add a more complete usage message to runtests and add support for a -h
command-line flag to display the usage message.

is_double() now takes a third argument, an epsilon.  Two numbers are
considered equal if their absolute difference is less than epsilon.
is_double() also now treats wanted and seen values of NaN (not a
number) as equal.  Thanks to PICCA Frédéric-Emmanuel for the proposed
changes.

The ok_program function in the shell libtap.sh library no longer
strips text after a colon and a space from the program output if the
expected status is non-zero.  Instead, if program output may contain
system-specific error messages after a colon and a space, put the new
function strip_colon_error before the program to do this stripping.
Thanks to Carsten Hey for the idea.

strip_colon_error is now smarter about preserving an initial word
ending in a colon (which is generally the program name) while still
stripping error messages later in the line.

The test_file_path function in the shell libtap.sh library now always
returns the empty string, rather than possible absolute paths starting
at /, if $BUILD and $SOURCE are not set.

Flush standard error in the C TAP library before printing results for
more deterministic output.  Thanks to Carsten Hey for the idea.

All of C TAP Harness now compiles with gcc -ansi -pedantic and should
be fully C89-compatible.  Note that either C99 or SUSv3 is required to
build C TAP Harness.  (This should not be a problem on any modern
platform.)  Based on work by Carsten Hey.

Simplify and improve output formatting in the summary of failing tests
in some edge cases.

Add explicit license statements to the files meant to be copied into
other packages rather than referring to LICENSE.

Add a test_file_path() function to the basic C and shell TAP
libraries, which searches the build and source directories for a
particular file and returns the full path.  This is a utility function
that can be used to find test data files.

Change-Id: I3ef84218f0e3a8b75f550c8b629b058330659b31
Reviewed-on: http://gerrit.openafs.org/4589
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
2011-04-28 20:24:34 -07:00
Russ Allbery
6ee6125f71 Fix the trailing #endif comment in tests/tap/basic.h
Change-Id: I3a7dbda8d2792229365df4266ca43cbb4bc815bf
Reviewed-on: http://gerrit.openafs.org/2099
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-09 10:40:29 -07:00
Russ Allbery
74a332e7ee Add okv function to the TAP test library
Add an okv() varient of the ok() function that takes the arguments as
a va_list instead of as a variable argument list.  This makes it easier
to reuse ok() when writing other tests.

Change-Id: Icaeaaf9d6bd9d54bfd886a75961d98367ee0fb9a
Reviewed-on: http://gerrit.openafs.org/2098
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
2010-06-09 10:39:29 -07:00
Russ Allbery
194c3f10d4 Import C TAP Harness 1.2 as a testing harness
Creates a new top-level tests directory that will be used for all
future automated test code eventually.  Import runtests and the
basic TAP library from C TAP Harness 1.2.  Add top-level check and
test targets that build the full source tree and then the new tests
directory, and then runs runtests on the test list.

Change-Id: I896f8ae488cd1dfa8529a10b4b479e45e7c67afe
Reviewed-on: http://gerrit.openafs.org/2062
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-05-29 21:48:19 -07:00