_info 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include "config.h"
  4. /**
  5. * tap - Test Anything Protocol
  6. *
  7. * The tap package produces simple-to-parse mainly-human-readable test
  8. * output to assist in the writing of test cases. It is based on the
  9. * (now-defunct) libtap, which is based on Perl's CPAN TAP module. Its
  10. * output can be parsed by a harness such as CPAN's Prove.
  11. *
  12. * CCAN testcases are expected to output the TAP format, usually using
  13. * this package.
  14. *
  15. * For more information about TAP, see:
  16. * http://en.wikipedia.org/wiki/Test_Anything_Protocol
  17. *
  18. * Based on the original libtap, Copyright (c) 2004 Nik Clayton.
  19. *
  20. * Example:
  21. * #include <string.h>
  22. * #include <ccan/tap/tap.h>
  23. *
  24. * // Run some simple (but overly chatty) tests on strcmp().
  25. * int main(int argc, char *argv[])
  26. * {
  27. * const char a[] = "a", another_a[] = "a";
  28. * const char b[] = "b";
  29. * const char ab[] = "ab";
  30. *
  31. * plan_tests(4);
  32. * diag("Testing different pointers (%p/%p) with same contents",
  33. * a, another_a);
  34. * ok1(strcmp(a, another_a) == 0);
  35. *
  36. * diag("'a' comes before 'b'");
  37. * ok1(strcmp(a, b) < 0);
  38. * ok1(strcmp(b, a) > 0);
  39. *
  40. * diag("'ab' comes after 'a'");
  41. * ok1(strcmp(ab, a) > 0);
  42. * return exit_status();
  43. * }
  44. *
  45. * Maintainer: Rusty Russell <rusty@rustcorp.com.au>
  46. */
  47. int main(int argc, char *argv[])
  48. {
  49. if (argc != 2)
  50. return 1;
  51. if (strcmp(argv[1], "depends") == 0)
  52. return 0;
  53. return 1;
  54. }