timed tail for logfiles. Display loglines given a minimum date and/or a maximum date.
c
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ttail_argparse_date_fmt.c 857B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include <check.h>
  2. #include <errno.h>
  3. #include <stdio.h>
  4. #include <unistd.h>
  5. #include "ttail_check.h"
  6. #include "ttail.h"
  7. #include "ttail_init.h"
  8. START_TEST (test_argparse_fmt_short)
  9. {
  10. ttail_t *t;
  11. char *args[] = {"foo", "-f", "%m"};
  12. t = ttail_init(3, args);
  13. ck_assert(t != NULL);
  14. }
  15. END_TEST
  16. START_TEST (test_argparse_fmt_long)
  17. {
  18. ttail_t *t;
  19. char *args[] = {"foo", "--date-format", "%m"};
  20. t = ttail_init(3, args);
  21. ck_assert(t != NULL);
  22. }
  23. END_TEST
  24. START_TEST (test_argparse_fmt_multiple)
  25. {
  26. ttail_t *t;
  27. char *args[] = {"foo", "-f", "%m", "-f", "%d"};
  28. t = ttail_init(5, args);
  29. ck_assert(t == NULL);
  30. }
  31. END_TEST
  32. TTAIL_CHECK_START( "ttail argument parsing checks", \
  33. "date format arguments parsing")
  34. TTAIL_ADD_TEST(test_argparse_fmt_short);
  35. TTAIL_ADD_TEST(test_argparse_fmt_long);
  36. TTAIL_ADD_TEST(test_argparse_fmt_multiple);
  37. TTAIL_CHECK_END