diff options
author | Russ Allbery <rra@stanford.edu> | 2013-02-27 15:31:44 -0800 |
---|---|---|
committer | Russ Allbery <rra@stanford.edu> | 2013-02-27 16:53:27 -0800 |
commit | 6e405825d27f6b409a99289ad23c69367f154f94 (patch) | |
tree | 5209da298bebf979046caad49772ce75b3bade9a | |
parent | e67654627aafd6bd928a0bc9b53731c173f42864 (diff) |
Update tests/HOWTO from C TAP Harness 1.12
Change-Id: Icd7381f4fbe3699dbd6e5459ddb59548f60e56a4
Reviewed-on: https://gerrit.stanford.edu/846
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
-rw-r--r-- | tests/HOWTO | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/tests/HOWTO b/tests/HOWTO index bc731b4..5d38748 100644 --- a/tests/HOWTO +++ b/tests/HOWTO @@ -96,12 +96,11 @@ Writing TAP Tests of Test::More for all the details and lots of examples. C TAP Harness can run Perl test scripts directly and interpret the - results correctly, and similarly the Perl Test::Harness module can run - TAP tests written in other languages using, for example, the TAP - library that comes with C TAP Harness. However, the "prove" tool that - comes with Perl and runs tests makes some Perl-specific assumptions - that aren't always appropriate for packages that aren't written in - Perl. + results correctly, and similarly the Perl Test::Harness module and + prove command can run TAP tests written in other languages using, for + example, the TAP library that comes with C TAP Harness. You can, if + you wish, use the library that comes with C TAP Harness but use prove + instead of runtests for running the test suite. C @@ -117,6 +116,7 @@ Writing TAP Tests Here's a complete example test program that uses the C TAP library: + #include <stddef.h> #include <tap/basic.h> int @@ -226,3 +226,23 @@ Writing TAP Tests rest of its arguments as the program to run. That program is run with standard error and standard output combined, and then its exit status and output are tested against the provided values. + + A utility function, strip_colon_error, is provided that runs the + command given as its arguments and strips text following a colon and a + space from the output (unless there is no whitespace on the line + before the colon and the space, normally indicating a prefix of the + program name). This function can be used to wrap commands that are + expected to fail with output that has a system- or locale-specific + error message appended, such as the output of strerror(). + +License + + This file is part of the documentation of C TAP Harness, which can be + found at <http://www.eyrie.org/~eagle/software/c-tap-harness/>. + + Copyright 2010 Russ Allbery <rra@stanford.edu> + + Copying and distribution of this file, with or without modification, + are permitted in any medium without royalty provided the copyright + notice and this notice are preserved. This file is offered as-is, + without any warranty. |