Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Move tests for examples from tests/examples to tests/share/e...
details: https://anonhg.NetBSD.org/src/rev/21187d04e55c
branches: trunk
changeset: 784977:21187d04e55c
user: jmmv <jmmv%NetBSD.org@localhost>
date: Sat Feb 16 12:44:25 2013 +0000
description:
Move tests for examples from tests/examples to tests/share/examples.
This is to match the layout of the installed and source files more closely.
While doing this, honor the MKSHARE variable, as the files these tests
validate are only installed when MKSHARE=yes.
diffstat:
distrib/sets/lists/tests/mi | 11 ++++--
etc/mtree/NetBSD.dist.tests | 4 +-
tests/Makefile | 4 +-
tests/examples/Makefile | 9 -----
tests/examples/t_asm.sh | 74 -------------------------------------------
tests/share/Makefile | 4 +-
tests/share/examples/Makefile | 9 +++++
tests/share/examples/t_asm.sh | 74 +++++++++++++++++++++++++++++++++++++++++++
8 files changed, 96 insertions(+), 93 deletions(-)
diffs (272 lines):
diff -r 8878c1f15bda -r 21187d04e55c distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi Sat Feb 16 06:49:59 2013 +0000
+++ b/distrib/sets/lists/tests/mi Sat Feb 16 12:44:25 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.516 2013/02/15 17:09:09 jmmv Exp $
+# $NetBSD: mi,v 1.517 2013/02/16 12:44:25 jmmv Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -815,9 +815,9 @@
./usr/tests/dev/sysmon/Atffile tests-fs-tests atf,rump
./usr/tests/dev/sysmon/t_swsensor tests-fs-tests atf,rump
./usr/tests/dev/sysmon/t_swwdog tests-fs-tests atf,rump
-./usr/tests/examples tests-asm-tests
-./usr/tests/examples/Atffile tests-asm-tests atf
-./usr/tests/examples/t_asm tests-asm-tests atf
+./usr/tests/examples tests-obsolete
+./usr/tests/examples/Atffile tests-obsolete
+./usr/tests/examples/t_asm tests-obsolete
./usr/tests/fs tests-fs-tests
./usr/tests/fs/Atffile tests-fs-tests atf,rump
./usr/tests/fs/h_funcs.subr tests-fs-tests atf,rump
@@ -2300,6 +2300,9 @@
./usr/tests/sbin/sysctl/t_perm tests-sbin-tests atf
./usr/tests/sbin/sysctl/t_sysctl tests-sbin-tests atf
./usr/tests/share tests-sys-tests
+./usr/tests/share/examples tests-asm-tests
+./usr/tests/share/examples/Atffile tests-asm-tests atf,share
+./usr/tests/share/examples/t_asm tests-asm-tests atf,share
./usr/tests/share/Atffile tests-sys-tests atf
./usr/tests/share/mk tests-mk-tests
./usr/tests/share/mk/Atffile tests-mk-tests atf
diff -r 8878c1f15bda -r 21187d04e55c etc/mtree/NetBSD.dist.tests
--- a/etc/mtree/NetBSD.dist.tests Sat Feb 16 06:49:59 2013 +0000
+++ b/etc/mtree/NetBSD.dist.tests Sat Feb 16 12:44:25 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: NetBSD.dist.tests,v 1.90 2012/11/23 08:36:47 njoly Exp $
+# $NetBSD: NetBSD.dist.tests,v 1.91 2013/02/16 12:44:26 jmmv Exp $
./usr/libdata/debug/usr/tests
./usr/libdata/debug/usr/tests/atf
@@ -155,7 +155,6 @@
./usr/tests/dev/raidframe
./usr/tests/dev/scsipi
./usr/tests/dev/sysmon
-./usr/tests/examples
./usr/tests/fs
./usr/tests/fs/ffs
./usr/tests/fs/fifofs
@@ -278,6 +277,7 @@
./usr/tests/sbin/route
./usr/tests/sbin/sysctl
./usr/tests/share
+./usr/tests/share/examples
./usr/tests/share/mk
./usr/tests/sys
./usr/tests/sys/rc
diff -r 8878c1f15bda -r 21187d04e55c tests/Makefile
--- a/tests/Makefile Sat Feb 16 06:49:59 2013 +0000
+++ b/tests/Makefile Sat Feb 16 12:44:25 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.39 2012/08/26 23:03:20 jmmv Exp $
+# $NetBSD: Makefile,v 1.40 2013/02/16 12:44:26 jmmv Exp $
.include <bsd.own.mk>
@@ -7,7 +7,7 @@
TESTSDIR= ${TESTSBASE}
ATFFILE= yes
-SUBDIR= bin dev examples games include kernel lib libexec net
+SUBDIR= bin dev games include kernel lib libexec net
SUBDIR+= sbin sys usr.bin usr.sbin
. if (${MKRUMP} != "no")
diff -r 8878c1f15bda -r 21187d04e55c tests/examples/Makefile
--- a/tests/examples/Makefile Sat Feb 16 06:49:59 2013 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-# $NetBSD: Makefile,v 1.1 2011/11/12 01:19:25 jmmv Exp $
-
-.include <bsd.own.mk>
-
-TESTSDIR= ${TESTSBASE}/examples
-
-TESTS_SH= t_asm
-
-.include <bsd.test.mk>
diff -r 8878c1f15bda -r 21187d04e55c tests/examples/t_asm.sh
--- a/tests/examples/t_asm.sh Sat Feb 16 06:49:59 2013 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-# $NetBSD: t_asm.sh,v 1.1 2011/11/12 01:19:25 jmmv 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.
-#
-
-# check_implemented <example_name>
-#
-# Verifies if a particular asm example is implemented for the current
-# platform. The example_name argument is the name of the subdirectory
-# of the examples/asm/ subtree that includes the code for the example
-# under test.
-#
-# If the example is not implemented, the calling test is skipped. If the
-# check for implementation fails, the calling test is failed.
-check_implemented() {
- local name="${1}"; shift
-
- local implemented=$(cd /usr/share/examples/asm/${name}/ && \
- make check-implemented)
- [ $? -eq 0 ] || atf_fail "Failed to determine if the sample" \
- "program is supported"
- [ "${implemented}" = yes ] || atf_skip "Example program not" \
- "implemented on this platform"
-}
-
-# copy_example <example_name>
-#
-# Copies the example code and supporting Makefiles into the current
-# directory.
-copy_example() {
- local name="${1}"; shift
-
- cp /usr/share/examples/asm/${name}/* .
-}
-
-atf_test_case hello
-hello_head() {
- atf_set "descr" "Builds, runs and validates the 'hello' asm example"
- atf_set "require.files" "/usr/share/examples/asm/hello/"
- atf_set "require.progs" "make"
-}
-hello_body() {
- check_implemented hello
- copy_example hello
- atf_check -s exit:0 -o ignore -e ignore make
- atf_check -s exit:0 -o inline:'Hello, world!\n' -e empty ./hello
-}
-
-atf_init_test_cases() {
- atf_add_test_case hello
-}
diff -r 8878c1f15bda -r 21187d04e55c tests/share/Makefile
--- a/tests/share/Makefile Sat Feb 16 06:49:59 2013 +0000
+++ b/tests/share/Makefile Sat Feb 16 12:44:25 2013 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.1 2012/08/26 23:03:21 jmmv Exp $
+# $NetBSD: Makefile,v 1.2 2013/02/16 12:44:26 jmmv Exp $
.include <bsd.own.mk>
TESTSDIR= ${TESTSBASE}/share
-TESTS_SUBDIRS= mk
+TESTS_SUBDIRS= examples mk
.include <bsd.test.mk>
diff -r 8878c1f15bda -r 21187d04e55c tests/share/examples/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/share/examples/Makefile Sat Feb 16 12:44:25 2013 +0000
@@ -0,0 +1,9 @@
+# $NetBSD: Makefile,v 1.1 2013/02/16 12:44:26 jmmv Exp $
+
+.include <bsd.own.mk>
+
+TESTSDIR= ${TESTSBASE}/share/examples
+
+TESTS_SH= t_asm
+
+.include <bsd.test.mk>
diff -r 8878c1f15bda -r 21187d04e55c tests/share/examples/t_asm.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/share/examples/t_asm.sh Sat Feb 16 12:44:25 2013 +0000
@@ -0,0 +1,74 @@
+# $NetBSD: t_asm.sh,v 1.1 2013/02/16 12:44:26 jmmv 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.
+#
+
+# check_implemented <example_name>
+#
+# Verifies if a particular asm example is implemented for the current
+# platform. The example_name argument is the name of the subdirectory
+# of the examples/asm/ subtree that includes the code for the example
+# under test.
+#
+# If the example is not implemented, the calling test is skipped. If the
+# check for implementation fails, the calling test is failed.
+check_implemented() {
+ local name="${1}"; shift
+
+ local implemented=$(cd /usr/share/examples/asm/${name}/ && \
+ make check-implemented)
+ [ $? -eq 0 ] || atf_fail "Failed to determine if the sample" \
+ "program is supported"
+ [ "${implemented}" = yes ] || atf_skip "Example program not" \
+ "implemented on this platform"
+}
+
+# copy_example <example_name>
+#
+# Copies the example code and supporting Makefiles into the current
+# directory.
+copy_example() {
+ local name="${1}"; shift
+
+ cp /usr/share/examples/asm/${name}/* .
+}
+
+atf_test_case hello
+hello_head() {
+ atf_set "descr" "Builds, runs and validates the 'hello' asm example"
+ atf_set "require.files" "/usr/share/examples/asm/hello/"
+ atf_set "require.progs" "make"
+}
+hello_body() {
+ check_implemented hello
+ copy_example hello
+ atf_check -s exit:0 -o ignore -e ignore make
+ atf_check -s exit:0 -o inline:'Hello, world!\n' -e empty ./hello
+}
+
+atf_init_test_cases() {
+ atf_add_test_case hello
+}
Home |
Main Index |
Thread Index |
Old Index