1*67b74161Spgoyette# $NetBSD: t_event.sh,v 1.3 2010/11/29 18:21:15 pgoyette Exp $ 2b2965573Splunky# 3b2965573Splunky# Copyright (c) 2009 The NetBSD Foundation, Inc. 4b2965573Splunky# All rights reserved. 5b2965573Splunky# 6b2965573Splunky# Redistribution and use in source and binary forms, with or without 7b2965573Splunky# modification, are permitted provided that the following conditions 8b2965573Splunky# are met: 9b2965573Splunky# 1. Redistributions of source code must retain the above copyright 10b2965573Splunky# notice, this list of conditions and the following disclaimer. 11b2965573Splunky# 2. Redistributions in binary form must reproduce the above copyright 12b2965573Splunky# notice, this list of conditions and the following disclaimer in the 13b2965573Splunky# documentation and/or other materials provided with the distribution. 14b2965573Splunky# 15b2965573Splunky# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 16b2965573Splunky# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17b2965573Splunky# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18b2965573Splunky# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19b2965573Splunky# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20b2965573Splunky# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21b2965573Splunky# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22b2965573Splunky# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23b2965573Splunky# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24b2965573Splunky# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25b2965573Splunky# POSSIBILITY OF SUCH DAMAGE. 26b2965573Splunky# 27b2965573Splunky 28b2965573Splunky# 29b2965573Splunky# This is not great but rather than reimplementing the libevent 30b2965573Splunky# provided regression tests, we use an ATF wrapper around the test 31b2965573Splunky# program which carries out all the tests and prints an extensive 32b2965573Splunky# report. 33b2965573Splunky# 34b2965573Splunky 35b2965573Splunkyatf_test_case kqueue 36b2965573Splunkykqueue_head() { 37b2965573Splunky atf_set "descr" "Test libevent with kqueue backend" 38b2965573Splunky} 39b2965573Splunkykqueue_body() { 40b2965573Splunky EVENT_NOPOLL=1 EVENT_NOSELECT=1 \ 41b2965573Splunky $(atf_get_srcdir)/h_event 2>&1 || atf_fail "check report" 42b2965573Splunky} 43b2965573Splunky 44b2965573Splunkyatf_test_case poll 45b2965573Splunkypoll_head() { 46b2965573Splunky atf_set "descr" "Test libevent with poll backend" 47b2965573Splunky} 48b2965573Splunkypoll_body() { 49b2965573Splunky EVENT_NOKQUEUE=1 EVENT_NOSELECT=1 \ 50b2965573Splunky $(atf_get_srcdir)/h_event 2>&1 || atf_fail "check report" 51b2965573Splunky} 52b2965573Splunky 53b2965573Splunkyatf_test_case select 54b2965573Splunkyselect_head() { 55b2965573Splunky atf_set "descr" "Test libevent with select backend" 56b2965573Splunky} 57b2965573Splunkyselect_body() { 58b2965573Splunky EVENT_NOKQUEUE=1 EVENT_NOPOLL=1 \ 59b2965573Splunky $(atf_get_srcdir)/h_event 2>&1 || atf_fail "check report" 60b2965573Splunky} 61b2965573Splunky 62b2965573Splunkyatf_init_test_cases() 63b2965573Splunky{ 64b2965573Splunky atf_add_test_case kqueue 65b2965573Splunky atf_add_test_case poll 66b2965573Splunky atf_add_test_case select 67b2965573Splunky} 68