mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-05-10 00:49:04 +08: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
7be571ac85
commit
1783870681
@ -108,6 +108,7 @@ FILTER=""
|
|||||||
EXCLUDE='NULL\|ARIA\|CHACHA20_POLY1305'
|
EXCLUDE='NULL\|ARIA\|CHACHA20_POLY1305'
|
||||||
VERBOSE=""
|
VERBOSE=""
|
||||||
MEMCHECK=0
|
MEMCHECK=0
|
||||||
|
PRESERVE_LOGS=0
|
||||||
PEERS="OpenSSL$PEER_GNUTLS mbedTLS"
|
PEERS="OpenSSL$PEER_GNUTLS mbedTLS"
|
||||||
|
|
||||||
# hidden option: skip DTLS with OpenSSL
|
# hidden option: skip DTLS with OpenSSL
|
||||||
@ -128,6 +129,7 @@ print_usage() {
|
|||||||
printf " -v|--verbose\tSet verbose output.\n"
|
printf " -v|--verbose\tSet verbose output.\n"
|
||||||
printf " --outcome-file\tFile where test outcomes are written\n"
|
printf " --outcome-file\tFile where test outcomes are written\n"
|
||||||
printf " \t(default: \$MBEDTLS_TEST_OUTCOME_FILE, none if empty)\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() {
|
get_options() {
|
||||||
@ -160,6 +162,9 @@ get_options() {
|
|||||||
--outcome-file)
|
--outcome-file)
|
||||||
shift; MBEDTLS_TEST_OUTCOME_FILE=$1
|
shift; MBEDTLS_TEST_OUTCOME_FILE=$1
|
||||||
;;
|
;;
|
||||||
|
--preserve-logs)
|
||||||
|
PRESERVE_LOGS=1
|
||||||
|
;;
|
||||||
-h|--help)
|
-h|--help)
|
||||||
print_usage
|
print_usage
|
||||||
exit 0
|
exit 0
|
||||||
@ -842,12 +847,16 @@ record_outcome() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
save_logs() {
|
||||||
|
cp $SRV_OUT c-srv-${TESTS}.log
|
||||||
|
cp $CLI_OUT c-cli-${TESTS}.log
|
||||||
|
}
|
||||||
|
|
||||||
# display additional information if test case fails
|
# display additional information if test case fails
|
||||||
report_fail() {
|
report_fail() {
|
||||||
FAIL_PROMPT="outputs saved to c-srv-${TESTS}.log, c-cli-${TESTS}.log"
|
FAIL_PROMPT="outputs saved to c-srv-${TESTS}.log, c-cli-${TESTS}.log"
|
||||||
record_outcome "FAIL" "$FAIL_PROMPT"
|
record_outcome "FAIL" "$FAIL_PROMPT"
|
||||||
cp $SRV_OUT c-srv-${TESTS}.log
|
save_logs
|
||||||
cp $CLI_OUT c-cli-${TESTS}.log
|
|
||||||
echo " ! $FAIL_PROMPT"
|
echo " ! $FAIL_PROMPT"
|
||||||
|
|
||||||
if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then
|
if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then
|
||||||
@ -966,6 +975,9 @@ run_client() {
|
|||||||
case $RESULT in
|
case $RESULT in
|
||||||
"0")
|
"0")
|
||||||
record_outcome "PASS"
|
record_outcome "PASS"
|
||||||
|
if [ "$PRESERVE_LOGS" -gt 0 ]; then
|
||||||
|
save_logs
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
"1")
|
"1")
|
||||||
record_outcome "SKIP"
|
record_outcome "SKIP"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user