2023-05-01 16:07:03 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Set exit code depending on tool reports #
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
DEFINITELY_LOST=$(cat *test-results/*summary.json | jq .num_definite_bytes_lost)
|
2023-08-10 22:37:45 +00:00
|
|
|
EXIT_CODE=$(cat *test-results/*summary.json | jq .exit_code)
|
|
|
|
EXIT_REASON=$(cat *test-results/*summary.json | jq .exit_reason)
|
2023-05-01 16:07:03 +00:00
|
|
|
|
|
|
|
cat *test-results/*summary.json
|
|
|
|
|
|
|
|
echo -e "\nBytes of memory definitely lost: $DEFINITELY_LOST"
|
|
|
|
|
|
|
|
if [[ "$DEFINITELY_LOST" -gt 0 ]]; then
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-07-18 18:10:31 +00:00
|
|
|
|
2023-08-10 22:37:45 +00:00
|
|
|
# Catch-all for other non-zero exit codes
|
2023-07-18 18:10:31 +00:00
|
|
|
|
2023-08-10 22:37:45 +00:00
|
|
|
if [[ "$EXIT_CODE" -gt 0 ]]; then
|
|
|
|
echo "Test failed: $EXIT_REASON"
|
2023-07-18 18:10:31 +00:00
|
|
|
exit 1
|
2023-08-10 22:37:45 +00:00
|
|
|
fi
|