Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Add a basic test for infocmp - this would have cought todays...



details:   https://anonhg.NetBSD.org/src/rev/fbfb72a46291
branches:  trunk
changeset: 779633:fbfb72a46291
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Jun 06 21:23:10 2012 +0000

description:
Add a basic test for infocmp - this would have cought todays terminfo
lossage (PR lib/46553).

diffstat:

 distrib/sets/lists/tests/mi         |   5 ++-
 etc/mtree/NetBSD.dist.tests         |   3 +-
 tests/usr.bin/Makefile              |   4 +-
 tests/usr.bin/infocmp/Makefile      |   9 +++++
 tests/usr.bin/infocmp/t_terminfo.sh |  62 +++++++++++++++++++++++++++++++++++++
 5 files changed, 79 insertions(+), 4 deletions(-)

diffs (133 lines):

diff -r 357ee08095f1 -r fbfb72a46291 distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Wed Jun 06 20:21:43 2012 +0000
+++ b/distrib/sets/lists/tests/mi       Wed Jun 06 21:23:10 2012 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.472 2012/06/03 23:19:10 joerg Exp $
+# $NetBSD: mi,v 1.473 2012/06/06 21:23:10 martin Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3081,6 +3081,9 @@
 ./usr/tests/usr.bin/id/t_groups                        tests-usr.bin-tests     atf
 ./usr/tests/usr.bin/id/t_id                    tests-usr.bin-tests     atf
 ./usr/tests/usr.bin/id/t_whoami                        tests-usr.bin-tests     atf
+./usr/tests/usr.bin/infocmp                    tests-usr.bin-tests
+./usr/tests/usr.bin/infocmp/Atffile            tests-usr.bin-tests     atf
+./usr/tests/usr.bin/infocmp/t_terminfo         tests-usr.bin-tests     atf
 ./usr/tests/usr.bin/jot                                tests-usr.bin-tests
 ./usr/tests/usr.bin/jot/Atffile                        tests-usr.bin-tests     atf
 ./usr/tests/usr.bin/jot/d_basic.out            tests-usr.bin-tests     atf
diff -r 357ee08095f1 -r fbfb72a46291 etc/mtree/NetBSD.dist.tests
--- a/etc/mtree/NetBSD.dist.tests       Wed Jun 06 20:21:43 2012 +0000
+++ b/etc/mtree/NetBSD.dist.tests       Wed Jun 06 21:23:10 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: NetBSD.dist.tests,v 1.77 2012/05/27 23:03:24 martin Exp $
+#      $NetBSD: NetBSD.dist.tests,v 1.78 2012/06/06 21:23:10 martin Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -285,6 +285,7 @@
 ./usr/tests/usr.bin/grep
 ./usr/tests/usr.bin/gzip
 ./usr/tests/usr.bin/id
+./usr/tests/usr.bin/infocmp
 ./usr/tests/usr.bin/jot
 ./usr/tests/usr.bin/m4
 ./usr/tests/usr.bin/make
diff -r 357ee08095f1 -r fbfb72a46291 tests/usr.bin/Makefile
--- a/tests/usr.bin/Makefile    Wed Jun 06 20:21:43 2012 +0000
+++ b/tests/usr.bin/Makefile    Wed Jun 06 21:23:10 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.14 2012/05/18 15:25:25 jruoho Exp $
+#      $NetBSD: Makefile,v 1.15 2012/06/06 21:23:10 martin Exp $
 #
 
 .include <bsd.own.mk>
@@ -6,7 +6,7 @@
 TESTSDIR=       ${TESTSBASE}/usr.bin
 
 TESTS_SUBDIRS= awk basename bzip2 cc cmp config cut \
-               diff dirname find grep gzip id jot m4 make mkdep \
+               diff dirname find grep gzip id infocmp jot m4 make mkdep \
                pr rump_server shmif_dumpbus sdiff sed sort tmux unifdef xlint
 
 .include <bsd.test.mk>
diff -r 357ee08095f1 -r fbfb72a46291 tests/usr.bin/infocmp/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/infocmp/Makefile    Wed Jun 06 21:23:10 2012 +0000
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile,v 1.1 2012/06/06 21:23:10 martin Exp $
+
+.include <bsd.own.mk>
+
+TESTSDIR=      ${TESTSBASE}/usr.bin/infocmp
+
+TESTS_SH=      t_terminfo
+
+.include <bsd.test.mk>
diff -r 357ee08095f1 -r fbfb72a46291 tests/usr.bin/infocmp/t_terminfo.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/infocmp/t_terminfo.sh       Wed Jun 06 21:23:10 2012 +0000
@@ -0,0 +1,62 @@
+#      $NetBSD: t_terminfo.sh,v 1.1 2012/06/06 21:23:10 martin Exp $
+#
+# Copyright (c) 2011 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.
+#
+
+atf_test_case basic
+basic_head() {
+       atf_set "descr" "infocmp can decode one of some existing term types"
+       atf_set "require.progs" "infocmp env"
+}
+
+basic_body() {
+       for term in ansi vt100 wsvt25 sun-ss5 ibcs2 vt52 386at h19k h19kermit
+       do
+               atf_check -s exit:0 -e empty -o not-empty \
+                       env TERM="${term}" infocmp
+       done
+}
+
+atf_test_case missing
+missing_head() {
+       atf_set "descr" "infocmp fails to decode non existent entries"
+       atf_set "require.progs" "infocmp env"
+}
+
+missing_body() {
+       for term in this-is-no-term nonexistent
+       do
+               atf_check -s not-exit:0 -e not-empty -o empty \
+                       env TERM="${term}" infocmp
+       done
+}
+
+atf_init_test_cases()
+{
+
+       atf_add_test_case basic
+       atf_add_test_case missing
+}
+



Home | Main Index | Thread Index | Old Index