#! /bin/sh

rc=0

run=no

for SU_PORT in select kqueue devpoll epoll poll ; do

export SU_PORT

egrep -i '^#define have_(sys_)?'$SU_PORT ../../config.h >/dev/null ||
continue

run=yes

if $VALGRIND ./test_su ; then
    echo PASS: multithread test_su with $SU_PORT
else
    echo FAIL: multithread test_su with $SU_PORT failed
    rc=1
fi

if $VALGRIND ./test_su -s ; then
    echo PASS: singlethread test_su with $SU_PORT
else
    echo FAIL: singlethread test_su with $SU_PORT failed
    rc=1
fi

done

test $run = no && exit 77

exit $rc