summaryrefslogtreecommitdiffstats
path: root/share/examples
diff options
context:
space:
mode:
Diffstat (limited to 'share/examples')
-rw-r--r--share/examples/tests/Makefile8
-rw-r--r--share/examples/tests/tests/Makefile5
-rw-r--r--share/examples/tests/tests/atf/Makefile23
-rw-r--r--share/examples/tests/tests/atf/cp_test.sh4
-rw-r--r--share/examples/tests/tests/plain/Makefile23
-rw-r--r--share/examples/tests/tests/plain/cp_test.sh11
6 files changed, 45 insertions, 29 deletions
diff --git a/share/examples/tests/Makefile b/share/examples/tests/Makefile
index 77d89a4..df273c9 100644
--- a/share/examples/tests/Makefile
+++ b/share/examples/tests/Makefile
@@ -1,13 +1,5 @@
# $FreeBSD$
-.include <bsd.own.mk>
-
-FILESGROUPS= FILES
-PACKAGE= tests
-FILESGROUPS+= TESTS
-TESTSPACKAGE= ${PACKAGE}
-TESTS+= Kyuafile
-
SUBDIR= tests
.PATH: ${SRCTOP}/tests
diff --git a/share/examples/tests/tests/Makefile b/share/examples/tests/tests/Makefile
index 08b6049..9f7b5a4 100644
--- a/share/examples/tests/tests/Makefile
+++ b/share/examples/tests/tests/Makefile
@@ -2,11 +2,6 @@
.include <bsd.own.mk>
-FILESGROUPS= FILES
-PACKAGE= tests
-FILESGROUPS+= TESTS
-TESTSPACKAGE= ${PACKAGE}
-
# Directory into which the Kyuafile provided by this directory will be
# installed.
#
diff --git a/share/examples/tests/tests/atf/Makefile b/share/examples/tests/tests/atf/Makefile
index 6628a21..c846d67 100644
--- a/share/examples/tests/tests/atf/Makefile
+++ b/share/examples/tests/tests/atf/Makefile
@@ -2,11 +2,11 @@
.include <bsd.own.mk>
-FILESGROUPS= FILES
+# The release package to use for the tests contained within the directory
+#
+# This applies to components which rely on ^/projects/release-pkg support
+# (see UPDATING XXXXXXXXX / svn revision r298107).
PACKAGE= tests
-FILESGROUPS+= TESTS
-TESTSPACKAGE= ${PACKAGE}
-TESTS+= Kyuafile
# Directory into which the Kyuafile provided by this directory will be
# installed.
@@ -33,4 +33,19 @@ ATF_TESTS_SH= cp_test
# definitions from above.
KYUAFILE= yes
+# Install file1 and file2 as files via bsd.prog.mk. Please note the intentional
+# ${PACKAGE} namespace of files.
+#
+# The basic semantics of this are the same as FILES in bsd.prog.mk, e.g. the
+# installation of the files can be manipulated via ${PACKAGE}FILESDIR,
+# ${PACKAGE}FILESMODE, etc.
+#
+# Please see comment above about ${PACKAGE}. Feel free to omit the ${PACKAGE}
+# namespace if release package support isn't needed.
+${PACKAGE}FILES+= file1
+CLEANFILES+= file1
+
+file1:
+ @echo "File 1" > ${.TARGET}
+
.include <bsd.test.mk>
diff --git a/share/examples/tests/tests/atf/cp_test.sh b/share/examples/tests/tests/atf/cp_test.sh
index 83d6914..befec09 100644
--- a/share/examples/tests/tests/atf/cp_test.sh
+++ b/share/examples/tests/tests/atf/cp_test.sh
@@ -61,7 +61,7 @@ verify_copy() {
#
atf_test_case simple
simple_body() {
- echo 'File 1' >file1
+ cp $(atf_get_srcdir)/file1 .
# The atf_check function is a very powerful function of atf-sh.
# It allows you to define checkers for the exit status, the
@@ -102,7 +102,7 @@ force_head() {
"override the destination file"
}
force_body() {
- echo 'File 1' >file1
+ cp $(atf_get_srcdir)/file1 .
echo 'File 2' >file2
chmod 400 file2
atf_check cp -f file1 file2
diff --git a/share/examples/tests/tests/plain/Makefile b/share/examples/tests/tests/plain/Makefile
index e01de61..d9807aa 100644
--- a/share/examples/tests/tests/plain/Makefile
+++ b/share/examples/tests/tests/plain/Makefile
@@ -2,11 +2,11 @@
.include <bsd.own.mk>
-FILESGROUPS= FILES
+# The release package to use for the tests contained within the directory
+#
+# This applies to components which rely on ^/projects/release-pkg support
+# (see UPDATING XXXXXXXXX / svn revision r298107).
PACKAGE= tests
-FILESGROUPS+= TESTS
-TESTSPACKAGE= ${PACKAGE}
-TESTS+= Kyuafile
# Directory into which the Kyuafile provided by this directory will be
# installed.
@@ -33,4 +33,19 @@ PLAIN_TESTS_SH= cp_test
# definitions from above.
KYUAFILE= yes
+# Install file1 and file2 as files via bsd.prog.mk. Please note the intentional
+# ${PACKAGE} namespace of files.
+#
+# The basic semantics of this are the same as FILES in bsd.prog.mk, e.g. the
+# installation of the files can be manipulated via ${PACKAGE}FILESDIR,
+# ${PACKAGE}FILESMODE, etc.
+#
+# Please see comment above about ${PACKAGE}. Feel free to omit the ${PACKAGE}
+# namespace if release package support isn't needed.
+${PACKAGE}FILES+= file1
+CLEANFILES+= file1
+
+file1:
+ @echo "File 1" > ${.TARGET}
+
.include <bsd.test.mk>
diff --git a/share/examples/tests/tests/plain/cp_test.sh b/share/examples/tests/tests/plain/cp_test.sh
index c45d684..b47d33d 100644
--- a/share/examples/tests/tests/plain/cp_test.sh
+++ b/share/examples/tests/tests/plain/cp_test.sh
@@ -57,17 +57,16 @@ verify_copy() {
}
simple_test() {
- echo 'File 1' >file1
+ cp "$(dirname "${0}")/file1" .
cp file1 file2 || err "cp failed"
verify_copy file1 file2
}
force_test() {
- echo 'File 1' >file1
- echo 'File 2' >file2
- chmod 400 file2
- cp -f file1 file2 || err "cp failed"
- verify_copy file1 file2
+ echo 'File 3' >file3
+ chmod 400 file3
+ cp -f file1 file3 || err "cp failed"
+ verify_copy file1 file3
}
# If you have read the cp_test.sh counterpart in the atf/ directory, you
OpenPOWER on IntegriCloud