validate-report.sh 749 B

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. ################################################################################
  3. # Set exit code depending on tool reports #
  4. ################################################################################
  5. DEFINITELY_LOST=$(cat *test-results/*summary.json | jq .num_definite_bytes_lost)
  6. EXIT_CODE=$(cat *test-results/*summary.json | jq .exit_code)
  7. EXIT_REASON=$(cat *test-results/*summary.json | jq .exit_reason)
  8. cat *test-results/*summary.json
  9. echo -e "\nBytes of memory definitely lost: $DEFINITELY_LOST"
  10. if [[ "$DEFINITELY_LOST" -gt 0 ]]; then
  11. exit 1
  12. fi
  13. # Catch-all for other non-zero exit codes
  14. if [[ "$EXIT_CODE" -gt 0 ]]; then
  15. echo "Test failed: $EXIT_REASON"
  16. exit 1
  17. fi