Add --filter, --exclude to ssl-opt.sh

This commit is contained in:
Manuel Pégourié-Gonnard 2014-03-13 19:17:53 +01:00
parent 74faf3c400
commit 417d46cdb0

View file

@ -22,16 +22,26 @@ TESTS=0
FAILS=0
MEMCHECK=0
FILTER='.*'
EXCLUDE='SSLv2' # disabled by default, needs OpenSSL compiled with SSLv2
print_usage() {
echo "Usage: $0 [options]"
echo -e " -h, --help\tPrint this help."
echo -e " -m, --memcheck\tCheck memory leaks and errors."
echo -e " -h|--help\tPrint this help."
echo -e " -m|--memcheck\tCheck memory leaks and errors."
echo -e " -f|--filter\tOnly matching tests are executed (default: '$FILTER')"
echo -e " -e|--exclude\tMatching tests are excluded (default: '$EXCLUDE')"
}
get_options() {
while [ $# -gt 0 ]; do
case "$1" in
-f|--filter)
shift; FILTER=$1
;;
-e|--exclude)
shift; EXCLUDE=$1
;;
-m|--memcheck)
MEMCHECK=1
;;
@ -100,6 +110,11 @@ run_test() {
CLI_EXPECT="$4"
shift 4
if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then :
else
return
fi
print_name "$NAME"
# prepend valgrind to our commands if active