mirror of
https://github.com/darlinghq/darling-libkqueue.git
synced 2024-11-26 21:20:38 +00:00
Minor imporovements to test runner:
* kqtest help message includes the names of test suites that can be run * no need to test for EV_RECEIPT since it's always defined in our local copy of event.h * include netdb.h to enable builds on *BSD. git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@652 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
This commit is contained in:
parent
c46321fbda
commit
655165d380
@ -49,6 +49,7 @@
|
|||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
|
#include <netdb.h>
|
||||||
#else
|
#else
|
||||||
# include "../include/sys/event.h"
|
# include "../include/sys/event.h"
|
||||||
# include "../src/windows/platform.h"
|
# include "../src/windows/platform.h"
|
||||||
|
15
test/main.c
15
test/main.c
@ -117,8 +117,7 @@ test_ev_receipt(void *unused)
|
|||||||
|
|
||||||
if ((kq = kqueue()) < 0)
|
if ((kq = kqueue()) < 0)
|
||||||
die("kqueue()");
|
die("kqueue()");
|
||||||
#if defined(EV_RECEIPT) && !defined(_WIN32)
|
#if !defined(_WIN32)
|
||||||
|
|
||||||
EV_SET(&kev, SIGUSR2, EVFILT_SIGNAL, EV_ADD | EV_RECEIPT, 0, 0, NULL);
|
EV_SET(&kev, SIGUSR2, EVFILT_SIGNAL, EV_ADD | EV_RECEIPT, 0, 0, NULL);
|
||||||
if (kevent(kq, &kev, 1, &kev, 1, NULL) < 0)
|
if (kevent(kq, &kev, 1, &kev, 1, NULL) < 0)
|
||||||
die("kevent");
|
die("kevent");
|
||||||
@ -191,11 +190,13 @@ test_harness(struct unit_test tests[MAX_TESTS], int iterations)
|
|||||||
void
|
void
|
||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
printf("usage:\n"
|
printf("usage: [-hn] [testclass ...]\n"
|
||||||
" -h This message\n"
|
" -h This message\n"
|
||||||
" -n Number of iterations (default: 1)\n"
|
" -n Number of iterations (default: 1)\n"
|
||||||
"\n\n"
|
" testclass Tests suites to run: [socket signal timer vnode user]\n"
|
||||||
);
|
" All tests are run by default\n"
|
||||||
|
"\n"
|
||||||
|
);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user