Fix building/installing tests when TESTSBASE != /usr/tests

The work in r258233 hardcoded the assumption that tests was the last component
of the tests tree by pushing tests as an explicit prefix for the paths in
BSD.tests.dist and /usr was the prefix for all tests, per BSD.usr.dist and all
of the mtree calls used in Makefile.inc1. This assumption breaks if/when one
provides a custom TESTSBASE "prefix", e.g. TESTSBASE=/mytests .

One thing that r258233 did properly though was remove "/usr/tests" creation
from BSD.usr.dist -- that should have not been there in the first place. That
was an "oops" on my part for the work that was originally committed in r241823

MFC after: 2 weeks
Phabric: D1301
Reviewed by: imp
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2014-12-18 18:16:00 +00:00
parent eb28afe422
commit f703589ef4
6 changed files with 376 additions and 379 deletions

View File

@ -526,8 +526,9 @@ _worldtmp:
-p ${WORLDTMP}/usr/lib >/dev/null -p ${WORLDTMP}/usr/lib >/dev/null
.endif .endif
.if ${MK_TESTS} != "no" .if ${MK_TESTS} != "no"
mkdir -p ${WORLDTMP}${TESTSBASE}
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
-p ${WORLDTMP}/usr >/dev/null -p ${WORLDTMP}${TESTSBASE} >/dev/null
.endif .endif
.for _mtree in ${LOCAL_MTREE} .for _mtree in ${LOCAL_MTREE}
mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null
@ -866,8 +867,9 @@ distributeworld installworld: _installcheck_world
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null
.endif .endif
.if ${MK_TESTS} != "no" && ${dist} == "tests" .if ${MK_TESTS} != "no" && ${dist} == "tests"
-mkdir -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE}
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
-p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null -p ${DESTDIR}/${DISTDIR}/${dist}${TESTSBASE} >/dev/null
.endif .endif
.if defined(NO_ROOT) .if defined(NO_ROOT)
${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \ ${IMAKEENV} mtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \
@ -2085,8 +2087,9 @@ _xi-mtree:
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
-p ${XDDESTDIR}/usr/include >/dev/null -p ${XDDESTDIR}/usr/include >/dev/null
.if ${MK_TESTS} != "no" .if ${MK_TESTS} != "no"
mkdir -p ${XDDESTDIR}${TESTSBASE}
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \ mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
-p ${XDDESTDIR}/usr >/dev/null -p ${XDDESTDIR}${TESTSBASE} >/dev/null
.endif .endif
.ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries .ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries

View File

@ -333,7 +333,7 @@ MTREES+= mtree/BSD.debug.dist /usr/lib
MTREES+= mtree/BSD.groff.dist /usr MTREES+= mtree/BSD.groff.dist /usr
.endif .endif
.if ${MK_TESTS} != "no" .if ${MK_TESTS} != "no"
MTREES+= mtree/BSD.tests.dist /usr MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
.endif .endif
.if ${MK_SENDMAIL} != "no" .if ${MK_SENDMAIL} != "no"
MTREES+= mtree/BSD.sendmail.dist / MTREES+= mtree/BSD.sendmail.dist /
@ -349,6 +349,7 @@ distrib-dirs: ${MTREES:N/*}
shift; \ shift; \
d=${DESTDIR}$$1; \ d=${DESTDIR}$$1; \
shift; \ shift; \
test -d $$d || mkdir -p $$d; \
${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \ ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
-f $$m -p $$d; \ -f $$m -p $$d; \
${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \ ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
@ -362,6 +363,7 @@ distrib-dirs: ${MTREES:N/*}
test "$$d" == "/" && d=""; \ test "$$d" == "/" && d=""; \
d=${DISTBASE}$$d; \ d=${DISTBASE}$$d; \
shift; \ shift; \
test -d $$d || mkdir -p $$d; \
${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \ ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
"sed s#^\.#.$$d# | ${METALOG.add}" ; \ "sed s#^\.#.$$d# | ${METALOG.add}" ; \
${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \ ${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \

View File

@ -9,6 +9,10 @@
.. ..
arpa arpa
.. ..
atf-c
..
atf-c++
..
bsm bsm
.. ..
bsnmp bsnmp

View File

@ -5,410 +5,392 @@
/set type=dir uname=root gname=wheel mode=0755 /set type=dir uname=root gname=wheel mode=0755
. .
include bin
atf-c chown
.. ..
atf-c++ date
..
mv
..
pax
..
pkill
..
sh
builtins
..
errors
..
execution
..
expansion
..
parameters
..
parser
..
set-e
..
..
sleep
..
test
..
..
cddl
lib
..
sbin
..
usr.bin
..
usr.sbin
..
..
etc
..
games
..
gnu
lib
..
usr.bin
diff
..
..
..
lib
atf
libatf-c
detail
..
..
libatf-c++
detail
..
..
test-programs
..
..
libc
c063
..
db
..
gen
execve
..
posix_spawn
..
..
hash
data
..
..
inet
..
locale
..
net
getaddrinfo
data
..
..
..
regex
data
..
..
ssp
..
stdio
..
stdlib
..
string
..
sys
..
time
..
tls
dso
..
..
termios
..
ttyio
..
..
libcrypt
..
libmp
..
libnv
..
libpam
..
libproc
..
librt
..
libthr
dlopen
..
..
libutil
..
msun
..
..
libexec
atf
atf-check
..
atf-sh
..
..
rtld-elf
..
..
sbin
dhclient
..
devd
..
growfs
..
mdconfig
..
..
secure
lib
..
libexec
..
usr.bin
..
usr.sbin
.. ..
.. ..
share share
atf examples
.. tests
doc atf
atf ..
.. plain
pjdfstest ..
.. ..
.. ..
.. ..
tests sys
bin kern
..
netinet
..
opencrypto
..
pjdfstest
chflags
..
chmod
..
chown chown
.. ..
date ftruncate
.. ..
mv granular
.. ..
pax link
.. ..
pkill mkdir
.. ..
sh mkfifo
builtins
..
errors
..
execution
..
expansion
..
parameters
..
parser
..
set-e
..
.. ..
sleep mknod
.. ..
test open
.. ..
.. rename
cddl
lib
.. ..
sbin rmdir
.. ..
usr.bin symlink
..
usr.sbin
..
..
etc
..
games
..
gnu
lib
..
usr.bin
diff
..
..
..
lib
atf
libatf-c
detail
..
..
libatf-c++
detail
..
..
test-programs
..
..
libc
c063
..
db
..
gen
execve
..
posix_spawn
..
..
hash
data
..
..
inet
..
locale
..
net
getaddrinfo
data
..
..
..
regex
data
..
..
ssp
..
stdio
..
stdlib
..
string
..
sys
..
time
..
tls
dso
..
..
termios
..
ttyio
..
..
libcrypt
..
libmp
..
libnv
..
libpam
..
libproc
..
librt
..
libthr
dlopen
..
..
libutil
..
msun
..
..
libexec
atf
atf-check
..
atf-sh
..
..
rtld-elf
..
..
sbin
dhclient
..
devd
..
growfs
..
mdconfig
..
..
secure
lib
..
libexec
..
usr.bin
..
usr.sbin
..
..
share
examples
tests
atf
..
plain
..
..
..
..
sys
kern
..
netinet
..
opencrypto
..
pjdfstest
chflags
..
chmod
..
chown
..
ftruncate
..
granular
..
link
..
mkdir
..
mkfifo
..
mknod
..
open
..
rename
..
rmdir
..
symlink
..
truncate
..
unlink
..
..
..
usr.bin
apply
..
basename
..
bmake
archives
fmt_44bsd
..
fmt_44bsd_mod
..
fmt_oldbsd
..
..
basic
t0
..
t1
..
t2
..
t3
..
..
execution
ellipsis
..
empty
..
joberr
..
plus
..
..
shell
builtin
..
meta
..
path
..
path_select
..
replace
..
select
..
..
suffixes
basic
..
src_wild1
..
src_wild2
..
..
syntax
directive-t0
..
enl
..
funny-targets
..
semi
..
..
sysmk
t0
2
1
..
..
mk
..
..
t1
2
1
..
..
mk
..
..
t2
2
1
..
..
mk
..
..
..
variables
modifier_M
..
modifier_t
..
opt_V
..
t0
..
..
..
calendar
..
cmp
..
comm
..
cut
..
dirname
..
file2c
..
grep
..
gzip
..
join
..
jot
..
lastcomm
..
m4
..
mkimg
..
ncal
..
printf
..
sed
regress.multitest.out
..
..
timeout
..
tr
.. ..
truncate truncate
.. ..
units unlink
.. ..
uudecode ..
..
usr.bin
apply
..
basename
..
bmake
archives
fmt_44bsd
..
fmt_44bsd_mod
..
fmt_oldbsd
..
.. ..
uuencode basic
t0
..
t1
..
t2
..
t3
..
.. ..
xargs execution
ellipsis
..
empty
..
joberr
..
plus
..
.. ..
yacc shell
yacc builtin
..
meta
..
path
..
path_select
..
replace
..
select
..
..
suffixes
basic
..
src_wild1
..
src_wild2
..
..
syntax
directive-t0
..
enl
..
funny-targets
..
semi
..
..
sysmk
t0
2
1
..
..
mk
..
..
t1
2
1
..
..
mk
..
..
t2
2
1
..
..
mk
..
..
..
variables
modifier_M
..
modifier_t
..
opt_V
..
t0
.. ..
.. ..
.. ..
usr.sbin calendar
etcupdate ..
cmp
..
comm
..
cut
..
dirname
..
file2c
..
grep
..
gzip
..
join
..
jot
..
lastcomm
..
m4
..
mkimg
..
ncal
..
printf
..
sed
regress.multitest.out
.. ..
newsyslog ..
.. timeout
nmtree ..
.. tr
pw ..
.. truncate
sa ..
units
..
uudecode
..
uuencode
..
xargs
..
yacc
yacc
.. ..
.. ..
.. ..
usr.sbin
etcupdate
..
newsyslog
..
nmtree
..
pw
..
sa
..
..
.. ..
# vim: set expandtab ts=4 sw=4: # vim: set expandtab ts=4 sw=4:

View File

@ -126,6 +126,8 @@
sbin sbin
.. ..
share share
atf
..
bsdconfig bsdconfig
media media
.. ..
@ -169,6 +171,8 @@
doc doc
IPv6 IPv6
.. ..
atf
..
atm atm
.. ..
legal legal
@ -189,6 +193,8 @@
.. ..
papers papers
.. ..
pjdfstest
..
psd psd
01.cacm 01.cacm
.. ..

View File

@ -4663,10 +4663,10 @@ OLD_FILES+=usr/share/man/man4/atf-test-case.4.gz
OLD_FILES+=usr/share/mk/atf.test.mk OLD_FILES+=usr/share/mk/atf.test.mk
# Test suite. # Test suite.
. if(exists(${DESTDIR}/usr/tests/)) . if exists(${DESTDIR}${TESTSBASE})
TESTS_DIRS!=find ${DESTDIR}/usr/tests -type d | sed -e 's,^${DESTDIR}/,,'; echo TESTS_DIRS!=find ${DESTDIR}${TESTSBASE} -type d | sed -e 's,^${DESTDIR}/,,'; echo
OLD_DIRS+=${TESTS_DIRS} OLD_DIRS+=${TESTS_DIRS}
TESTS_FILES!=find ${DESTDIR}/usr/tests \! -type d | sed -e 's,^${DESTDIR}/,,'; echo TESTS_FILES!=find ${DESTDIR}${TESTSBASE} \! -type d | sed -e 's,^${DESTDIR}/,,'; echo
OLD_FILES+=${TESTS_FILES} OLD_FILES+=${TESTS_FILES}
. endif . endif
.endif # Test suite. .endif # Test suite.