Add ability to only run select numbered tests in ssl-opt.sh
In order to reduce debugging time, allows you to only run interesting
tests (by number) from the commandline.
e.g. the command 'tests/ssl-opt.sh -n 246,258' will only run test 246
and 258 (as per the number in the log file names)
diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh
index 1a91f7a..d2cccdb 100755
--- a/tests/ssl-opt.sh
+++ b/tests/ssl-opt.sh
@@ -33,12 +33,15 @@
FILTER='.*'
EXCLUDE='^$'
+RUN_TEST_NUMBER=''
+
print_usage() {
echo "Usage: $0 [options]"
printf " -h|--help\tPrint this help.\n"
printf " -m|--memcheck\tCheck memory leaks and errors.\n"
printf " -f|--filter\tOnly matching tests are executed (default: '$FILTER')\n"
printf " -e|--exclude\tMatching tests are excluded (default: '$EXCLUDE')\n"
+ printf " -n|--number\tExecute only numbered test (comma-separated, e.g. '245,256')\n"
}
get_options() {
@@ -53,6 +56,9 @@
-m|--memcheck)
MEMCHECK=1
;;
+ -n|--number)
+ shift; RUN_TEST_NUMBER=$1
+ ;;
-h|--help)
print_usage
exit 0
@@ -293,6 +299,13 @@
print_name "$NAME"
+ # Do we only run numbered tests?
+ if [ "X$RUN_TEST_NUMBER" = "X" ]; then :
+ elif echo ",$RUN_TEST_NUMBER," | grep ",$TESTS," >/dev/null; then :
+ else
+ SKIP_NEXT="YES"
+ fi
+
# should we skip?
if [ "X$SKIP_NEXT" = "XYES" ]; then
SKIP_NEXT="NO"