Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Apr 2020 21:12:32 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r360476 - in head/cddl/usr.sbin/dtrace/tests: . tools
Message-ID:  <202004292112.03TLCWck003685@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Wed Apr 29 21:12:32 2020
New Revision: 360476
URL: https://svnweb.freebsd.org/changeset/base/360476

Log:
  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

Modified:
  head/cddl/usr.sbin/dtrace/tests/dtrace.test.mk
  head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh

Modified: head/cddl/usr.sbin/dtrace/tests/dtrace.test.mk
==============================================================================
--- head/cddl/usr.sbin/dtrace/tests/dtrace.test.mk	Wed Apr 29 19:28:56 2020	(r360475)
+++ head/cddl/usr.sbin/dtrace/tests/dtrace.test.mk	Wed Apr 29 21:12:32 2020	(r360476)
@@ -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
 

Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh
==============================================================================
--- head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh	Wed Apr 29 19:28:56 2020	(r360475)
+++ head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh	Wed Apr 29 21:12:32 2020	(r360476)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004292112.03TLCWck003685>