diff options
| author | Randy Palamar <randy@rnpnr.xyz> | 2024-05-21 19:53:22 -0600 |
|---|---|---|
| committer | Randy Palamar <randy@rnpnr.xyz> | 2024-05-21 19:53:22 -0600 |
| commit | b7074021b7bfb0932b889b9560dd22df31cef818 (patch) | |
| tree | 0295b18de8fb8ea5289cbda95675687ae06025ff /test/core/ccan/tap/_info | |
| parent | b7f8018a00be930e3f2b864949aec1f91291309c (diff) | |
| parent | efafa3c178268a4149fc3e432bc1174a013c16de (diff) | |
| download | vis-b7074021b7bfb0932b889b9560dd22df31cef818.tar.gz vis-b7074021b7bfb0932b889b9560dd22df31cef818.tar.xz | |
Merge vis-tests into test directory
Going forward all tests should be submitted here directly.
Diffstat (limited to 'test/core/ccan/tap/_info')
| -rw-r--r-- | test/core/ccan/tap/_info | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/test/core/ccan/tap/_info b/test/core/ccan/tap/_info new file mode 100644 index 0000000..2b116de --- /dev/null +++ b/test/core/ccan/tap/_info @@ -0,0 +1,61 @@ +#include "config.h" +#include <stdio.h> +#include <string.h> + +/** + * tap - Test Anything Protocol + * + * The tap package produces simple-to-parse mainly-human-readable test + * output to assist in the writing of test cases. It is based on the + * (now-defunct) libtap, which is based on Perl's CPAN TAP module. Its + * output can be parsed by a harness such as CPAN's Prove. + * + * CCAN testcases are expected to output the TAP format, usually using + * this package. + * + * For more information about TAP, see: + * http://en.wikipedia.org/wiki/Test_Anything_Protocol + * + * Based on the original libtap, Copyright (c) 2004 Nik Clayton. + * + * License: BSD (2 clause) + * + * Example: + * #include <string.h> + * #include <ccan/tap/tap.h> + * + * // Run some simple (but overly chatty) tests on strcmp(). + * int main(int argc, char *argv[]) + * { + * const char a[] = "a", another_a[] = "a"; + * const char b[] = "b"; + * const char ab[] = "ab"; + * + * plan_tests(4); + * diag("Testing different pointers (%p/%p) with same contents", + * a, another_a); + * ok1(strcmp(a, another_a) == 0); + * + * diag("'a' comes before 'b'"); + * ok1(strcmp(a, b) < 0); + * ok1(strcmp(b, a) > 0); + * + * diag("'ab' comes after 'a'"); + * ok1(strcmp(ab, a) > 0); + * return exit_status(); + * } + * + * Maintainer: Rusty Russell <rusty@rustcorp.com.au> + */ +int main(int argc, char *argv[]) +{ + if (argc != 2) + return 1; + + if (strcmp(argv[1], "depends") == 0) { + printf("ccan/compiler\n"); + return 0; + } + + return 1; +} |
