Module Name: src
Committed By: jmmv
Date: Sat Feb 16 12:44:26 UTC 2013
Modified Files:
src/distrib/sets/lists/tests: mi
src/etc/mtree: NetBSD.dist.tests
src/tests: Makefile
src/tests/share: Makefile
Added Files:
src/tests/share/examples: Makefile t_asm.sh
Removed Files:
src/tests/examples: Makefile t_asm.sh
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.516 -r1.517 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.90 -r1.91 src/etc/mtree/NetBSD.dist.tests
cvs rdiff -u -r1.39 -r1.40 src/tests/Makefile
cvs rdiff -u -r1.1 -r0 src/tests/examples/Makefile \
src/tests/examples/t_asm.sh
cvs rdiff -u -r1.1 -r1.2 src/tests/share/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/share/examples/Makefile \
src/tests/share/examples/t_asm.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.516 src/distrib/sets/lists/tests/mi:1.517
--- src/distrib/sets/lists/tests/mi:1.516 Fri Feb 15 17:09:09 2013
+++ src/distrib/sets/lists/tests/mi Sat Feb 16 12:44:25 2013
@@ -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
Index: src/etc/mtree/NetBSD.dist.tests
diff -u src/etc/mtree/NetBSD.dist.tests:1.90 src/etc/mtree/NetBSD.dist.tests:1.91
--- src/etc/mtree/NetBSD.dist.tests:1.90 Fri Nov 23 08:36:47 2012
+++ src/etc/mtree/NetBSD.dist.tests Sat Feb 16 12:44:26 2013
@@ -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
Index: src/tests/Makefile
diff -u src/tests/Makefile:1.39 src/tests/Makefile:1.40
--- src/tests/Makefile:1.39 Sun Aug 26 23:03:20 2012
+++ src/tests/Makefile Sat Feb 16 12:44:26 2013
@@ -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")
Index: src/tests/share/Makefile
diff -u src/tests/share/Makefile:1.1 src/tests/share/Makefile:1.2
--- src/tests/share/Makefile:1.1 Sun Aug 26 23:03:21 2012
+++ src/tests/share/Makefile Sat Feb 16 12:44:26 2013
@@ -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>
Added files:
Index: src/tests/share/examples/Makefile
diff -u /dev/null src/tests/share/examples/Makefile:1.1
--- /dev/null Sat Feb 16 12:44:26 2013
+++ src/tests/share/examples/Makefile Sat Feb 16 12:44:26 2013
@@ -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>
Index: src/tests/share/examples/t_asm.sh
diff -u /dev/null src/tests/share/examples/t_asm.sh:1.1
--- /dev/null Sat Feb 16 12:44:26 2013
+++ src/tests/share/examples/t_asm.sh Sat Feb 16 12:44:26 2013
@@ -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
+}