aboutsummaryrefslogtreecommitdiff
path: root/cddl/usr.sbin/dtrace
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2020-04-29 21:12:32 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2020-04-29 21:12:32 +0000
commitb155807e48a200e33a780d78a57c8865a0f104b2 (patch)
tree17e7b4df68d9107761807e5b1a188e3e46be8609 /cddl/usr.sbin/dtrace
parent74787ef47b79791a7f0a8660e2573cdc9e8c1d0b (diff)
downloadsrc-b155807e48a200e33a780d78a57c8865a0f104b2.tar.gz
src-b155807e48a200e33a780d78a57c8865a0f104b2.zip
dtrace tests: Support globbing for excludes
Downstream this makes skipping tests like common/ip/tst.*sctp*.ksh simpler. Reviewed by: vangyzen, cem, markj Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D24608
Notes
Notes: svn path=/head/; revision=360476
Diffstat (limited to 'cddl/usr.sbin/dtrace')
-rw-r--r--cddl/usr.sbin/dtrace/tests/dtrace.test.mk6
-rwxr-xr-xcddl/usr.sbin/dtrace/tests/tools/exclude.sh17
2 files changed, 20 insertions, 3 deletions
diff --git a/cddl/usr.sbin/dtrace/tests/dtrace.test.mk b/cddl/usr.sbin/dtrace/tests/dtrace.test.mk
index aaeba61e103e..0da134c0cbc2 100644
--- a/cddl/usr.sbin/dtrace/tests/dtrace.test.mk
+++ b/cddl/usr.sbin/dtrace/tests/dtrace.test.mk
@@ -1,7 +1,8 @@
# $FreeBSD$
TESTGROUP= ${.CURDIR:H:T}/${.CURDIR:T}
-TESTSRC= ${SRCTOP}/cddl/contrib/opensolaris/cmd/dtrace/test/tst/${TESTGROUP}
+TESTBASE= ${SRCTOP}/cddl/contrib/opensolaris/cmd/dtrace/test/tst
+TESTSRC= ${TESTBASE}/${TESTGROUP}
TESTSDIR= ${TESTSBASE}/cddl/usr.sbin/dtrace/${TESTGROUP}
FILESGROUPS+= ${TESTGROUP}EXE
@@ -18,7 +19,8 @@ TEST_METADATA.t_dtrace_contrib+= required_user="root"
GENTEST?= ${.CURDIR:H:H}/tools/gentest.sh
EXCLUDE= ${.CURDIR:H:H}/tools/exclude.sh
${TESTWRAPPER}.sh: ${GENTEST} ${EXCLUDE} ${${PACKAGE}FILES}
- sh ${GENTEST} -e ${EXCLUDE} ${TESTGROUP} ${${PACKAGE}FILES:S/ */ /} > ${.TARGET}
+ env TESTBASE=${TESTBASE:Q} \
+ sh ${GENTEST} -e ${EXCLUDE} ${TESTGROUP} ${${PACKAGE}FILES:S/ */ /} > ${.TARGET}
CLEANFILES+= ${TESTWRAPPER}.sh
diff --git a/cddl/usr.sbin/dtrace/tests/tools/exclude.sh b/cddl/usr.sbin/dtrace/tests/tools/exclude.sh
index db5796039a0d..5767865429e8 100755
--- a/cddl/usr.sbin/dtrace/tests/tools/exclude.sh
+++ b/cddl/usr.sbin/dtrace/tests/tools/exclude.sh
@@ -23,7 +23,22 @@
exclude()
{
- eval $1=\"\$$1\\n$2\"
+ case $2 in
+ # Handle globbing later
+ *"*"*) ;;
+ # No globbing needed
+ *)
+ eval $1=\"\$$1\\n$2\"
+ return
+ ;;
+ esac
+ for file in ${TESTBASE}/${2}; do
+ case ${file} in
+ # Invalid glob
+ "${TESTBASE}/${2}") echo "Invalid exclude for $2" >&2; exit 1; ;;
+ esac
+ exclude "$1" "${file##${TESTBASE}/}"
+ done
}
exclude EXFAIL common/aggs/tst.subr.d