Skip to content

Commit

Permalink
compat.sh: call record_fail if test case fails
Browse files Browse the repository at this point in the history
Signed-off-by: Yanray Wang <[email protected]>
  • Loading branch information
Yanray Wang committed Feb 28, 2023
1 parent dd4427c commit f45a8ea
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions tests/compat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,22 @@ wait_client_done() {
echo "EXIT: $EXIT" >> $CLI_OUT
}

# display additional information if test case fails
report_fail() {
echo "FAIL"
cp $SRV_OUT c-srv-${TESTS}.log
cp $CLI_OUT c-cli-${TESTS}.log
echo " ! outputs saved to c-srv-${TESTS}.log, c-cli-${TESTS}.log"

if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then
echo " ! server output:"
cat c-srv-${TESTS}.log
echo " ! ==================================================="
echo " ! client output:"
cat c-cli-${TESTS}.log
fi
}

# run_client PROGRAM_NAME STANDARD_CIPHER_SUITE PROGRAM_CIPHER_SUITE
run_client() {
# announce what we're going to do
Expand Down Expand Up @@ -903,19 +919,7 @@ run_client() {
SKIPPED=$(( $SKIPPED + 1 ))
;;
"2")
echo FAIL
cp $SRV_OUT c-srv-${TESTS}.log
cp $CLI_OUT c-cli-${TESTS}.log
echo " ! outputs saved to c-srv-${TESTS}.log, c-cli-${TESTS}.log"

if [ "${LOG_FAILURE_ON_STDOUT:-0}" != 0 ]; then
echo " ! server output:"
cat c-srv-${TESTS}.log
echo " ! ==================================================="
echo " ! client output:"
cat c-cli-${TESTS}.log
fi

report_fail
FAILED=$(( $FAILED + 1 ))
;;
esac
Expand Down

0 comments on commit f45a8ea

Please sign in to comment.