mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-12 08:55:31 +00:00
Merge pull request #476 from pjbakker/numbered-tests-ssl-opt
Update ssl-opt.sh capabilities to help with debugging
This commit is contained in:
commit
3a3159a674
|
@ -33,12 +33,20 @@ MEMCHECK=0
|
||||||
FILTER='.*'
|
FILTER='.*'
|
||||||
EXCLUDE='^$'
|
EXCLUDE='^$'
|
||||||
|
|
||||||
|
SHOW_TEST_NUMBER=0
|
||||||
|
RUN_TEST_NUMBER=''
|
||||||
|
|
||||||
|
PRESERVE_LOGS=0
|
||||||
|
|
||||||
print_usage() {
|
print_usage() {
|
||||||
echo "Usage: $0 [options]"
|
echo "Usage: $0 [options]"
|
||||||
printf " -h|--help\tPrint this help.\n"
|
printf " -h|--help\tPrint this help.\n"
|
||||||
printf " -m|--memcheck\tCheck memory leaks and errors.\n"
|
printf " -m|--memcheck\tCheck memory leaks and errors.\n"
|
||||||
printf " -f|--filter\tOnly matching tests are executed (default: '$FILTER')\n"
|
printf " -f|--filter\tOnly matching tests are executed (default: '$FILTER')\n"
|
||||||
printf " -e|--exclude\tMatching tests are excluded (default: '$EXCLUDE')\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"
|
||||||
|
printf " -s|--show-numbers\tShow test numbers in front of test names\n"
|
||||||
|
printf " -p|--preserve-logs\tPreserve logs of successful tests as well\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
get_options() {
|
get_options() {
|
||||||
|
@ -53,6 +61,15 @@ get_options() {
|
||||||
-m|--memcheck)
|
-m|--memcheck)
|
||||||
MEMCHECK=1
|
MEMCHECK=1
|
||||||
;;
|
;;
|
||||||
|
-n|--number)
|
||||||
|
shift; RUN_TEST_NUMBER=$1
|
||||||
|
;;
|
||||||
|
-s|--show-numbers)
|
||||||
|
SHOW_TEST_NUMBER=1
|
||||||
|
;;
|
||||||
|
-p|--preserve-logs)
|
||||||
|
PRESERVE_LOGS=1
|
||||||
|
;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
print_usage
|
print_usage
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -144,12 +161,19 @@ needs_more_time() {
|
||||||
|
|
||||||
# print_name <name>
|
# print_name <name>
|
||||||
print_name() {
|
print_name() {
|
||||||
printf "$1 "
|
TESTS=$(( $TESTS + 1 ))
|
||||||
LEN=$(( 72 - `echo "$1" | wc -c` ))
|
LINE=""
|
||||||
|
|
||||||
|
if [ "$SHOW_TEST_NUMBER" -gt 0 ]; then
|
||||||
|
LINE="$TESTS "
|
||||||
|
fi
|
||||||
|
|
||||||
|
LINE="$LINE$1"
|
||||||
|
printf "$LINE "
|
||||||
|
LEN=$(( 72 - `echo "$LINE" | wc -c` ))
|
||||||
for i in `seq 1 $LEN`; do printf '.'; done
|
for i in `seq 1 $LEN`; do printf '.'; done
|
||||||
printf ' '
|
printf ' '
|
||||||
|
|
||||||
TESTS=$(( $TESTS + 1 ))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# fail <message>
|
# fail <message>
|
||||||
|
@ -300,6 +324,13 @@ run_test() {
|
||||||
|
|
||||||
print_name "$NAME"
|
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?
|
# should we skip?
|
||||||
if [ "X$SKIP_NEXT" = "XYES" ]; then
|
if [ "X$SKIP_NEXT" = "XYES" ]; then
|
||||||
SKIP_NEXT="NO"
|
SKIP_NEXT="NO"
|
||||||
|
@ -468,6 +499,11 @@ run_test() {
|
||||||
|
|
||||||
# if we're here, everything is ok
|
# if we're here, everything is ok
|
||||||
echo "PASS"
|
echo "PASS"
|
||||||
|
if [ "$PRESERVE_LOGS" -gt 0 ]; then
|
||||||
|
mv $SRV_OUT o-srv-${TESTS}.log
|
||||||
|
mv $CLI_OUT o-cli-${TESTS}.log
|
||||||
|
fi
|
||||||
|
|
||||||
rm -f $SRV_OUT $CLI_OUT $PXY_OUT
|
rm -f $SRV_OUT $CLI_OUT $PXY_OUT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue