Created
December 16, 2019 15:08
-
-
Save mgoria/53f7a73c578dc797ff81e3b37af3fe50 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # report file path is passed as first argument to this script like | |
| # parse-report.sh /my-path/serenity.txt | |
| REPORT_FILE_PATH="$1" | |
| # gets the value for passed tests, to get the others just change the pattern /Passed:/ to desired one | |
| # e.g awk '/Ignored:/ {print $NF}' | |
| PASSED_COUNT=$(cat "${REPORT_FILE_PATH}" | awk '/Passed:/ {print $NF}') | |
| FAILED_COUNT=$(cat "${REPORT_FILE_PATH}" | awk '/Failed:/ {print $NF}') | |
| # those vars could be used further to apply some specific logic on them | |
| echo "Passed tests: ${PASSED_COUNT}" | |
| echo "Passed failed: ${FAILED_COUNT}" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
report sample