mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-03-19 05:34:02 -04:00
tests: add test_usleep and test_sleep functions
The former one was already used in tests, but was private. These functions can be shared across the tests, so make them public. Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
parent
7bf8049c48
commit
6ebe55060e
3 changed files with 44 additions and 15 deletions
|
|
@ -5,6 +5,8 @@
|
|||
#error "Tests must not be built with NDEBUG defined, they rely on assert()."
|
||||
#endif
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
struct test {
|
||||
const char *name;
|
||||
void (*run)(void);
|
||||
|
|
@ -44,4 +46,14 @@ exec_fd_leak_check(int nr_expected_fds); /* never returns */
|
|||
void
|
||||
test_set_timeout(unsigned int);
|
||||
|
||||
/* test-runner uses alarm() and SIGALRM, so we can not
|
||||
* use usleep and sleep functions in tests (see 'man usleep'
|
||||
* or 'man sleep', respectively). Following functions are safe
|
||||
* to use in tests */
|
||||
void
|
||||
test_usleep(useconds_t);
|
||||
|
||||
void
|
||||
test_sleep(unsigned int);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue