Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src add ATF tests for libevent
details: https://anonhg.NetBSD.org/src/rev/a42dfdeb38b7
branches: trunk
changeset: 748705:a42dfdeb38b7
user: plunky <plunky%NetBSD.org@localhost>
date: Mon Nov 02 10:15:45 2009 +0000
description:
add ATF tests for libevent
diffstat:
distrib/sets/lists/tests/mi | 9 +++++-
etc/mtree/NetBSD.dist.base | 4 +-
tests/lib/Makefile | 4 +-
tests/lib/libevent/Atffile | 6 +++
tests/lib/libevent/Makefile | 26 ++++++++++++++++
tests/lib/libevent/t_event.sh | 67 +++++++++++++++++++++++++++++++++++++++++++
6 files changed, 112 insertions(+), 4 deletions(-)
diffs (180 lines):
diff -r 9f09a129d33d -r a42dfdeb38b7 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi Mon Nov 02 10:14:28 2009 +0000
+++ b/distrib/sets/lists/tests/mi Mon Nov 02 10:15:45 2009 +0000
@@ -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
diff -r 9f09a129d33d -r a42dfdeb38b7 etc/mtree/NetBSD.dist.base
--- a/etc/mtree/NetBSD.dist.base Mon Nov 02 10:14:28 2009 +0000
+++ b/etc/mtree/NetBSD.dist.base Mon Nov 02 10:15:45 2009 +0000
@@ -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
diff -r 9f09a129d33d -r a42dfdeb38b7 tests/lib/Makefile
--- a/tests/lib/Makefile Mon Nov 02 10:14:28 2009 +0000
+++ b/tests/lib/Makefile Mon Nov 02 10:15:45 2009 +0000
@@ -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
diff -r 9f09a129d33d -r a42dfdeb38b7 tests/lib/libevent/Atffile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/lib/libevent/Atffile Mon Nov 02 10:15:45 2009 +0000
@@ -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
diff -r 9f09a129d33d -r a42dfdeb38b7 tests/lib/libevent/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/lib/libevent/Makefile Mon Nov 02 10:15:45 2009 +0000
@@ -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>
diff -r 9f09a129d33d -r a42dfdeb38b7 tests/lib/libevent/t_event.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/lib/libevent/t_event.sh Mon Nov 02 10:15:45 2009 +0000
@@ -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
+}
Home |
Main Index |
Thread Index |
Old Index