Module Name:    src
Committed By:   njoly
Date:           Mon May 30 18:14:11 UTC 2011

Modified Files:
        src/distrib/sets/lists/tests: mi
        src/etc/mtree: NetBSD.dist.tests
Added Files:
        src/tests/usr.bin/mkdep: Makefile t_mkdep.sh

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


To generate a diff of this commit:
cvs rdiff -u -r1.340 -r1.341 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.48 -r1.49 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/mkdep/Makefile \
    src/tests/usr.bin/mkdep/t_mkdep.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.340 src/distrib/sets/lists/tests/mi:1.341
--- src/distrib/sets/lists/tests/mi:1.340	Sat May 28 16:12:56 2011
+++ src/distrib/sets/lists/tests/mi	Mon May 30 18:14:11 2011
@@ -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

Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.48 src/etc/mtree/NetBSD.dist.tests:1.49
--- src/etc/mtree/NetBSD.dist.tests:1.48	Mon May  9 17:53:54 2011
+++ src/etc/mtree/NetBSD.dist.tests	Mon May 30 18:14:11 2011
@@ -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

Added files:

Index: src/tests/usr.bin/mkdep/Makefile
diff -u /dev/null src/tests/usr.bin/mkdep/Makefile:1.1
--- /dev/null	Mon May 30 18:14:11 2011
+++ src/tests/usr.bin/mkdep/Makefile	Mon May 30 18:14:11 2011
@@ -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>
Index: src/tests/usr.bin/mkdep/t_mkdep.sh
diff -u /dev/null src/tests/usr.bin/mkdep/t_mkdep.sh:1.1
--- /dev/null	Mon May 30 18:14:11 2011
+++ src/tests/usr.bin/mkdep/t_mkdep.sh	Mon May 30 18:14:11 2011
@@ -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
+}

Reply via email to