Source-Changes-HG archive

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

[src/trunk]: src Add testcase for PR bin/45004, to exercize suffixes lists for



details:   https://anonhg.NetBSD.org/src/rev/9351f226fc6b
branches:  trunk
changeset: 765568:9351f226fc6b
user:      njoly <njoly%NetBSD.org@localhost>
date:      Mon May 30 18:14:11 2011 +0000

description:
Add testcase for PR bin/45004, to exercize suffixes lists for
mkdep(1).

diffstat:

 distrib/sets/lists/tests/mi    |   5 ++-
 etc/mtree/NetBSD.dist.tests    |   3 +-
 tests/usr.bin/mkdep/Makefile   |   9 ++++++
 tests/usr.bin/mkdep/t_mkdep.sh |  57 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 72 insertions(+), 2 deletions(-)

diffs (110 lines):

diff -r b499e298eb20 -r 9351f226fc6b distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Mon May 30 17:50:31 2011 +0000
+++ b/distrib/sets/lists/tests/mi       Mon May 30 18:14:11 2011 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.340 2011/05/28 16:12:56 tron Exp $
+# $NetBSD: mi,v 1.341 2011/05/30 18:14:11 njoly Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2344,6 +2344,9 @@
 ./usr/tests/usr.bin/diff/d_mallocv1.in         tests-util-tests        atf
 ./usr/tests/usr.bin/diff/d_mallocv2.in         tests-util-tests        atf
 ./usr/tests/usr.bin/diff/t_diff                        tests-util-tests        atf
+./usr/tests/usr.bin/mkdep                      tests-util-tests
+./usr/tests/usr.bin/mkdep/Atffile              tests-util-tests        atf
+./usr/tests/usr.bin/mkdep/t_mkdep              tests-util-tests        atf
 ./usr/tests/usr.bin/pr                         tests-util-tests
 ./usr/tests/usr.bin/pr/Atffile                 tests-util-tests        atf
 ./usr/tests/usr.bin/pr/d_basic.in              tests-util-tests        atf
diff -r b499e298eb20 -r 9351f226fc6b etc/mtree/NetBSD.dist.tests
--- a/etc/mtree/NetBSD.dist.tests       Mon May 30 17:50:31 2011 +0000
+++ b/etc/mtree/NetBSD.dist.tests       Mon May 30 18:14:11 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: NetBSD.dist.tests,v 1.48 2011/05/09 17:53:54 jruoho Exp $
+#      $NetBSD: NetBSD.dist.tests,v 1.49 2011/05/30 18:14:11 njoly Exp $
 
 ./usr/libdata/debug/usr/tests
 ./usr/libdata/debug/usr/tests/atf
@@ -242,6 +242,7 @@
 ./usr/tests/toolchain/cc
 ./usr/tests/usr.bin
 ./usr/tests/usr.bin/diff
+./usr/tests/usr.bin/mkdep
 ./usr/tests/usr.bin/pr
 ./usr/tests/usr.bin/rump_server
 ./usr/tests/usr.bin/shmif_dumpbus
diff -r b499e298eb20 -r 9351f226fc6b tests/usr.bin/mkdep/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/mkdep/Makefile      Mon May 30 18:14:11 2011 +0000
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile,v 1.1 2011/05/30 18:14:11 njoly Exp $
+
+.include <bsd.own.mk>
+
+TESTSDIR=      ${TESTSBASE}/usr.bin/mkdep
+
+TESTS_SH=      t_mkdep
+
+.include <bsd.test.mk>
diff -r b499e298eb20 -r 9351f226fc6b tests/usr.bin/mkdep/t_mkdep.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/mkdep/t_mkdep.sh    Mon May 30 18:14:11 2011 +0000
@@ -0,0 +1,57 @@
+# $NetBSD: t_mkdep.sh,v 1.1 2011/05/30 18:14:11 njoly Exp $
+#
+# Copyright (c) 2011 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Nicolas Joly.
+#
+# 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 suffixes
+suffixes_head() {
+       atf_set "descr" "Test suffixes list"
+}
+
+suffixes_body() {
+
+       atf_check touch sample.c
+
+       # No list
+       atf_check mkdep -f sample.d sample.c
+       atf_check -o ignore grep '^sample.o:' sample.d
+
+       # Suffix list
+       atf_check mkdep -f sample.d -s '.a .b' sample.c
+       atf_check -o ignore grep '^sample.a sample.b:' sample.d
+
+       # Empty list
+       atf_expect_fail "PR bin/45004"
+       atf_check mkdep -f sample.d -s '' sample.c
+       atf_check -o ignore grep '^sample:' sample.d
+       atf_expect_pass
+}
+
+atf_init_test_cases() {
+       atf_add_test_case suffixes
+}



Home | Main Index | Thread Index | Old Index