Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed
after r298107
Summary of changes:
- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that
namespacing is kept with FILES appropriately, and that this shouldn't need
to be repeated if the namespace changes -- only the definition of PACKAGE
needs to be changed
- Allow PACKAGE to be overridden by callers instead of forcing it to always be
`tests`. In the event we get to the point where things can be split up
enough in the base system, it would make more sense to group the tests
with the blocks they're a part of, e.g. byacc with byacc-tests, etc
- Remove PACKAGE definitions where possible, i.e. where FILES wasn't used
previously.
- Remove unnecessary TESTSPACKAGE definitions; this has been elided into
bsd.tests.mk
- Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES;
${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk.
- Fix installation of files under data/ subdirectories in lib/libc/tests/hash
and lib/libc/tests/net/getaddrinfo
- Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)
Document the proposed changes in share/examples/tests/tests/... via examples
so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of
replacing FILES. share/mk/bsd.README didn't seem like the appropriate method
of communicating that info.
MFC after: never probably
X-MFC with: r298107
PR: 209114
Relnotes: yes
Tested with: buildworld, installworld, checkworld; buildworld, packageworld
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
@@ -1,13 +1,5 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
FILESGROUPS= FILES
|
||||
PACKAGE= tests
|
||||
FILESGROUPS+= TESTS
|
||||
TESTSPACKAGE= ${PACKAGE}
|
||||
TESTS+= Kyuafile
|
||||
|
||||
SUBDIR= tests
|
||||
|
||||
.PATH: ${SRCTOP}/tests
|
||||
|
||||
@@ -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.
|
||||
#
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user