2003-09-25 17:55:17 +00:00
|
|
|
#!/bin/sh
|
2003-10-05 22:02:49 +00:00
|
|
|
|
2009-12-29 18:07:51 -05:00
|
|
|
if test "x$TEST_OUTPUT_FILE" = "x"
|
|
|
|
then
|
2009-12-29 18:11:52 -05:00
|
|
|
TEST_OUTPUT_FILE=/dev/null
|
2009-12-29 17:59:55 -05:00
|
|
|
fi
|
|
|
|
|
2010-01-12 15:58:36 -05:00
|
|
|
# /bin/echo is a little more likely to support -n than sh's builtin echo.
|
|
|
|
if test -x /bin/echo
|
|
|
|
then
|
|
|
|
ECHO=/bin/echo
|
|
|
|
else
|
|
|
|
ECHO=echo
|
|
|
|
fi
|
|
|
|
|
2009-12-29 18:07:51 -05:00
|
|
|
touch "$TEST_OUTPUT_FILE" || exit 1
|
|
|
|
|
|
|
|
TEST_DIR=.
|
|
|
|
|
|
|
|
T=`echo "$0" | sed -e 's/test.sh$//'`
|
|
|
|
if test -x "$T/test-init"
|
|
|
|
then
|
2009-12-29 18:11:52 -05:00
|
|
|
TEST_DIR="$T"
|
2009-12-29 18:07:51 -05:00
|
|
|
fi
|
2009-12-29 17:59:55 -05:00
|
|
|
|
2003-10-05 22:02:49 +00:00
|
|
|
setup () {
|
2009-12-29 18:11:52 -05:00
|
|
|
EVENT_NOKQUEUE=yes; export EVENT_NOKQUEUE
|
|
|
|
EVENT_NODEVPOLL=yes; export EVENT_NODEVPOLL
|
|
|
|
EVENT_NOPOLL=yes; export EVENT_NOPOLL
|
|
|
|
EVENT_NOSELECT=yes; export EVENT_NOSELECT
|
|
|
|
EVENT_NOEPOLL=yes; export EVENT_NOEPOLL
|
|
|
|
EVENT_NOEVPORT=yes; export EVENT_NOEVPORT
|
2003-09-25 17:55:17 +00:00
|
|
|
}
|
|
|
|
|
2009-12-29 17:59:55 -05:00
|
|
|
announce () {
|
2009-12-29 18:11:52 -05:00
|
|
|
echo $@
|
|
|
|
echo $@ >>"$TEST_OUTPUT_FILE"
|
2009-12-29 17:59:55 -05:00
|
|
|
}
|
|
|
|
|
2010-01-12 15:58:36 -05:00
|
|
|
announce_n () {
|
|
|
|
$ECHO -n $@
|
|
|
|
echo $@ >>"$TEST_OUTPUT_FILE"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-12-29 18:07:51 -05:00
|
|
|
run_tests () {
|
|
|
|
if $TEST_DIR/test-init 2>>"$TEST_OUTPUT_FILE" ;
|
2003-09-25 17:55:17 +00:00
|
|
|
then
|
2009-12-29 18:11:52 -05:00
|
|
|
true
|
2005-09-02 05:34:01 +00:00
|
|
|
else
|
2009-12-29 17:59:55 -05:00
|
|
|
announce Skipping test
|
2003-09-25 17:55:17 +00:00
|
|
|
return
|
2009-12-29 18:11:52 -05:00
|
|
|
fi
|
2003-09-25 17:55:17 +00:00
|
|
|
|
2010-01-12 15:58:36 -05:00
|
|
|
announce_n " test-eof: "
|
2009-12-29 18:11:52 -05:00
|
|
|
if $TEST_DIR/test-eof >>"$TEST_OUTPUT_FILE" ;
|
|
|
|
then
|
|
|
|
announce OKAY ;
|
|
|
|
else
|
|
|
|
announce FAILED ;
|
|
|
|
fi
|
2010-01-12 15:58:36 -05:00
|
|
|
announce_n " test-weof: "
|
2009-12-29 18:11:52 -05:00
|
|
|
if $TEST_DIR/test-weof >>"$TEST_OUTPUT_FILE" ;
|
|
|
|
then
|
|
|
|
announce OKAY ;
|
|
|
|
else
|
|
|
|
announce FAILED ;
|
|
|
|
fi
|
2010-01-12 15:58:36 -05:00
|
|
|
announce_n " test-time: "
|
2009-12-29 18:11:52 -05:00
|
|
|
if $TEST_DIR/test-time >>"$TEST_OUTPUT_FILE" ;
|
|
|
|
then
|
|
|
|
announce OKAY ;
|
|
|
|
else
|
|
|
|
announce FAILED ;
|
|
|
|
fi
|
2010-01-12 15:58:36 -05:00
|
|
|
announce_n " regress: "
|
2009-12-29 18:11:52 -05:00
|
|
|
if $TEST_DIR/regress >>"$TEST_OUTPUT_FILE" ;
|
|
|
|
then
|
|
|
|
announce OKAY ;
|
|
|
|
else
|
|
|
|
announce FAILED ;
|
|
|
|
fi
|
2003-09-25 17:55:17 +00:00
|
|
|
}
|
|
|
|
|
2009-12-29 18:11:52 -05:00
|
|
|
announce "Running tests:"
|
2003-09-25 17:55:17 +00:00
|
|
|
|
|
|
|
# Need to do this by hand?
|
|
|
|
setup
|
|
|
|
unset EVENT_NOKQUEUE
|
2005-09-02 05:34:01 +00:00
|
|
|
export EVENT_NOKQUEUE
|
2009-12-29 17:59:55 -05:00
|
|
|
announce "KQUEUE"
|
2009-12-29 18:07:51 -05:00
|
|
|
run_tests
|
2003-09-25 17:55:17 +00:00
|
|
|
|
2004-07-30 04:57:21 +00:00
|
|
|
setup
|
|
|
|
unset EVENT_NODEVPOLL
|
2005-09-02 05:34:01 +00:00
|
|
|
export EVENT_NODEVPOLL
|
2009-12-29 17:59:55 -05:00
|
|
|
announce "DEVPOLL"
|
2009-12-29 18:07:51 -05:00
|
|
|
run_tests
|
2004-07-30 04:57:21 +00:00
|
|
|
|
2003-09-25 17:55:17 +00:00
|
|
|
setup
|
|
|
|
unset EVENT_NOPOLL
|
2005-09-02 05:34:01 +00:00
|
|
|
export EVENT_NOPOLL
|
2009-12-29 17:59:55 -05:00
|
|
|
announce "POLL"
|
2009-12-29 18:07:51 -05:00
|
|
|
run_tests
|
2003-09-25 17:55:17 +00:00
|
|
|
|
|
|
|
setup
|
|
|
|
unset EVENT_NOSELECT
|
2005-09-02 05:34:01 +00:00
|
|
|
export EVENT_NOSELECT
|
2009-12-29 17:59:55 -05:00
|
|
|
announce "SELECT"
|
2009-12-29 18:07:51 -05:00
|
|
|
run_tests
|
2003-09-25 17:55:17 +00:00
|
|
|
|
|
|
|
setup
|
|
|
|
unset EVENT_NOEPOLL
|
2005-09-02 05:34:01 +00:00
|
|
|
export EVENT_NOEPOLL
|
2009-12-29 17:59:55 -05:00
|
|
|
announce "EPOLL"
|
2009-12-29 18:07:51 -05:00
|
|
|
run_tests
|
2003-09-25 17:55:17 +00:00
|
|
|
|
2007-09-25 15:50:50 +00:00
|
|
|
setup
|
|
|
|
unset EVENT_NOEVPORT
|
|
|
|
export EVENT_NOEVPORT
|
2009-12-29 17:59:55 -05:00
|
|
|
announce "EVPORT"
|
2009-12-29 18:07:51 -05:00
|
|
|
run_tests
|