Module Name: src
Committed By: plunky
Date: Mon Nov 2 10:15:45 UTC 2009
Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.base
src/tests/lib: Makefile
Added Files:
src/tests/lib/libevent: Atffile Makefile t_event.sh
Log Message:
add ATF tests for libevent
To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.4 -r1.5 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.1 -r1.2 src/tests/lib/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libevent/Atffile \
src/tests/lib/libevent/Makefile src/tests/lib/libevent/t_event.sh
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.53 src/distrib/sets/lists/tests/mi:1.54
--- src/distrib/sets/lists/tests/mi:1.53 Tue Oct 20 22:00:38 2009
+++ src/distrib/sets/lists/tests/mi Mon Nov 2 10:15:45 2009
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.53 2009/10/20 22:00:38 jmmv Exp $
+# $NetBSD: mi,v 1.54 2009/11/02 10:15:45 plunky Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -139,6 +139,9 @@
./usr/libdata/debug/usr/tests/lib/libc/stdlib/t_mi_vector_hash.debug tests-lib-debug debug
./usr/libdata/debug/usr/tests/lib/libc/string tests-lib-debug
./usr/libdata/debug/usr/tests/lib/libc/string/t_popcount.debug tests-lib-debug debug
+./usr/libdata/debug/usr/tests/lib/libevent tests-lib-debug
+./usr/libdata/debug/usr/tests/lib/libevent/h_event.debug tests-lib-debug debug
+./usr/libdata/debug/usr/tests/lib/libevent/t_event.debug tests-lib-debug debug
./usr/libdata/debug/usr/tests/libexec tests-lib-debug
./usr/libdata/debug/usr/tests/libexec/ld.elf_so tests-libexec-debug
./usr/libdata/debug/usr/tests/libexec/ld.elf_so/t_dlinfo.debug tests-libexec-debug debug
@@ -858,6 +861,10 @@
./usr/tests/lib/libc/string tests-lib-tests
./usr/tests/lib/libc/string/Atffile tests-lib-tests
./usr/tests/lib/libc/string/t_popcount tests-lib-tests
+./usr/tests/lib/libevent tests-lib-tests
+./usr/tests/lib/libevent/Atffile tests-lib-tests
+./usr/tests/lib/libevent/h_event tests-lib-tests
+./usr/tests/lib/libevent/t_event tests-lib-tests
./usr/tests/libexec tests-lib-tests
./usr/tests/libexec/Atffile tests-lib-tests
./usr/tests/libexec/ld.elf_so tests-libexec-tests
Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.4 src/etc/mtree/NetBSD.dist.base:1.5
--- src/etc/mtree/NetBSD.dist.base:1.4 Mon Oct 12 08:54:19 2009
+++ src/etc/mtree/NetBSD.dist.base Mon Nov 2 10:15:45 2009
@@ -1,4 +1,4 @@
-# $NetBSD: NetBSD.dist.base,v 1.4 2009/10/12 08:54:19 tron Exp $
+# $NetBSD: NetBSD.dist.base,v 1.5 2009/11/02 10:15:45 plunky Exp $
# @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93
# Do not customize this file as it may be overwritten on upgrades.
@@ -209,6 +209,7 @@
./usr/libdata/debug/usr/tests/lib/libc
./usr/libdata/debug/usr/tests/lib/libc/stdlib
./usr/libdata/debug/usr/tests/lib/libc/string
+./usr/libdata/debug/usr/tests/lib/libevent
./usr/libdata/debug/usr/tests/libexec
./usr/libdata/debug/usr/tests/libexec/ld.elf_so
./usr/libdata/debug/usr/tests/modules
@@ -1096,6 +1097,7 @@
./usr/tests/lib/libc
./usr/tests/lib/libc/stdlib
./usr/tests/lib/libc/string
+./usr/tests/lib/libevent
./usr/tests/libexec
./usr/tests/libexec/ld.elf_so
./usr/tests/modules
Index: src/tests/lib/Makefile
diff -u src/tests/lib/Makefile:1.1 src/tests/lib/Makefile:1.2
--- src/tests/lib/Makefile:1.1 Mon Jul 20 17:03:38 2009
+++ src/tests/lib/Makefile Mon Nov 2 10:15:45 2009
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.1 2009/07/20 17:03:38 joerg Exp $
+# $NetBSD: Makefile,v 1.2 2009/11/02 10:15:45 plunky Exp $
.include <bsd.own.mk>
-SUBDIR= libc
+SUBDIR= libc libevent
TESTSDIR= ${TESTSBASE}/lib
Added files:
Index: src/tests/lib/libevent/Atffile
diff -u /dev/null src/tests/lib/libevent/Atffile:1.1
--- /dev/null Mon Nov 2 10:15:45 2009
+++ src/tests/lib/libevent/Atffile Mon Nov 2 10:15:45 2009
@@ -0,0 +1,6 @@
+Content-Type: application/X-atf-atffile; version="1"
+X-NetBSD-Id: "$NetBSD: Atffile,v 1.1 2009/11/02 10:15:45 plunky Exp $"
+
+prop: test-suite = "NetBSD"
+
+tp: t_event
Index: src/tests/lib/libevent/Makefile
diff -u /dev/null src/tests/lib/libevent/Makefile:1.1
--- /dev/null Mon Nov 2 10:15:45 2009
+++ src/tests/lib/libevent/Makefile Mon Nov 2 10:15:45 2009
@@ -0,0 +1,26 @@
+# $NetBSD: Makefile,v 1.1 2009/11/02 10:15:45 plunky Exp $
+
+TESTSDIR= ${TESTSBASE}/lib/libevent
+
+TESTS_SH= t_event
+
+.include <bsd.own.mk>
+.include <../../../external/bsd/libevent/Makefile.inc>
+
+.PATH: ${LIBEVENT_DIR}/dist/test
+
+BINDIR= ${TESTSDIR}
+
+PROG= h_event
+MAN= # defined
+SRCS= regress.c regress.gen.c regress_dns.c regress_http.c \
+ regress_rpc.c
+
+DPADD+= ${LIBEVENT}
+LDADD+= -levent
+
+CPPFLAGS.regress.c+= -Wno-cast-qual -Wno-sign-compare -Wno-shadow
+CPPFLAGS.regress_http.c+= -Wno-cast-qual -Wno-sign-compare -Wno-shadow
+CPPFLAGS.regress_rpc.c+= -Wno-cast-qual -Wno-shadow
+
+.include <bsd.test.mk>
Index: src/tests/lib/libevent/t_event.sh
diff -u /dev/null src/tests/lib/libevent/t_event.sh:1.1
--- /dev/null Mon Nov 2 10:15:45 2009
+++ src/tests/lib/libevent/t_event.sh Mon Nov 2 10:15:45 2009
@@ -0,0 +1,67 @@
+# $NetBSD: t_event.sh,v 1.1 2009/11/02 10:15:45 plunky Exp $
+#
+# Copyright (c) 2009 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+#
+# This is not great but rather than reimplementing the libevent
+# provided regression tests, we use an ATF wrapper around the test
+# program which carries out all the tests and prints an extensive
+# report.
+#
+
+atf_test_case kqueue
+kqueue_head() {
+ atf_set "descr" "Test libevent with kqueue backend"
+}
+kqueue_body() {
+ EVENT_NOPOLL=1 EVENT_NOSELECT=1 \
+ $(atf_get_srcdir)/h_event 2>&1 || atf_fail "check report"
+}
+
+atf_test_case poll
+poll_head() {
+ atf_set "descr" "Test libevent with poll backend"
+}
+poll_body() {
+ EVENT_NOKQUEUE=1 EVENT_NOSELECT=1 \
+ $(atf_get_srcdir)/h_event 2>&1 || atf_fail "check report"
+}
+
+atf_test_case select
+select_head() {
+ atf_set "descr" "Test libevent with select backend"
+}
+select_body() {
+ EVENT_NOKQUEUE=1 EVENT_NOPOLL=1 \
+ $(atf_get_srcdir)/h_event 2>&1 || atf_fail "check report"
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case kqueue
+ atf_add_test_case poll
+ atf_add_test_case select
+}