mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
test: run different tests under different options (in a wrapper)
This commit is contained in:
parent
a7513cc968
commit
54d7473f91
38
test/test.sh
38
test/test.sh
@ -28,7 +28,7 @@ fi
|
||||
TEST_DIR=.
|
||||
TEST_SRC_DIR=.
|
||||
|
||||
T=`echo "$0" | sed -e 's/test.sh$//' | sed -e 's/test-script.sh//' `
|
||||
T=`echo "$0" | sed -e 's/test.sh$//'`
|
||||
if test -x "$T/test-init"
|
||||
then
|
||||
TEST_DIR="$T"
|
||||
@ -146,15 +146,43 @@ do_test() {
|
||||
run_tests
|
||||
}
|
||||
|
||||
usage()
|
||||
{
|
||||
cat <<EOL
|
||||
-b - specify backends
|
||||
-t - run timerfd test
|
||||
-c - run changelist test
|
||||
-T - run timerfd+changelist test
|
||||
EOL
|
||||
}
|
||||
main()
|
||||
{
|
||||
backends=$BACKENDS
|
||||
timerfd=0
|
||||
changelist=0
|
||||
timerfd_changelist=0
|
||||
|
||||
while getopts "b:tcT" c; do
|
||||
case "$c" in
|
||||
b) backends="$OPTARG";;
|
||||
t) timerfd=1;;
|
||||
c) changelist=1;;
|
||||
T) timerfd_changelist=1;;
|
||||
?*) usage && exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
announce "Running tests:"
|
||||
|
||||
do_test EPOLL "(timerfd)"
|
||||
do_test EPOLL "(changelist)"
|
||||
do_test EPOLL "(timerfd+changelist)"
|
||||
for i in $BACKENDS; do
|
||||
[ $timerfd -eq 0 ] || do_test EPOLL "(timerfd)"
|
||||
[ $changelist -eq 0 ] || do_test EPOLL "(changelist)"
|
||||
[ $timerfd_changelist -eq 0 ] || do_test EPOLL "(timerfd+changelist)"
|
||||
for i in $backends; do
|
||||
do_test $i
|
||||
done
|
||||
|
||||
if test "$FAILED" = "yes"; then
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
main "$@"
|
||||
|
Loading…
x
Reference in New Issue
Block a user