6 * tap - Test Anything Protocol
8 * The tap package produces simple-to-parse mainly-human-readable test
9 * output to assist in the writing of test cases. It is based on the
10 * (now-defunct) libtap, which is based on Perl's CPAN TAP module. Its
11 * output can be parsed by a harness such as CPAN's Prove.
13 * CCAN testcases are expected to output the TAP format, usually using
16 * For more information about TAP, see:
17 * http://en.wikipedia.org/wiki/Test_Anything_Protocol
19 * Based on the original libtap, Copyright (c) 2004 Nik Clayton.
21 * License: BSD (2 clause)
25 * #include <ccan/tap/tap.h>
27 * // Run some simple (but overly chatty) tests on strcmp().
28 * int main(int argc, char *argv[])
30 * const char a[] = "a", another_a[] = "a";
31 * const char b[] = "b";
32 * const char ab[] = "ab";
35 * diag("Testing different pointers (%p/%p) with same contents",
37 * ok1(strcmp(a, another_a) == 0);
39 * diag("'a' comes before 'b'");
40 * ok1(strcmp(a, b) < 0);
41 * ok1(strcmp(b, a) > 0);
43 * diag("'ab' comes after 'a'");
44 * ok1(strcmp(ab, a) > 0);
45 * return exit_status();
48 * Maintainer: Rusty Russell <rusty@rustcorp.com.au>
50 int main(int argc, char *argv[])
55 if (strcmp(argv[1], "depends") == 0) {
56 printf("ccan/compiler\n");