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:
eradman 2013-06-11 14:45:42 +00:00
parent c46321fbda
commit 655165d380
2 changed files with 9 additions and 7 deletions

View File

@ -49,6 +49,7 @@
#include <pthread.h>
#include <poll.h>
#include "../config.h"
#include <netdb.h>
#else
# include "../include/sys/event.h"
# include "../src/windows/platform.h"

View File

@ -117,8 +117,7 @@ test_ev_receipt(void *unused)
if ((kq = kqueue()) < 0)
die("kqueue()");
#if defined(EV_RECEIPT) && !defined(_WIN32)
#if !defined(_WIN32)
EV_SET(&kev, SIGUSR2, EVFILT_SIGNAL, EV_ADD | EV_RECEIPT, 0, 0, NULL);
if (kevent(kq, &kev, 1, &kev, 1, NULL) < 0)
die("kevent");
@ -191,11 +190,13 @@ test_harness(struct unit_test tests[MAX_TESTS], int iterations)
void
usage(void)
{
printf("usage:\n"
" -h This message\n"
" -n Number of iterations (default: 1)\n"
"\n\n"
);
printf("usage: [-hn] [testclass ...]\n"
" -h This message\n"
" -n Number of iterations (default: 1)\n"
" testclass Tests suites to run: [socket signal timer vnode user]\n"
" All tests are run by default\n"
"\n"
);
exit(1);
}