Add --filter, --exclude to ssl-opt.sh
This commit is contained in:
parent
74faf3c400
commit
417d46cdb0
1 changed files with 17 additions and 2 deletions
|
@ -22,16 +22,26 @@ TESTS=0
|
||||||
FAILS=0
|
FAILS=0
|
||||||
|
|
||||||
MEMCHECK=0
|
MEMCHECK=0
|
||||||
|
FILTER='.*'
|
||||||
|
EXCLUDE='SSLv2' # disabled by default, needs OpenSSL compiled with SSLv2
|
||||||
|
|
||||||
print_usage() {
|
print_usage() {
|
||||||
echo "Usage: $0 [options]"
|
echo "Usage: $0 [options]"
|
||||||
echo -e " -h, --help\tPrint this help."
|
echo -e " -h|--help\tPrint this help."
|
||||||
echo -e " -m, --memcheck\tCheck memory leaks and errors."
|
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() {
|
get_options() {
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
-f|--filter)
|
||||||
|
shift; FILTER=$1
|
||||||
|
;;
|
||||||
|
-e|--exclude)
|
||||||
|
shift; EXCLUDE=$1
|
||||||
|
;;
|
||||||
-m|--memcheck)
|
-m|--memcheck)
|
||||||
MEMCHECK=1
|
MEMCHECK=1
|
||||||
;;
|
;;
|
||||||
|
@ -100,6 +110,11 @@ run_test() {
|
||||||
CLI_EXPECT="$4"
|
CLI_EXPECT="$4"
|
||||||
shift 4
|
shift 4
|
||||||
|
|
||||||
|
if echo "$NAME" | grep "$FILTER" | grep -v "$EXCLUDE" >/dev/null; then :
|
||||||
|
else
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
print_name "$NAME"
|
print_name "$NAME"
|
||||||
|
|
||||||
# prepend valgrind to our commands if active
|
# prepend valgrind to our commands if active
|
||||||
|
|
Loading…
Reference in a new issue