testing: Support running multiple tests with * as wildcard (e.g. ikev2/ocsp-*)
authorTobias Brunner <tobias@strongswan.org>
Fri, 7 Jul 2017 07:23:14 +0000 (09:23 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 7 Jul 2017 07:23:14 +0000 (09:23 +0200)
testing/do-tests

index 60c34c7..230403b 100755 (executable)
@@ -207,12 +207,16 @@ for SUBDIR in $TESTS
 do
     SUBTESTS="`basename $SUBDIR`"
 
-    if [ $SUBTESTS = $SUBDIR ]
-    then
-       SUBTESTS="`ls $DEFAULTTESTSDIR/$SUBDIR`"
-    else
-       SUBDIR="`dirname $SUBDIR`"
-    fi
+       if [ $SUBTESTS = $SUBDIR ]
+       then
+               SUBTESTS="`ls $DEFAULTTESTSDIR/$SUBDIR`"
+       else
+               if [[ $SUBTESTS == *'*'* ]]
+               then
+                       SUBTESTS="`basename -a $DEFAULTTESTSDIR/$SUBDIR`"
+               fi
+               SUBDIR="`dirname $SUBDIR`"
+       fi
 
     if [ ! -d $TODAYDIR/$SUBDIR ]
     then