AT_BANNER([timeval unit tests]) AT_SETUP([check that time advances]) AT_KEYWORDS([timeval]) AT_CHECK([test-timeval plain], [0]) AT_CLEANUP AT_SETUP([check that time advances after daemonize()]) AT_KEYWORDS([timeval]) AT_CHECK([test-timeval daemon], [0]) AT_CHECK( [# First try a quick sleep, so that the test completes very quickly # in the normal case. POSIX doesn't require fractional times to # work, so this might not work. sleep 0.1; if test -e test-timeval.success; then echo success; exit 0; fi # Then wait up to 2 seconds. sleep 1; if test -e test-timeval.success; then echo success; exit 0; fi sleep 1; if test -e test-timeval.success; then echo success; exit 0; fi echo failure; exit 1], [0], [success ], []) AT_CLEANUP