mirror of
https://github.com/cuberite/polarssl.git
synced 2025-09-06 13:47:12 -04:00
compat.sh: add --preserve-logs option
Similar to ssl-opt.sh. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
549a96120e
commit
67bf9f6359
@ -110,6 +110,7 @@ FILTER=""
|
||||
EXCLUDE='NULL\|DES\|RC4\|ARCFOUR\|ARIA\|CHACHA20-POLY1305'
|
||||
VERBOSE=""
|
||||
MEMCHECK=0
|
||||
PRESERVE_LOGS=0
|
||||
PEERS="OpenSSL$PEER_GNUTLS mbedTLS"
|
||||
|
||||
# hidden option: skip DTLS with OpenSSL
|
||||
@ -130,6 +131,7 @@ print_usage() {
|
||||
printf " -v|--verbose\tSet verbose output.\n"
|
||||
printf " --outcome-file\tFile where test outcomes are written\n"
|
||||
printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\n"
|
||||
printf " --preserve-logs\tPreserve logs of successful tests as well\n"
|
||||
}
|
||||
|
||||
get_options() {
|
||||
@ -162,6 +164,9 @@ get_options() {
|
||||
--outcome-file)
|
||||
shift; MBEDTLS_TEST_OUTCOME_FILE=$1
|
||||
;;
|
||||
--preserve-logs)
|
||||
PRESERVE_LOGS=1
|
||||
;;
|
||||
-h|--help)
|
||||
print_usage
|
||||
exit 0
|
||||
@ -1182,12 +1187,16 @@ record_outcome() {
|
||||
fi
|
||||
}
|
||||
|
||||
save_logs() {
|
||||
cp $SRV_OUT c-srv-${TESTS}.log
|
||||
cp $CLI_OUT c-cli-${TESTS}.log
|
||||
}
|
||||
|
||||
# display additional information if test case fails
|
||||
report_fail() {
|
||||
FAIL_PROMPT="outputs saved to c-srv-${TESTS}.log, c-cli-${TESTS}.log"
|
||||
record_outcome "FAIL" "$FAIL_PROMPT"
|
||||
cp $SRV_OUT c-srv-${TESTS}.log
|
||||
cp $CLI_OUT c-cli-${TESTS}.log
|
||||
save_logs
|
||||
echo " ! $FAIL_PROMPT"
|
||||
|
||||
if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then
|
||||
@ -1307,6 +1316,9 @@ run_client() {
|
||||
case $RESULT in
|
||||
"0")
|
||||
record_outcome "PASS"
|
||||
if [ "$PRESERVE_LOGS" -gt 0 ]; then
|
||||
save_logs
|
||||
fi
|
||||
;;
|
||||
"1")
|
||||
record_outcome "SKIP"
|
||||
|
Loading…
x
Reference in New Issue
Block a user