Skip to content

Commit

Permalink
feat: Format vader test output
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoomen committed Jun 8, 2019
1 parent e3b7f9a commit 3a44f7b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scripts/run-vader-tests
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ tests="$2"

red='\033[0;31m'
green='\033[0;32m'
blue='\033[0;34m'
nc='\033[0m'

run_file="$(mktemp -t tests_ran.XXXXXXXX)"
Expand Down Expand Up @@ -70,9 +71,11 @@ function filter-vader-output() {

function color-vader-output() {
while read -r; do
if [[ "$REPLY" = *'[EXECUTE] (X)'* ]]; then
if [[ "$REPLY" = *'(X)'* ]]; then
echo -en "$red"
elif [[ "$REPLY" = *'[EXECUTE]'* ]] || [[ "$REPLY" = *'[ GIVEN]'* ]]; then
elif [[ "$REPLY" = *'Starting Vader:'* ]]; then
echo -en "$blue"
else
echo -en "$nc"
fi

Expand All @@ -88,8 +91,14 @@ function color-vader-output() {

echo "$REPLY"
echo -en "$nc"
echo
else
echo "$REPLY"

# Split blocks by echoing an extra white line.
if [[ "$REPLY" = *'EXPECT]'* ]]; then
echo
fi
fi
done

Expand Down

0 comments on commit 3a44f7b

Please sign in to comment.