Skip to content

Commit

Permalink
verify_examples.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
phlax committed Jul 31, 2024
1 parent f3dcd4e commit 3c09a7d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions verify_examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m'
RETURNS=0

trim () {
text=$(< /dev/stdin)
Expand All @@ -23,15 +24,22 @@ for result in "$@"; do
RESULT=$(head -n1 "$result")
NAME=$(echo $RESULT | cut -d: -f1 | trim)
EXITCODE=$(echo $RESULT | cut -d: -f2 | trim)
TIME=$(echo $RESULT | cut -d: -f3 | trim)
OUTCOME=$(pass "${TIME}")
RETURNS=0
if [[ $EXITCODE != 0 ]]; then
echo
echo -e "============= ${RED}FAILED (${NAME})${NC} ===================="
tail -n+3 $result
echo -e "============ ${RED}/FAILED (${NAME})${NC} ===================="
echo
fi
done

for result in "$@"; do
RESULT=$(head -n1 "$result")
NAME=$(echo $RESULT | cut -d: -f1 | trim)
EXITCODE=$(echo $RESULT | cut -d: -f2 | trim)
TIME=$(echo $RESULT | cut -d: -f3 | trim)
OUTCOME=$(pass "${TIME}")
if [[ $EXITCODE != 0 ]]; then
OUTCOME=$(fail "${TIME}" "$EXITCODE")
RETURNS=1
fi
Expand Down

0 comments on commit 3c09a7d

Please sign in to comment.